aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2015-12-07 21:40:58 +0100
committerPapoteur <papoteur@mageialinux-online.org>2015-12-07 21:40:58 +0100
commit3fa08df83410bbe1907e57f9c9090e7124b30077 (patch)
treed04b52595fc050bee0a7fc580b9d11fced044c3f /lib
parent77c784aa8e82dbc842bf3032b607f2085c08af41 (diff)
downloadisodumper-3fa08df83410bbe1907e57f9c9090e7124b30077.tar
isodumper-3fa08df83410bbe1907e57f9c9090e7124b30077.tar.gz
isodumper-3fa08df83410bbe1907e57f9c9090e7124b30077.tar.bz2
isodumper-3fa08df83410bbe1907e57f9c9090e7124b30077.tar.xz
isodumper-3fa08df83410bbe1907e57f9c9090e7124b30077.zip
Second round of manual adaptation to Python3
Diffstat (limited to 'lib')
-rw-r--r--lib/isodumper.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py
index e316031..679eab5 100644
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -130,10 +130,10 @@ class UDisks2(object):
re_drive = re.compile('(?P<path>.*?/drives/(?P<id>.*))')
re_block = re.compile('(?P<path>.*?/block_devices/(?P<id>.*))')
devs= [m.groupdict() for m in
- [re_drive.match(path) for path in list(objects.keys())]
+ [re_drive.match(path) for path in (objects.keys())]
if m]
blocks = [m.groupdict() for m in
- [re_block.match(path) for path in list(objects.keys())]
+ [re_block.match(path) for path in (objects.keys())]
if m]
list=[]
@@ -261,9 +261,9 @@ class IsoDumper(object):
self.operation=True
if os.geteuid() > 0:
launcher='pkexec'
- self.process = Popen([launcher,'/usr/bin/python', '-u', '/usr/lib/isodumper/raw_format.py','-d',usb_path,'-f',fstype, '-l', label, '-u', str(os.geteuid()), '-g', str(os.getgid())], shell=False, stdout=PIPE, preexec_fn=os.setsid)
+ self.process = Popen([launcher,'/usr/bin/python3', '-u', '/usr/lib/isodumper/raw_format.py','-d',usb_path,'-f',fstype, '-l', label, '-u', str(os.geteuid()), '-g', str(os.getgid())], shell=False, stdout=PIPE, preexec_fn=os.setsid)
else:
- self.process = Popen(['/usr/bin/python', '-u', '/usr/lib/isodumper/raw_format.py','-d',usb_path,'-f',fstype, '-l', label, '-u', str(os.geteuid()), '-g', str(os.getgid())], shell=False, stdout=PIPE, preexec_fn=os.setsid)
+ self.process = Popen(['/usr/bin/python3', '-u', '/usr/lib/isodumper/raw_format.py','-d',usb_path,'-f',fstype, '-l', label, '-u', str(os.geteuid()), '-g', str(os.getgid())], shell=False, stdout=PIPE, preexec_fn=os.setsid)
working=True
while working:
time.sleep(0.5)
@@ -402,14 +402,14 @@ class IsoDumper(object):
self.progress.setEnabled()
self.progress.setLabel(_('Writing ')+source.split('/')[-1]+_(' to ')+target.split('/')[-1])
self.logger(_('Executing copy from ')+source+_(' to ')+target)
- steps=list(range(0, b+1, b/100))
+ steps=list(range(0, b+1, int(b/100)))
steps.append(b)
indice=1
written=0
- ncuts=b/bs
+ ncuts=int(b/bs)
while ncuts <= 100:
- bs=bs/2
- ncuts=b/bs
+ bs=int(bs/2)
+ ncuts=int(b/bs)
for i in range(0,ncuts+1):
try:
buf=ifc.read(bs)
@@ -455,13 +455,13 @@ class IsoDumper(object):
self.progress.setEnabled()
self.progress.setLabel(_('Checking ')+target.split('/')[-1])
self.progress.setValue(0)
- steps=list(range(0, b+1, b/100))
+ steps=list(range(0, b+1, int(b/100)))
steps.append(b)
indice=0
checked=0
sha1func=hashlib.sha1()
md5func=hashlib.md5()
- ncuts=b/1024
+ ncuts=int(b/1024)
try:
with open(target, 'rb') as f:
for x in range(0,ncuts):
@@ -817,7 +817,6 @@ The fields of the main window are as follows:\n\
pass
try:
if event.widget() == self.helpbt:
- print("help")
self.help_dialog()
except:
pass