Subversion Repositories pub

Compare Revisions

Ignore whitespace Rev 167 → Rev 168

/relevation/branches/1.1-PyCryptoPlus/relevation.py
48,10 → 48,20
import sys
import zlib
 
# Import PyCrypto if present, fall back to PyCryptoPlus otherwise
try:
from Crypto.Cipher import AES
except ImportError:
try:
from CryptoPlus.Cipher import AES
except ImportError:
sys.stderr.write('Error: Either PyCrypto or PyCryptoPlus must be installed\n')
raise
 
__author__ = 'Toni Corvera'
__date__ = '$Date$'
__revision__ = '$Rev$'
__version_info__ = ( 1, 0 ) #, 0 )
__version_info__ = ( 1, 1 ) #, 0 )
__version__ = '.'.join(map(str, __version_info__))
RELEASE=True
 
307,7 → 317,7
sys.stderr.write('Password is required\n')
sys.exit(os.EX_USAGE)
# ---------- PASSWORDS FILE DECRYPTION ---------- #
# ---------- PASSWORDS FILE DECRYPTION AND DECOMPRESSION ---------- #
f = None
try:
if not os.access(datafile, os.R_OK):
357,6 → 367,9
if __name__ == '__main__':
try:
main()
except zlib.error:
sys.stderr.write('Failed to decompress decrypted data. Wrong password?\n')
sys.exit(os.EX_DATAERR)
except libxml2.parserError as e:
sys.stderr.write('XML parsing error\n')
if not RELEASE: