<commit_before>#!/usr/bin/env python2
#!coding=utf-8

import os
import sys
import ConfigParser


class Config(object):
    def __init__(self):
        # get config.ini path
        self.path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir), 'config.ini')
        self.configfile = ConfigParser.ConfigParser(allow_no_value=True)
        self.configfile.read(self.path)

    @property
    def limit(self):
        return self.configfile.get('option', 'limit')

    @limit.setter
    def limit(self, new_limit):
        self.configfile.set('option', 'limit', new_limit)
        self.save_config()

    @property
    def dir(self):
        return self.configfile.get('option', 'dir')

    @dir.setter
    def dir(self, new_dir):
        self.configfile.set('option', 'dir', new_dir)
        self.save_config()

    @property
    def cookies(self):
        cookies = self.configfile.get('option', 'cookies')
        return os.path.expanduser(cookies)

    @cookies.setter
    def cookies(self, cookies_path):
        self.configfile.set('option', 'cookies', cookies_path)
        self.save_config()

    @property
    def username(self):
        return self.configfile.get('option', 'username')

    @username.setter
    def username(self, new_name):
        self.configfile.set('option', 'username', new_name)
        self.save_config()

    @property
    def password(self):
        return self.configfile.get('option', 'password')

    @password.setter
    def password(self, new_passwd):
        self.configfile.set('option', 'password', new_passwd)
        self.save_config()

    def save_config(self):
        with open(name=self.path, mode='w') as fp:
            self.configfile.write(fp)

configure = Config()


def config(configuration):
    if len(configuration) == 0:
        print 'limit = %s' % configure.limit
        print 'dir = %s' % configure.dir
        print 'cookies = %s' % configure.cookies
    elif configuration[0] == 'limit':
        configure.limit = configuration[1]
        print 'Saving configuration to config.ini'
    elif configuration[0] == 'dir':
        configure.dir = configuration[1]<commit_msg>command config can show username and password now<commit_after>#!/usr/bin/env python2
#!coding=utf-8

import os
import sys
import ConfigParser


class Config(object):
    def __init__(self):
        # get config.ini path
        self.path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir), 'config.ini')
        self.configfile = ConfigParser.ConfigParser(allow_no_value=True)
        self.configfile.read(self.path)

    @property
    def limit(self):
        return self.configfile.get('option', 'limit')

    @limit.setter
    def limit(self, new_limit):
        self.configfile.set('option', 'limit', new_limit)
        self.save_config()

    @property
    def dir(self):
        return self.configfile.get('option', 'dir')

    @dir.setter
    def dir(self, new_dir):
        self.configfile.set('option', 'dir', new_dir)
        self.save_config()

    @property
    def cookies(self):
        cookies = self.configfile.get('option', 'cookies')
        return os.path.expanduser(cookies)

    @cookies.setter
    def cookies(self, cookies_path):
        self.configfile.set('option', 'cookies', cookies_path)
        self.save_config()

    @property
    def username(self):
        return self.configfile.get('option', 'username')

    @username.setter
    def username(self, new_name):
        self.configfile.set('option', 'username', new_name)
        self.save_config()

    @property
    def password(self):
        return self.configfile.get('option', 'password')

    @password.setter
    def password(self, new_passwd):
        self.configfile.set('option', 'password', <PASSWORD>)
        self.save_config()

    def save_config(self):
        with open(name=self.path, mode='w') as fp:
            self.configfile.write(fp)

configure = Config()


def config(configuration):
    if len(configuration) == 0:
        print 'limit = %s' % configure.limit
        print 'dir = %s' % configure.dir
        print 'cookies = %s' % configure.cookies
        print 'username = %s' % configure.username
        print 'password = %s' % configure.password
    elif configuration[0] == 'limit':
        configure.limit = configuration[1]
        print 'Saving configuration to config.ini'
    elif configuration[0] == 'dir':
        configure.dir = configuration[1]
{'fraction_non_alphanumeric': 0.13294538943598927, 'fraction_numerical': 0.003133393017009848, 'mean_word_length': 2.865916955017301, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1600787', 'n_tokens_mistral': 1392, 'n_tokens_neox': 1359, 'n_words': 288}