atsepkov/RapydScript — pull request #10 by pgeorgiak (2014-04-25 01:19:57+00:00)
Title: Output AMD compliant Javascript modules.  i.e. using requires.

Example code:

file: main/rapyd_main.py
```
from test1 import foo

print("Load rapyd_main")
foo()
```

file: main/test1.py
```
def foo():
print("Running foo")
```

Each file will be processed separately by invoking as follows:
```
rapydscript main/rapyd_main.py --py=.py --amd -m -p -o rapyd_main.js
rapydscript main/test1.py --py=.py --amd -m -p -o test1.js
```
The resulting files look like this:

file: rapyd_main.js
```
define('main/rapyd_main',
[
"main/test1"
],
function(main_test1){
var foo = main_test1.foo;

_$rapyd$_print("Load rapyd_main");
foo();
return {
foo: foo
};
});
```

file: test1.js
```
define('main/test1',
[
],
function(){
function foo() {
_$rapyd$_print("Running foo");
}
return {
foo: foo
};
});
```

I have not done extensive testing yet with this but have applied it to more complicated code than the above example.

Cheers,

Peter G.