コード例 #1
0
ファイル: main.py プロジェクト: pombredanne/brython-pack
def process(lib_file, req_file, packages_and_files):
    # real work:
    std_deps = cherry_pick_lib(lib_file, req_file)
    pack = pack_up(packages_and_files)
    # merge all
    std_deps.update(pack)
    make_brython_modules(std_deps)
コード例 #2
0
 def test_make_brython_modules_log(self):
     vfs = {
         'testmodule': ['.py', 'print("hello world")'],
         'testjs': ['.js', 'console.log("hello world");']
     }
     utils.make_brython_modules(vfs)
     with open('brython_modules.log.txt', 'r') as f:
         self.assertMultiLineEqual(TEST_MODULE_LOG, f.read())
コード例 #3
0
 def test_make_brython_modules_log(self):
     vfs = {
         "testmodule": [".py", 'print("hello world")'],
         "testjs": [".js", 'console.log("hello world");'],
     }
     utils.make_brython_modules(vfs)
     with open("brython_modules.log.txt", "r") as f:
         self.assertMultiLineEqual(TEST_MODULE_LOG, f.read())
コード例 #4
0
 def test_make_brython_modules_js(self):
     vfs = {'testjs': ['.js', 'console.log("hello world");']}
     utils.make_brython_modules(vfs)
     with open('brython_modules.js', 'r') as f:
         content = f.read()
         assert 'testjs' in content
コード例 #5
0
 def test_make_brython_modules_js(self):
     vfs = {"testjs": [".js", 'console.log("hello world");']}
     utils.make_brython_modules(vfs)
     with open("brython_modules.js", "r") as f:
         content = f.read()
         assert "testjs" in content