def __init__( self, database, host, settings, desktop, nuke = False ): self.database = database self.settings = settings self.desktop = desktop self.main_notebook = None self.anonymous = None if nuke is True: self.database.execute( file( "model/drop.sql" ).read(), commit = False ) if host: self.database.execute( file( "model/schema.sql" ).read(), commit = False ) else: self.database.execute_script( file( "model/schema.sqlite" ).read(), commit = False ) self.create_main_notebook() self.create_anonymous_user() if desktop is True: self.create_desktop_user() self.database.commit() version = Schema_upgrader.version_string_to_tuple( VERSION ) Schema_upgrader.schema_version( database, default_version = version ) self.database.commit()
def __init__(self, database, host, settings, desktop, nuke=False): self.database = database self.settings = settings self.desktop = desktop self.main_notebook = None self.anonymous = None if nuke is True: self.database.execute(file("model/drop.sql").read(), commit=False) if host: self.database.execute(file("model/schema.sql").read(), commit=False) else: self.database.execute_script(file("model/schema.sqlite").read(), commit=False) self.create_main_notebook() self.create_anonymous_user() if desktop is True: self.create_desktop_user() self.database.commit() version = Schema_upgrader.version_string_to_tuple(VERSION) Schema_upgrader.schema_version(database, default_version=version) self.database.commit()