Did I find the right examples for you? yes no

All Samples(6)  |  Call(2)  |  Derive(0)  |  Import(4)
Creates the user config dir if it doesn't exists

        def userconfig():
    '''Creates the user config dir if it doesn't exists'''
    path = os.path.expanduser('~/.dardrive')
    config_file = os.path.join(path, 'jobs.cfg')
    settings_file = os.path.join(path, 'setts.py')
    mkdir(path)
    mkdir(os.path.expanduser('~/.dardrive/dmd'))
    if not os.path.exists(config_file):
        cf = ConfigParser.RawConfigParser()
        cf.add_section('global')
        for k in DARDRIVE_DEFAULTS.keys():
            cf.set('global', k, DARDRIVE_DEFAULTS[k][0])

        fd1 = os.open(config_file, os.O_WRONLY | os.O_CREAT, 0600)
        with os.fdopen(fd1, 'w') as configfile:
                cf.write(configfile)
                sys.stdout.write("Config file written.\n")

    if not os.path.exists(settings_file):
        fd2 = os.open(settings_file, os.O_WRONLY | os.O_CREAT, 0600)
        with os.fdopen(fd2, 'w') as stts:
            stts.write(STTS_TPL)
            sys.stdout.write("Settings file written.\n")
        


src/d/a/dardrive-0.2.11b13/src/dardrive/shell.py   dardrive(Download)
from dar import Scheme, dar_par
from db import Report, Importer, find_ext, Catalog, Lock, Stat, engine
from utils import userconfig, DARDRIVE_DEFAULTS, dar_status
from utils import send_email, reindent, mk_dar_date
from utils import mk_ssl_auth_file, save_xattr
def main():
    import sys
    if len(sys.argv) > 1:
        if sys.argv[1].strip() == "init":
            userconfig()

src/d/a/Dardrive-HEAD/src/dardrive/shell.py   Dardrive(Download)
from dar import Scheme, dar_par
from db import Report, Importer, find_ext, Catalog, Lock, Stat, engine
from utils import userconfig, DARDRIVE_DEFAULTS, dar_status
from utils import send_email, reindent, mk_dar_date
from utils import mk_ssl_auth_file, save_xattr
def main():
    import sys
    if len(sys.argv) > 1:
        if sys.argv[1].strip() == "init":
            userconfig()

src/d/a/dardrive-0.2.11b13/src/dardrive/dar.py   dardrive(Download)
from db import get_or_create, dardrive_types, find_ext, Report, save_stats
from excepts import *
from utils import mkdir, userconfig, DARDRIVE_DEFAULTS, check_file
from utils import mk_mysql_auth_file, ordinal, parsedar_dates
from utils import mk_ssl_auth_file

src/d/a/Dardrive-HEAD/src/dardrive/dar.py   Dardrive(Download)
from db import get_or_create, dardrive_types, find_ext, Report, save_stats
from excepts import *
from utils import mkdir, userconfig, DARDRIVE_DEFAULTS, check_file
from utils import mk_mysql_auth_file, ordinal, parsedar_dates
from utils import mk_ssl_auth_file