<commit_before>import os
import time

#TODO: implement argument parsing to select source and target folders

directory = {'source':'work','target':'backup'}

if not os.path.exists(directory['target']):
    os.mkdir(directory['target'])

today =  '{}{}{}'.format(directory['target'], os.sep, time.strftime('%Y%m%d'))
now = time.strftime('%H%M%S')
comment = input('Enter a comment: ')
if len(comment) == 0:
    directory['target'] = '{}{}{}.zip'.format(today, os.sep, now)
else:
    directory['target'] = \
        '{}{}{}_{}.zip'.format(today, os.sep, now, comment.replace(' ','_'))
if not os.path.exists(today):
    os.mkdir(today)
    print('Created directory {}'.format(today))
zip_cmd = 'tar -cvjf {0} {1}'.format(directory['target'], directory['source'])

if os.system(zip_cmd) == 0:
    print('OK')
else:
    print('NOT OK')
    os.rmdir(today)
<commit_msg>nuovo TODO fix<commit_after>import os
import time

#TODO: implement argument parsing to select source and target folders
#      https://docs.python.org/3.4/library/optparse.html

directory = {'source':'work','target':'backup'}

if not os.path.exists(directory['target']):
    os.mkdir(directory['target'])

today =  '{}{}{}'.format(directory['target'], os.sep, time.strftime('%Y%m%d'))
now = time.strftime('%H%M%S')
comment = input('Enter a comment: ')
if len(comment) == 0:
    directory['target'] = '{}{}{}.zip'.format(today, os.sep, now)
else:
    directory['target'] = \
        '{}{}{}_{}.zip'.format(today, os.sep, now, comment.replace(' ','_'))
if not os.path.exists(today):
    os.mkdir(today)
    print('Created directory {}'.format(today))
zip_cmd = 'tar -cvjf {0} {1}'.format(directory['target'], directory['source'])

if os.system(zip_cmd) == 0:
    print('OK')
else:
    print('NOT OK')
    os.rmdir(today)

{'fraction_non_alphanumeric': 0.21941638608305275, 'fraction_numerical': 0.005611672278338945, 'mean_word_length': 4.770226537216828, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4751930', 'n_tokens_mistral': 643, 'n_tokens_neox': 608, 'n_words': 131}