src/eric7/EricXML/ShortcutsReader.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9653
e67609152c5e
--- a/src/eric7/EricXML/ShortcutsReader.py	Wed Jul 13 11:16:20 2022 +0200
+++ b/src/eric7/EricXML/ShortcutsReader.py	Wed Jul 13 14:55:47 2022 +0200
@@ -15,19 +15,20 @@
     """
     Class for reading an XML shortcuts file.
     """
+
     supportedVersions = ["3.6"]
-    
+
     def __init__(self, device):
         """
         Constructor
-        
+
         @param device reference to the I/O device to read from (QIODevice)
         """
         XMLStreamReaderBase.__init__(self, device)
-        
+
         self.version = ""
         self.shortcuts = {}
-    
+
     def readXML(self):
         """
         Public method to read and parse the XML document.
@@ -36,17 +37,16 @@
             self.readNext()
             if self.isStartElement():
                 if self.name() == "Shortcuts":
-                    self.version = self.attribute(
-                        "version", shortcutsFileFormatVersion)
+                    self.version = self.attribute("version", shortcutsFileFormatVersion)
                     if self.version not in self.supportedVersions:
                         self.raiseUnsupportedFormatVersion(self.version)
                 elif self.name() == "Shortcut":
                     self.__readShortCut()
                 else:
                     self.raiseUnexpectedStartTag(self.name())
-        
+
         self.showErrorMessage()
-    
+
     def __readShortCut(self):
         """
         Private method to read the shortcut data.
@@ -55,7 +55,7 @@
         name = ""
         accel = ""
         altAccel = ""
-        
+
         while not self.atEnd():
             self.readNext()
             if self.isEndElement() and self.name() == "Shortcut":
@@ -64,7 +64,7 @@
                         self.shortcuts[category] = {}
                     self.shortcuts[category][name] = (accel, altAccel)
                 break
-            
+
             if self.isStartElement():
                 if self.name() == "Name":
                     name = self.readElementText()
@@ -74,11 +74,11 @@
                     altAccel = self.readElementText()
                 else:
                     self.raiseUnexpectedStartTag(self.name())
-    
+
     def getShortcuts(self):
         """
         Public method to retrieve the shortcuts.
-        
+
         @return Dictionary of dictionaries of shortcuts. The keys of the
             dictionary are the categories, the values are dictionaries.
             These dictionaries have the shortcut name as their key and

eric ide

mercurial