907 |
907 |
908 # change environment |
908 # change environment |
909 sys.path.insert(0, self.project.getProjectPath()) |
909 sys.path.insert(0, self.project.getProjectPath()) |
910 cwd = os.getcwd() |
910 cwd = os.getcwd() |
911 os.chdir(os.path.dirname(os.path.abspath(fn))) |
911 os.chdir(os.path.dirname(os.path.abspath(fn))) |
912 |
912 try: |
913 dlg = CreateDialogCodeDialog(fn, self.project, self) |
913 dlg = CreateDialogCodeDialog(fn, self.project, self) |
914 if not dlg.initError(): |
914 if not dlg.initError(): |
915 dlg.exec() |
915 dlg.exec() |
916 |
916 finally: |
917 # reset the environment |
917 # reset the environment |
918 os.chdir(cwd) |
918 os.chdir(cwd) |
919 del sys.path[0] |
919 del sys.path[0] |
920 |
920 |
921 def __compileForm(self): |
921 def __compileForm(self): |
922 """ |
922 """ |
923 Private method to compile a form to a source file. |
923 Private method to compile a form to a source file. |
924 """ |
924 """ |