Changeset 5762
- Timestamp:
- 08/04/10 21:03:17 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
network-scanner/branches/GSoC2010/umit/nsefacilitator/ScriptEditor.py
r5751 r5762 36 36 from umit.core.Paths import Path, check_access 37 37 from umit.gui.BugReport import BugReport 38 from umit.core.Paths import Path 38 39 from luaParser import LuaParser 39 40 … … 78 79 DEFAULT_SELECTED_TEXT_COLOR = gtk.gdk.color_parse("#ffffffffffff") 79 80 DEFAULT_SELECTION_COLOR = gtk.gdk.color_parse("#000000009c9c") 80 DEFAULT_TEMPLATE_PATH = os.path. expanduser("~/.umit/nsetemplates")81 DEFAULT_TEMPLATE_PATH = os.path.join(Path.config_dir, 'nsetemplates') 81 82 82 83 def get_templates(): … … 477 478 self.save_as() 478 479 return 479 self.readonly = not check_access(self.scriptname, os.W_OK) 480 print '>>>>>>>>>>>>>> %s' % self.scriptname 481 if os.path.exists(self.scriptname): 482 self.readonly = not check_access(self.scriptname, os.W_OK) 483 else: 484 path = os.path.dirname(self.scriptname) 485 self.readonly = not check_access(path, os.W_OK) 480 486 self.update_title() 481 487 if self.readonly: … … 504 510 file_chooser.set_current_folder(DEFAULT_TEMPLATE_PATH) 505 511 if not self.is_untitled(): 506 file_chooser.set_filename(self.scriptname) 512 name = os.path.basename(self.scriptname) 513 file_chooser.set_current_name(name) 507 514 else: 508 515 file_chooser.set_current_name(self.untitled_name) … … 584 591 585 592 ('Save As Template', gtk.STOCK_SAVE_AS, 586 _('Save As Template '), None,593 _('Save As Template...'), None, 587 594 _('Save the current script file as template'), self._save_as_template_cb), 588 595 … … 1196 1203 id = d.get('id', '') 1197 1204 author = d.get('author', '') 1198 version = d.get('version ', '')1205 version = d.get('version_', '') 1199 1206 license = d.get('license', '') 1200 1207 description = d.get('description', '')
