<commit_before>from mechanize import Browser


def exec_(config, summary, script):
    USERNAME = config['USERNAME']
    PASSWORD = config['PASSWORD']
    SCRIPT_ID = config['SCRIPT_ID']

    LOGIN_URL = 'https://greasyfork.org/users/sign_in'
    EDIT_URL = 'https://greasyfork.org/scripts/{0}/versions/new'.format(SCRIPT_ID)

    b = Browser()

    # login
    b.open(LOGIN_URL)
    b.select_form(nr=2)
    b['user[email]'] = USERNAME
    b['user[password]'] = PASSWORD
    b.submit()

    # edit source
    b.open(EDIT_URL)
    b.select_form(nr=2)
    b['script_version[additional_info]'] = summary.encode('utf-8')
    b['script_version[code]'] = script.encode('utf-8')
    b.submit(name='commit')


# ex: ts=4 sts=4 sw=4 et
# sublime: tab_size 4; translate_tabs_to_spaces true; detect_indentation false; use_tab_stops true;
# kate: space-indent on; indent-width 4;<commit_msg>Fix login form.<commit_after>from mechanize import Browser


def exec_(config, summary, script):
    USERNAME = config['USERNAME']
    PASSWORD = config['PASSWORD']
    SCRIPT_ID = config['SCRIPT_ID']

    LOGIN_URL = 'https://greasyfork.org/users/sign_in'
    EDIT_URL = 'https://greasyfork.org/scripts/{0}/versions/new'.format(SCRIPT_ID)

    b = Browser()

    # login
    b.open(LOGIN_URL)
    b.select_form(nr=3)
    b['user[email]'] = USERNAME
    b['user[password]'] = PASSWORD
    b.submit()

    # edit source
    b.open(EDIT_URL)
    b.select_form(nr=2)
    b['script_version[additional_info]'] = summary.encode('utf-8')
    b['script_version[code]'] = script.encode('utf-8')
    b.submit(name='commit')


# ex: ts=4 sts=4 sw=4 et
# sublime: tab_size 4; translate_tabs_to_spaces true; detect_indentation false; use_tab_stops true;
# kate: space-indent on; indent-width 4;
{'fraction_non_alphanumeric': 0.15170454545454545, 'fraction_numerical': 0.011363636363636364, 'mean_word_length': 3.9745762711864407, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '332619', 'n_tokens_mistral': 681, 'n_tokens_neox': 637, 'n_words': 113}