equal
deleted
inserted
replaced
1254 |
1254 |
1255 return self._ProjectFilesView |
1255 return self._ProjectFilesView |
1256 |
1256 |
1257 elif name is not None and name.find("::") != -1: |
1257 elif name is not None and name.find("::") != -1: |
1258 filepath, editor_name = name.split("::") |
1258 filepath, editor_name = name.split("::") |
1259 if not self._FileEditors.has_key(filepath): |
1259 if not filepath in self._FileEditors: |
1260 if os.path.isfile(filepath): |
1260 if os.path.isfile(filepath): |
1261 file_extension = os.path.splitext(filepath)[1] |
1261 file_extension = os.path.splitext(filepath)[1] |
1262 |
1262 |
1263 editors = dict([(edit_name, edit_class) |
1263 editors = dict([(edit_name, edit_class) |
1264 for extension, edit_name, edit_class in features.file_editors |
1264 for extension, edit_name, edit_class in features.file_editors |
1283 self._FileEditors[filepath] = editor(self.AppFrame.TabsOpened, self, name, self.AppFrame) |
1283 self._FileEditors[filepath] = editor(self.AppFrame.TabsOpened, self, name, self.AppFrame) |
1284 self._FileEditors[filepath].SetIcon(GetBitmap("FILE")) |
1284 self._FileEditors[filepath].SetIcon(GetBitmap("FILE")) |
1285 if isinstance(self._FileEditors[filepath], DebugViewer): |
1285 if isinstance(self._FileEditors[filepath], DebugViewer): |
1286 self._FileEditors[filepath].SetDataProducer(self) |
1286 self._FileEditors[filepath].SetDataProducer(self) |
1287 |
1287 |
1288 if self._FileEditors.has_key(filepath): |
1288 if filepath in self._FileEditors: |
1289 editor = self._FileEditors[filepath] |
1289 editor = self._FileEditors[filepath] |
1290 self.AppFrame.EditProjectElement(editor, editor.GetTagName()) |
1290 self.AppFrame.EditProjectElement(editor, editor.GetTagName()) |
1291 |
1291 |
1292 return self._FileEditors.get(filepath) |
1292 return self._FileEditors.get(filepath) |
1293 else: |
1293 else: |
1465 """ |
1465 """ |
1466 Dispatching use a dictionnary linking IEC variable paths |
1466 Dispatching use a dictionnary linking IEC variable paths |
1467 to a WeakKeyDictionary linking |
1467 to a WeakKeyDictionary linking |
1468 weakly referenced callables |
1468 weakly referenced callables |
1469 """ |
1469 """ |
1470 if IECPath != "__tick__" and not self._IECPathToIdx.has_key(IECPath): |
1470 if IECPath != "__tick__" and not IECPath in self._IECPathToIdx: |
1471 return None |
1471 return None |
1472 |
1472 |
1473 self.IECdebug_lock.acquire() |
1473 self.IECdebug_lock.acquire() |
1474 # If no entry exist, create a new one with a fresh WeakKeyDictionary |
1474 # If no entry exist, create a new one with a fresh WeakKeyDictionary |
1475 IECdebug_data = self.IECdebug_datas.get(IECPath, None) |
1475 IECdebug_data = self.IECdebug_datas.get(IECPath, None) |
1514 self.IECdebug_lock.release() |
1514 self.IECdebug_lock.release() |
1515 |
1515 |
1516 self.ReArmDebugRegisterTimer() |
1516 self.ReArmDebugRegisterTimer() |
1517 |
1517 |
1518 def ForceDebugIECVariable(self, IECPath, fvalue): |
1518 def ForceDebugIECVariable(self, IECPath, fvalue): |
1519 if not self.IECdebug_datas.has_key(IECPath): |
1519 if not IECPath in self.IECdebug_datas: |
1520 return |
1520 return |
1521 |
1521 |
1522 self.IECdebug_lock.acquire() |
1522 self.IECdebug_lock.acquire() |
1523 |
1523 |
1524 # If no entry exist, create a new one with a fresh WeakKeyDictionary |
1524 # If no entry exist, create a new one with a fresh WeakKeyDictionary |
1529 self.IECdebug_lock.release() |
1529 self.IECdebug_lock.release() |
1530 |
1530 |
1531 self.ReArmDebugRegisterTimer() |
1531 self.ReArmDebugRegisterTimer() |
1532 |
1532 |
1533 def ReleaseDebugIECVariable(self, IECPath): |
1533 def ReleaseDebugIECVariable(self, IECPath): |
1534 if not self.IECdebug_datas.has_key(IECPath): |
1534 if not IECPath in self.IECdebug_datas: |
1535 return |
1535 return |
1536 |
1536 |
1537 self.IECdebug_lock.acquire() |
1537 self.IECdebug_lock.acquire() |
1538 |
1538 |
1539 # If no entry exist, create a new one with a fresh WeakKeyDictionary |
1539 # If no entry exist, create a new one with a fresh WeakKeyDictionary |