Changeset 41:9753fcb9f750 in misc for filearchive


Ignore:
Timestamp:
02/13/08 07:53:15 (4 years ago)
Author:
Eriol
Branch:
misc
Convert:
svn:e60e002c-0983-44b9-b2ae-8842d539f768/misc@44
Message:

Removed support for Windows: mcrypt don't work
on windows! It can't decrypt files! :(

File:
1 edited

Legend:

Unmodified
Added
Removed
  • filearchive/filearchive

    r40 r41  
    2626import optparse 
    2727import os 
    28 import platform 
    2928import subprocess 
    3029import sys 
     
    3231 
    3332SETTINGS = {} 
    34  
    35 if platform.system() == 'Linux': 
    36     crypt_program = 'mcrypt' 
    37 elif platform.system() == 'Windows': 
    38     crypt_program = 'mcrypt.exe' # TODO: check it! 
    3933 
    4034def md5sum(f): 
     
    139133 
    140134    if SETTINGS['encrypt']: 
     135        archive_ext = '.nc' 
     136 
    141137        password = getpass.getpass() 
    142138        path = os.path.join(output_directory, '*.zip') 
    143         command = '%s -F %s -k %s -u' % (crypt_program, path, password) 
     139        command = 'mcrypt %s -k %s -u' % (path, password) 
    144140 
    145141        subprocess.call(command, shell=True) 
     142    else: 
     143        archive_ext = '.zip' 
    146144 
    147145    print 'Generating md5sum...' 
     
    154152            name, ext = os.path.splitext(f) 
    155153            name = name[:len(archive_name)] 
    156             if name == archive_name and (ext == '.zip' or ext == '.nc'): 
     154            if name == archive_name and ext == archive_ext: 
    157155                file_path = os.path.join(output_directory, f) 
    158156                fi = open(file_path) 
Note: See TracChangeset for help on using the changeset viewer.