s/dev\/null/os.devnull + add binary flag
For windows compatibility
This commit is contained in:
parent
2e8f5023eb
commit
3914d76287
5 changed files with 5 additions and 5 deletions
|
|
@ -192,7 +192,7 @@ class Downloadboob(object):
|
||||||
return 4
|
return 4
|
||||||
|
|
||||||
def check_exec(executable):
|
def check_exec(executable):
|
||||||
with open('/dev/null', 'w') as devnull:
|
with open(os.devnull, 'w') as devnull:
|
||||||
process = subprocess.Popen(['which', executable], stdout=devnull)
|
process = subprocess.Popen(['which', executable], stdout=devnull)
|
||||||
if process.wait() != 0:
|
if process.wait() != 0:
|
||||||
print('Please install "%s"' % executable, file=sys.stderr)
|
print('Please install "%s"' % executable, file=sys.stderr)
|
||||||
|
|
|
||||||
|
|
@ -503,7 +503,7 @@ class Cineoob(ReplApplication):
|
||||||
print(buf)
|
print(buf)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
with open(dest, 'w') as f:
|
with open(dest, 'wb') as f:
|
||||||
f.write(buf)
|
f.write(buf)
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
print('Unable to write .torrent in "%s": %s' % (dest, e), file=self.stderr)
|
print('Unable to write .torrent in "%s": %s' % (dest, e), file=self.stderr)
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ class Galleroob(ReplApplication):
|
||||||
name = '%03d.%s' % (i, ext)
|
name = '%03d.%s' % (i, ext)
|
||||||
print('Writing file %s' % name)
|
print('Writing file %s' % name)
|
||||||
|
|
||||||
with open(name, 'w') as f:
|
with open(name, 'wb') as f:
|
||||||
f.write(img.data)
|
f.write(img.data)
|
||||||
|
|
||||||
os.chdir(os.path.pardir)
|
os.chdir(os.path.pardir)
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ class Radioob(ReplApplication):
|
||||||
audio.url = _obj.url
|
audio.url = _obj.url
|
||||||
|
|
||||||
def check_exec(executable):
|
def check_exec(executable):
|
||||||
with open('/dev/null', 'w') as devnull:
|
with open(os.devnull, 'w') as devnull:
|
||||||
process = subprocess.Popen(['which', executable], stdout=devnull)
|
process = subprocess.Popen(['which', executable], stdout=devnull)
|
||||||
if process.wait() != 0:
|
if process.wait() != 0:
|
||||||
print('Please install "%s"' % executable, file=self.stderr)
|
print('Please install "%s"' % executable, file=self.stderr)
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ class Videoob(ReplApplication):
|
||||||
return 4
|
return 4
|
||||||
|
|
||||||
def check_exec(executable):
|
def check_exec(executable):
|
||||||
with open('/dev/null', 'w') as devnull:
|
with open(os.devnull, 'w') as devnull:
|
||||||
process = subprocess.Popen(['which', executable], stdout=devnull)
|
process = subprocess.Popen(['which', executable], stdout=devnull)
|
||||||
if process.wait() != 0:
|
if process.wait() != 0:
|
||||||
print('Please install "%s"' % executable, file=self.stderr)
|
print('Please install "%s"' % executable, file=self.stderr)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue