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
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')
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")