Exemplo n.º 1
0
    def save_output(self):
        directory = '/tmp/javaconsole/%s' % datetime.now().strftime("%Y-%d-%m_%H.%M.%S")
        if not os.path.exists(directory):
            os.makedirs(directory)

            if os.path.exists(MAIN_FILE) is not True:
                shutil.copyfile(START_FILE, MAIN_FILE)
                self.parse_file(MAIN_FILE)

            shutil.copyfile(MAIN_FILE, directory + '/main.java')
            for class_name in self.full_class_names:
                shutil.copyfile(Util.pretty_class(class_name), directory + '/%s' % class_name)