123456789101112131415161718192021222324252627282930313233343536373839404142 |
- # For accesing the module
- import sys, os
- sys.path.append(os.path.abspath('..'))
- from unar import Unar
- from unar import UnknownOption, ArchiveNotFound, StreamError, PasswordError
- """ Options
- test.output = ""
- test.forceOverwrite = False
- test.forceRename = False
- test.forceSkip = False
- test.forceDirectory = False
- test.noDirectory = False
- test.password = ""
- test.encoding = None # TODO
- test.passwordEncoding = None # TODO
- test.indexes = []
- test.noRecursion = False
- test.copyTime = False
- test.forks = False
- test.quiet = False
- """
- unar = Unar()
- unar.forceOverwrite = False
- unar.output = './extracted/'
- unar.file = 'example.zip'
- print(unar._compileCmd())
- try:
- unar.run()
- except UnknownOption as err:
- print("Version mismatch? Error: {0}".format(err))
- except ArchiveNotFound as err:
- print("ArchiveNotFound Error: {0}".format(err))
- except StreamError as err:
- print("StreamError Error: {0}".format(err))
- except PasswordError as err:
- print("PasswordError Error: {0}".format(err))
|