diff options
-rw-r--r-- | src/ventoo/main.py | 10 | ||||
-rwxr-xr-x | ventoo | 7 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/ventoo/main.py b/src/ventoo/main.py index 0706636..0f662a9 100644 --- a/src/ventoo/main.py +++ b/src/ventoo/main.py @@ -182,8 +182,14 @@ class MainWindow(gtk.Window): valScript = self.currentModule.getValidationScript(xmlPath) if valScript != None: #There is a script that can validate this input. import and run it. - os.remove("/tmp/thisCheck.py") - os.remove("/tmp/thisCheck.pyc") + try: + os.remove("/tmp/thisCheck.py") + except OSError: + pass + try: + os.remove("/tmp/thisCheck.pyc") + except OSError: + pass shutil.copyfile(valScript, '/tmp/thisCheck.py') import thisCheck as validate reload(validate) @@ -15,15 +15,16 @@ sandboxDir = '/' if len(sys.argv) > 1: sandboxDir = sys.argv[1] if not osp.isdir(sandboxDir): - print sandboxDir + " is not a directory." + print(sandboxDir + " is not a directory.") sys.exit(0) -print 'Starting augeas...' +print('Starting augeas...') #None could be a 'loadpath' a = augeas.Augeas(sandboxDir, None, augeas.Augeas.SAVE_NEWFILE) -print 'Creating window...' +print('Creating window...') ventoo.main.sandboxDir = sandboxDir +sys.path.append("/tmp") #Note, it IS possible to create mutiple windows and augeas #instances to edit multiple "roots" at the same time. |