コード例 #1
0
ファイル: command.py プロジェクト: Boscillator/coconut
 def callback(compiled):
     if destpath is None:
         logger.show_tabulated("Finished", showpath(codepath), "without writing to file.")
     else:
         with openfile(destpath, "w") as opened:
             writefile(opened, compiled)
         logger.show_tabulated("Compiled to", showpath(destpath), ".")
     if self.show:
         print(compiled)
     if run:
         if destpath is None:
             self.execute(compiled, path=codepath, allow_show=False)
         else:
             self.execute_file(destpath)
コード例 #2
0
ファイル: command.py プロジェクト: x10an14/coconut
 def callback(compiled):
     if destpath is None:
         logger.show_tabulated("Finished", showpath(codepath),
                               "without writing to file.")
     else:
         with openfile(destpath, "w") as opened:
             writefile(opened, compiled)
         logger.show_tabulated("Compiled to", showpath(destpath),
                               ".")
     if run:
         runpath = destpath if destpath is not None else codepath
         self.execute(compiled, path=runpath, isolate=True)
     elif self.show:
         print(compiled)
コード例 #3
0
ファイル: command.py プロジェクト: zhenyulin/coconut
 def callback(compiled):
     if destpath is None:
         logger.show_tabulated("Compiled", showpath(codepath), "without writing to file.")
     else:
         with openfile(destpath, "w") as opened:
             writefile(opened, compiled)
         logger.show_tabulated("Compiled to", showpath(destpath), ".")
     if self.show:
         print(compiled)
     if run:
         if destpath is None:
             self.execute(compiled, path=codepath, allow_show=False)
         else:
             self.execute_file(destpath)
コード例 #4
0
ファイル: command.py プロジェクト: Boscillator/coconut
 def create_package(self, dirpath):
     """Sets up a package directory."""
     dirpath = fixpath(dirpath)
     filepath = os.path.join(dirpath, "__coconut__.py")
     with openfile(filepath, "w") as opened:
         writefile(opened, self.comp.getheader("__coconut__"))
コード例 #5
0
ファイル: command.py プロジェクト: CS121Fresh/compiler
 def create_package(self, dirpath):
     """Set up a package directory."""
     dirpath = fixpath(dirpath)
     filepath = os.path.join(dirpath, "__coconut__.py")
     with openfile(filepath, "w") as opened:
         writefile(opened, self.comp.getheader("__coconut__"))
コード例 #6
0
ファイル: command.py プロジェクト: x10an14/coconut
 def create_package(self, dirpath):
     """Sets up a package directory."""
     filepath = os.path.join(fixpath(dirpath), "__coconut__.py")
     with openfile(filepath, "w") as opened:
         writefile(opened, self.comp.headers("package"))