mirror of
https://github.com/apprenticeharper/DeDRM_tools
synced 2025-01-13 20:01:14 +01:00
Merge pull request #1265 from heindevries/master
Some changes in obok.py to make it work on windows
This commit is contained in:
commit
a3c7bad67e
1 changed files with 3 additions and 3 deletions
|
@ -353,7 +353,7 @@ class KoboLibrary(object):
|
||||||
|
|
||||||
if (self.kobodir == u""):
|
if (self.kobodir == u""):
|
||||||
if sys.platform.startswith('win'):
|
if sys.platform.startswith('win'):
|
||||||
import _winreg as winreg
|
import winreg
|
||||||
if sys.getwindowsversion().major > 5:
|
if sys.getwindowsversion().major > 5:
|
||||||
if 'LOCALAPPDATA' in os.environ.keys():
|
if 'LOCALAPPDATA' in os.environ.keys():
|
||||||
# Python 2.x does not return unicode env. Use Python 3.x
|
# Python 2.x does not return unicode env. Use Python 3.x
|
||||||
|
@ -444,8 +444,8 @@ class KoboLibrary(object):
|
||||||
macaddrs = []
|
macaddrs = []
|
||||||
if sys.platform.startswith('win'):
|
if sys.platform.startswith('win'):
|
||||||
c = re.compile('\s(' + '[0-9a-f]{2}-' * 5 + '[0-9a-f]{2})(\s|$)', re.IGNORECASE)
|
c = re.compile('\s(' + '[0-9a-f]{2}-' * 5 + '[0-9a-f]{2})(\s|$)', re.IGNORECASE)
|
||||||
(p_in, p_out, p_err) = os.popen3('ipconfig /all')
|
output = subprocess.Popen('ipconfig /all', shell=True, stdout=subprocess.PIPE, text=True).stdout
|
||||||
for line in p_out:
|
for line in output:
|
||||||
m = c.search(line)
|
m = c.search(line)
|
||||||
if m:
|
if m:
|
||||||
macaddrs.append(re.sub("-", ":", m.group(1)).upper())
|
macaddrs.append(re.sub("-", ":", m.group(1)).upper())
|
||||||
|
|
Loading…
Reference in a new issue