Ejemplo n.º 1
0
 def save_file(self):
     root_folder = self.GetTopLevelParent().get_root_folder()
     text = self.__get_selected_tab_text()
     if text.startswith(self.CHANGED_PREFIX):
         self.__set_selected_tab_text(text[1:])
         save_file(self.__file_path, self.txt_content.GetValue())
         formatted_exc = check_file_for_errors(self.__file_path,
                                               root_folder)
         if formatted_exc:
             show_error_dialog(self, formatted_exc, u'File contains errors')
Ejemplo n.º 2
0
    def prepare_folder(cls, path):
        if os.path.isdir(path):
            files_and_folders = os.listdir(path)

            for folder in [cls.PO_FOLDER, cls.TESTS_FOLDER, cls.REPORTS]:
                if folder not in files_and_folders:
                    os.mkdir(os.path.join(path, folder))

            save_file(os.path.join(path, cls.PO_FOLDER, cls.INIT_PY), u"")
        else:
            raise Exception(u"'%s' is not a folder." % path)