]> xmof Git - DeDRM.git/commitdiff
_winreg in python3 has been changed to winreg. Update imports.
authorJeremy Whiting <jpwhiting@kde.org>
Wed, 21 Oct 2020 16:43:54 +0000 (10:43 -0600)
committerJeremy Whiting <jpwhiting@kde.org>
Wed, 21 Oct 2020 16:56:50 +0000 (10:56 -0600)
DeDRM_plugin/ignoblekey.py
DeDRM_plugin/kindlekey.py
DeDRM_plugin/simpleprefs.py
Obok_plugin/obok/legacy_obok.py
Other_Tools/DRM_Key_Scripts/Adobe_Digital_Editions/adobekey.pyw
Other_Tools/DRM_Key_Scripts/Barnes_and_Noble_ePubs/ignoblekey.pyw
Other_Tools/DRM_Key_Scripts/Kindle_for_Mac_and_PC/kindlekey.pyw
Other_Tools/Kobo/obok.py
Other_Tools/Tetrachroma_FileOpen_ineptpdf/ineptpdf_8.4.51.pyw

index 646a64e8e0b475594907a71bd45a0b68847657b5..5e33e3359a32b82d9e78b87edf44de27301a68aa 100644 (file)
@@ -95,7 +95,7 @@ def getNookLogFiles():
     logFiles = []
     found = False
     if iswindows:
-        import _winreg as winreg
+        import winreg
 
         # some 64 bit machines do not have the proper registry key for some reason
         # or the python interface to the 32 vs 64 bit registry is broken
index 4b880fc599e2698fcf6fb157236b09fcd6920af8..808b1b70ff2bc1680f65a70b7cb22928bba8c704 100644 (file)
@@ -190,7 +190,6 @@ if iswindows:
         create_unicode_buffer, create_string_buffer, CFUNCTYPE, addressof, \
         string_at, Structure, c_void_p, cast
 
-    # import _winreg as winreg
     import winreg
     MAX_PATH = 255
     kernel32 = windll.kernel32
index 34aa6dcfba0cf747dcbb0ccd8eaed8fad54b9f46..65f2b59e2f774ecf07c2f96e8a9c395c09923790 100644 (file)
@@ -20,7 +20,7 @@ class SimplePrefs(object):
             self.file2key[filename] = key
         self.target = target + 'Prefs'
         if sys.platform.startswith('win'):
-            import _winreg as winreg
+            import winreg
             regkey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\")
             path = winreg.QueryValueEx(regkey, 'Local AppData')[0]
             prefdir = path + os.sep + self.target
index f105688211aef8b9b79c4a12b44bf39509b93081..caf24f2afacd298ec52bd9be0724d557dd263a02 100644 (file)
@@ -37,14 +37,14 @@ class legacy_obok(object):
     
     def __oldcookiedeviceid(self):
         '''Optionally attempt to get a device id using the old cookie method.
-        Must have _winreg installed on Windows machines for successful key retrieval.'''
+        Must have winreg installed on Windows machines for successful key retrieval.'''
         wsuid = ''
         pwsdid = ''
         try:
             if sys.platform.startswith('win'):
-                import _winreg
-                regkey_browser = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, 'Software\\Kobo\\Kobo Desktop Edition\\Browser')
-                cookies = _winreg.QueryValueEx(regkey_browser, 'cookies')
+                import winreg
+                regkey_browser = winreg.OpenKey(winreg.HKEY_CURRENT_USER, 'Software\\Kobo\\Kobo Desktop Edition\\Browser')
+                cookies = winreg.QueryValueEx(regkey_browser, 'cookies')
                 bytearrays = cookies[0]
             elif sys.platform.startswith('darwin'):
                 prefs = os.path.join(os.environ['HOME'], 'Library/Preferences/com.kobo.Kobo Desktop Edition.plist')
index 7fbd51685d5438775424a6af4cdc21246860b919..bc33567548dbcdbc69b8a12c643feaf373429107 100644 (file)
@@ -129,7 +129,7 @@ if iswindows:
         c_long, c_ulong
 
     from ctypes.wintypes import LPVOID, DWORD, BOOL
-    import _winreg as winreg
+    import winreg
 
     def _load_crypto_libcrypto():
         from ctypes.util import find_library
index 98ae209eef38619f3f97c43f9e7c5ed14abe12be..7365c94c44d42c6c17fad7961c9c4ef03661b0c7 100644 (file)
@@ -98,7 +98,7 @@ def getNookLogFiles():
     logFiles = []
     found = False
     if iswindows:
-        import _winreg as winreg
+        import winreg
 
         # some 64 bit machines do not have the proper registry key for some reason
         # or the python interface to the 32 vs 64 bit registry is broken
index e20b7c95b0825fdb3809d53295d20fa914c9a794..4837627a9a830ad10a9f3bf3e8a023537aa14c8f 100644 (file)
@@ -177,7 +177,7 @@ if iswindows:
         create_unicode_buffer, create_string_buffer, CFUNCTYPE, addressof, \
         string_at, Structure, c_void_p, cast
 
-    import _winreg as winreg
+    import winreg
     MAX_PATH = 255
     kernel32 = windll.kernel32
     advapi32 = windll.advapi32
index fc0cabf4297c134fee41534a8ef5c7459699c841..98608c5cb978dfce3c178ce9097cf2f2b8c8f64d 100644 (file)
@@ -346,7 +346,7 @@ class KoboLibrary(object):
         if (self.kobodir == u""):
             # step 4. we haven't found a device with serials, so try desktop apps
             if sys.platform.startswith('win'):
-                import _winreg as winreg
+                import winreg
                 if sys.getwindowsversion().major > 5:
                     if 'LOCALAPPDATA' in os.environ.keys():
                         # Python 2.x does not return unicode env. Use Python 3.x
index 6277c5024a07658cbf2a82fe16c524e92b5bc8a6..7a0dcd879b170f20bd9610c1eaef8a0a892b09ea 100644 (file)
@@ -2290,7 +2290,7 @@ class PDFDocument(object):
             import win32api
             import win32security
             import win32file
-            import _winreg as winreg
+            import winreg
         except:
             raise ADEPTError('PyWin Extension (Win32API module) needed.\n'+\
                              'Download from http://sourceforge.net/projects/pywin32/files/ ')