Project/ProjectInterfacesBrowser.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2791
a9577f248f04
parent 2995
63d874899b8b
child 3058
0a02c433f52d
diff -r 9986ec0e559a -r 10516539f238 Project/ProjectInterfacesBrowser.py
--- a/Project/ProjectInterfacesBrowser.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/Project/ProjectInterfacesBrowser.py	Fri Oct 18 23:00:41 2013 +0200
@@ -4,7 +4,8 @@
 #
 
 """
-Module implementing the a class used to display the interfaces (IDL) part of the project.
+Module implementing the a class used to display the interfaces (IDL) part
+of the project.
 """
 
 from __future__ import unicode_literals    # __IGNORE_WARNING__
@@ -27,8 +28,8 @@
     ProjectBrowserInterfaceType
 from .ProjectBaseBrowser import ProjectBaseBrowser
 
-from UI.BrowserModel import BrowserFileItem, BrowserClassItem, BrowserMethodItem, \
-    BrowserClassAttributeItem
+from UI.BrowserModel import BrowserFileItem, BrowserClassItem, \
+    BrowserMethodItem, BrowserClassAttributeItem
 import UI.PixmapCache
 
 import Preferences
@@ -40,14 +41,14 @@
     A class used to display the interfaces (IDL) part of the project.
     
     @signal sourceFile(str, int = 0) emitted to open a file
-    @signal closeSourceWindow(str) emitted after a file has been removed/deleted
-            from the project
+    @signal closeSourceWindow(str) emitted after a file has been
+        removed/deleted from the project
     @signal appendStdout(str) emitted after something was received from
-            a QProcess on stdout
+        a QProcess on stdout
     @signal appendStderr(str) emitted after something was received from
-            a QProcess on stderr
-    @signal showMenu(str, QMenu) emitted when a menu is about to be shown. The name
-            of the menu and a reference to the menu are given.
+        a QProcess on stderr
+    @signal showMenu(str, QMenu) emitted when a menu is about to be shown.
+        The name of the menu and a reference to the menu are given.
     """
     appendStdout = pyqtSignal(str)
     appendStderr = pyqtSignal(str)
@@ -62,11 +63,13 @@
         """
         self.omniidl = Preferences.getCorba("omniidl")
         if self.omniidl == "":
-            self.omniidl = Utilities.isWindowsPlatform() and "omniidl.exe" or "omniidl"
+            self.omniidl = Utilities.isWindowsPlatform() and \
+                "omniidl.exe" or "omniidl"
         if not Utilities.isinpath(self.omniidl):
             self.omniidl = None
         
-        ProjectBaseBrowser.__init__(self, project, ProjectBrowserInterfaceType, parent)
+        ProjectBaseBrowser.__init__(self, project,
+                                    ProjectBrowserInterfaceType, parent)
         
         self.selectedItemsFilter = \
             [ProjectBrowserFileItem, ProjectBrowserSimpleDirectoryItem]
@@ -76,8 +79,8 @@
         self.setWhatsThis(self.trUtf8(
             """<b>Project Interfaces Browser</b>"""
             """<p>This allows to easily see all interfaces (CORBA IDL files)"""
-            """ contained in the current project. Several actions can be executed"""
-            """ via the context menu.</p>"""
+            """ contained in the current project. Several actions can be"""
+            """ executed via the context menu.</p>"""
         ))
         
         project.prepareRepopulateItem.connect(self._prepareRepopulateItem)
@@ -100,12 +103,14 @@
                 self.__compileAllInterfaces)
         self.sourceMenu.addAction(self.trUtf8('Open'), self._openItem)
         self.sourceMenu.addSeparator()
-        act = self.sourceMenu.addAction(self.trUtf8('Rename file'), self._renameFile)
+        act = self.sourceMenu.addAction(
+            self.trUtf8('Rename file'), self._renameFile)
         self.menuActions.append(act)
         act = self.sourceMenu.addAction(self.trUtf8('Remove from project'),
             self._removeFile)
         self.menuActions.append(act)
-        act = self.sourceMenu.addAction(self.trUtf8('Delete'), self.__deleteFile)
+        act = self.sourceMenu.addAction(
+            self.trUtf8('Delete'), self.__deleteFile)
         self.menuActions.append(act)
         self.sourceMenu.addSeparator()
         self.sourceMenu.addAction(self.trUtf8('Add interfaces...'),
@@ -122,16 +127,19 @@
             self._collapseAllDirs)
         self.sourceMenu.addSeparator()
         self.sourceMenu.addAction(self.trUtf8('Configure...'), self._configure)
-        self.sourceMenu.addAction(self.trUtf8('Configure CORBA...'), self.__configureCorba)
+        self.sourceMenu.addAction(
+            self.trUtf8('Configure CORBA...'), self.__configureCorba)
 
         self.menu = QMenu(self)
         if self.omniidl is not None:
-            self.menu.addAction(self.trUtf8('Compile interface'), self.__compileInterface)
+            self.menu.addAction(
+                self.trUtf8('Compile interface'), self.__compileInterface)
             self.menu.addAction(self.trUtf8('Compile all interfaces'),
                 self.__compileAllInterfaces)
         self.menu.addAction(self.trUtf8('Open'), self._openItem)
         self.menu.addSeparator()
-        self.menu.addAction(self.trUtf8('Add interfaces...'), self.__addInterfaceFiles)
+        self.menu.addAction(
+            self.trUtf8('Add interfaces...'), self.__addInterfaceFiles)
         self.menu.addAction(self.trUtf8('Add interfaces directory...'),
             self.__addInterfacesDirectory)
         self.menu.addSeparator()
@@ -141,7 +149,8 @@
             self._collapseAllDirs)
         self.menu.addSeparator()
         self.menu.addAction(self.trUtf8('Configure...'), self._configure)
-        self.menu.addAction(self.trUtf8('Configure CORBA...'), self.__configureCorba)
+        self.menu.addAction(
+            self.trUtf8('Configure CORBA...'), self.__configureCorba)
 
         self.backMenu = QMenu(self)
         if self.omniidl is not None:
@@ -159,7 +168,8 @@
             self._collapseAllDirs)
         self.backMenu.addSeparator()
         self.backMenu.addAction(self.trUtf8('Configure...'), self._configure)
-        self.backMenu.addAction(self.trUtf8('Configure CORBA...'), self.__configureCorba)
+        self.backMenu.addAction(
+            self.trUtf8('Configure CORBA...'), self.__configureCorba)
         self.backMenu.setEnabled(False)
 
         # create the menu for multiple selected files
@@ -172,7 +182,8 @@
         act = self.multiMenu.addAction(self.trUtf8('Remove from project'),
             self._removeFile)
         self.multiMenuActions.append(act)
-        act = self.multiMenu.addAction(self.trUtf8('Delete'), self.__deleteFile)
+        act = self.multiMenu.addAction(
+            self.trUtf8('Delete'), self.__deleteFile)
         self.multiMenuActions.append(act)
         self.multiMenu.addSeparator()
         self.multiMenu.addAction(self.trUtf8('Expand all directories'),
@@ -181,19 +192,23 @@
             self._collapseAllDirs)
         self.multiMenu.addSeparator()
         self.multiMenu.addAction(self.trUtf8('Configure...'), self._configure)
-        self.multiMenu.addAction(self.trUtf8('Configure CORBA...'), self.__configureCorba)
+        self.multiMenu.addAction(
+            self.trUtf8('Configure CORBA...'), self.__configureCorba)
 
         self.dirMenu = QMenu(self)
         if self.omniidl is not None:
             self.dirMenu.addAction(self.trUtf8('Compile all interfaces'),
                 self.__compileAllInterfaces)
             self.dirMenu.addSeparator()
-        act = self.dirMenu.addAction(self.trUtf8('Remove from project'), self._removeFile)
+        act = self.dirMenu.addAction(
+            self.trUtf8('Remove from project'), self._removeFile)
         self.dirMenuActions.append(act)
-        act = self.dirMenu.addAction(self.trUtf8('Delete'), self._deleteDirectory)
+        act = self.dirMenu.addAction(
+            self.trUtf8('Delete'), self._deleteDirectory)
         self.dirMenuActions.append(act)
         self.dirMenu.addSeparator()
-        self.dirMenu.addAction(self.trUtf8('Add interfaces...'), self.__addInterfaceFiles)
+        self.dirMenu.addAction(
+            self.trUtf8('Add interfaces...'), self.__addInterfaceFiles)
         self.dirMenu.addAction(self.trUtf8('Add interfaces directory...'),
             self.__addInterfacesDirectory)
         self.dirMenu.addSeparator()
@@ -206,7 +221,8 @@
             self._collapseAllDirs)
         self.dirMenu.addSeparator()
         self.dirMenu.addAction(self.trUtf8('Configure...'), self._configure)
-        self.dirMenu.addAction(self.trUtf8('Configure CORBA...'), self.__configureCorba)
+        self.dirMenu.addAction(
+            self.trUtf8('Configure CORBA...'), self.__configureCorba)
         
         self.dirMultiMenu = QMenu(self)
         if self.omniidl is not None:
@@ -223,7 +239,8 @@
         self.dirMultiMenu.addAction(self.trUtf8('Collapse all directories'),
             self._collapseAllDirs)
         self.dirMultiMenu.addSeparator()
-        self.dirMultiMenu.addAction(self.trUtf8('Configure...'), self._configure)
+        self.dirMultiMenu.addAction(
+            self.trUtf8('Configure...'), self._configure)
         self.dirMultiMenu.addAction(self.trUtf8('Configure CORBA...'),
                                     self.__configureCorba)
         
@@ -393,7 +410,8 @@
             fn = self.project.getRelativePath(fn2)
             files.append(fn)
         
-        from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog
+        from UI.DeleteFilesConfirmationDialog import \
+            DeleteFilesConfirmationDialog
         dlg = DeleteFilesConfirmationDialog(self.parent(),
             self.trUtf8("Delete interfaces"),
             self.trUtf8("Do you really want to delete these interfaces from"
@@ -405,13 +423,14 @@
                 self.closeSourceWindow.emit(fn2)
                 self.project.deleteFile(fn)
     
-    ############################################################################
+    ###########################################################################
     ##  Methods to handle the various compile commands
-    ############################################################################
+    ###########################################################################
     
     def __readStdout(self):
         """
-        Private slot to handle the readyReadStandardOutput signal of the omniidl process.
+        Private slot to handle the readyReadStandardOutput signal of the
+        omniidl process.
         """
         if self.compileProc is None:
             return
@@ -427,7 +446,8 @@
         
     def __readStderr(self):
         """
-        Private slot to handle the readyReadStandardError signal of the omniidl process.
+        Private slot to handle the readyReadStandardError signal of the
+        omniidl process.
         """
         if self.compileProc is None:
             return
@@ -462,20 +482,26 @@
             if not self.noDialog and not ui.notificationsEnabled():
                 E5MessageBox.information(self,
                     self.trUtf8("Interface Compilation"),
-                    self.trUtf8("The compilation of the interface file was successful."))
+                    self.trUtf8(
+                        "The compilation of the interface file was"
+                        " successful."))
             else:
                 ui.showNotification(UI.PixmapCache.getPixmap("corba48.png"),
                     self.trUtf8("Interface Compilation"),
-                    self.trUtf8("The compilation of the interface file was successful."))
+                    self.trUtf8(
+                        "The compilation of the interface file was"
+                        " successful."))
         else:
             if not self.noDialog:
                 E5MessageBox.information(self,
                     self.trUtf8("Interface Compilation"),
-                    self.trUtf8("The compilation of the interface file failed."))
+                    self.trUtf8(
+                        "The compilation of the interface file failed."))
             else:
                 ui.showNotification(UI.PixmapCache.getPixmap("corba48.png"),
                     self.trUtf8("Interface Compilation"),
-                    self.trUtf8("The compilation of the interface file failed."))
+                    self.trUtf8(
+                        "The compilation of the interface file failed."))
         self.compileProc = None
         
     def __compileIDL(self, fn, noDialog=False, progress=None):

eric ide

mercurial