Beispiel #1
0
 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)
Beispiel #2
0
 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)
Beispiel #3
0
 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)
Beispiel #4
0
 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__"))
Beispiel #5
0
 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__"))
Beispiel #6
0
 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"))