Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

        def configure(config):
    """Configure the Config object ``config``.

    Interactively create configuration options and add the attributes to
    the Config object ``config``.

    """
    config.add_section('db')

    config.interactive_add(
        'db', 'userdb_type',
        'What type of database would you like to use? (sqlite/mysql/postgres)',
        'sqlite'
    )

    non_sqlite_dbs = {'mysql': 'MySQL', 'postgres': 'PostgreSQL'}
    if config.db.userdb_type == 'sqlite':
        config.interactive_add(
            'db', 'userdb_file', 'Location for the database file'
        )

    elif config.db.userdb_type in [non_sqlite_dbs]:
        db_type = non_sqlite_dbs[config.db.userdb_type]
        config.interactive_add(
            'db', 'userdb_host', "Enter the %s hostname" % db_type, 'localhost'
        )
        config.interactive_add(
            'db', 'userdb_user', "Enter the %s username" % db_type)
        config.interactive_add(
            'db', 'userdb_pass', "Enter the user's password", 'none'
        )
        config.interactive_add(
            'db', 'userdb_name', "Enter the name of the database to use"
        )

    else:
        print("This isn't currently supported. Aborting.")
        


src/w/i/willie-4.3.0/willie/config.py   willie(Download)
    def _db(self):
        db.configure(self)
        self.save()
 
    def _modules(self):

src/w/i/willie-HEAD/willie/config.py   willie(Download)
    def _db(self):
        db.configure(self)
        self.save()
 
    def _modules(self):