Raise custom NotEnoughSpace exception instead of IOError.
This commit is contained in:
parent
581893fa7c
commit
19ce9fea03
1 changed files with 7 additions and 1 deletions
|
@ -12,6 +12,12 @@ from voussoirkit import winglob
|
||||||
|
|
||||||
RESERVE_SPACE_ON_DRIVE = 30 * bytestring.GIBIBYTE
|
RESERVE_SPACE_ON_DRIVE = 30 * bytestring.GIBIBYTE
|
||||||
|
|
||||||
|
class RarParException(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class NotEnoughSpace(RarParException):
|
||||||
|
pass
|
||||||
|
|
||||||
def RARCOMMAND(
|
def RARCOMMAND(
|
||||||
basename,
|
basename,
|
||||||
input_pattern,
|
input_pattern,
|
||||||
|
@ -105,7 +111,7 @@ def assert_enough_space(pathsize, workdir, moveto, rec, rev, par):
|
||||||
print(message)
|
print(message)
|
||||||
|
|
||||||
if reserve > free_space:
|
if reserve > free_space:
|
||||||
raise IOError('Please leave more space')
|
raise NotEnoughSpace('Please leave more space')
|
||||||
|
|
||||||
def move(pattern, directory):
|
def move(pattern, directory):
|
||||||
files = winglob.glob(pattern)
|
files = winglob.glob(pattern)
|
||||||
|
|
Loading…
Reference in a new issue