<commit_before>import sys

from manager import Manager
import version_provider
import version_catalog

conn_str = 'sqlite:///dbtest.sqlite'

ver_from = sys.argv[1]
ver_to = sys.argv[2]

if ver_from.lower() == 'none':
    ver_from = None
if ver_to.lower() == 'none':
    ver_to = None

prov = version_provider.SqlVersionProvider(conn_str)
cur_ver = prov.get_current_version()
print "Currently installed version: %s" % cur_ver
if cur_ver != ver_from:
    print "Changing currently installed version to: %s" % ver_from
    prov.set_current_version(ver_from)
    print "Double-checking, currently installed version: %s" % prov.get_current_version()

cat = version_catalog.FileSystemVersionsCatalog('versions')
print "Available versions: %s" % cat.get_available_versions()

m = Manager(connection_string=conn_str, provider=prov, catalog=cat)

print "Going to change version from %s to %s" % (ver_from, ver_to)
m.change_version_to(ver_to)
print "Uninstalling:"
m.uninstall()<commit_msg>Added uninstallation option to test.py script<commit_after>import sys

from manager import Manager
import version_provider
import version_catalog

conn_str = 'sqlite:///dbtest.sqlite'

uninstall = False

if sys.argv[1] != 'uninstall':
    ver_from = sys.argv[1]
    ver_to = sys.argv[2]

    if ver_from.lower() == 'none':
        ver_from = None
    if ver_to.lower() == 'none':
        ver_to = None
else:
    uninstall = True


prov = version_provider.SqlVersionProvider(conn_str)
cat = version_catalog.FileSystemVersionsCatalog('versions')
if not uninstall:

    cur_ver = prov.get_current_version()
    print "Currently installed version: %s" % cur_ver
    if cur_ver != ver_from:
        print "Changing currently installed version to: %s" % ver_from
        prov.set_current_version(ver_from)
        print "Double-checking, currently installed version: %s" % prov.get_current_version()
    print "Available versions: %s" % cat.get_available_versions()
    m = Manager(connection_string=conn_str, provider=prov, catalog=cat)

    print "Going to change version from %s to %s" % (ver_from, ver_to)
    m.change_version_to(ver_to)

m = Manager(connection_string=conn_str, provider=prov, catalog=cat)
print "Uninstalling:"
m.uninstall()
{'fraction_non_alphanumeric': 0.10855855855855856, 'fraction_numerical': 0.0022522522522522522, 'mean_word_length': 4.829396325459317, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5943090', 'n_tokens_mistral': 725, 'n_tokens_neox': 716, 'n_words': 181}