コード例 #1
0
ファイル: stdlib.py プロジェクト: cmnt1/brython-pack
 def install_requires(self, modules):
     """Build brython_modules.js from the list of modules needed by the
     application.
     """
     vfs = {}
     for module in modules:
         if module in self.stdlib:
             vfs[module] = self.stdlib[module]
             src = vfs[module][1]
             if vfs[module][0] == ".py":
                 src = "\n".join(list(utils.filter_out_docstring(src)))
             src = utils.remove_useless_newlines(src)
             vfs[module][1] = src
         else:
             print("%s is not found" % module)
     return vfs
コード例 #2
0
def test_newline_removal():
    matrix = ['\n\n\n\n', '\n \n\n \n', '\n\n \n \n' '\n\n \n\n\n\n']
    for test in matrix:
        result = utils.remove_useless_newlines(test)
        eq_(result, '\n\n')
コード例 #3
0
def test_newline_removal():
    matrix = ["\n\n\n\n", "\n \n\n \n", "\n\n \n \n" "\n\n \n\n\n\n"]
    for test in matrix:
        result = utils.remove_useless_newlines(test)
        eq_(result, "\n")