def __init__(self, connector=None): """user configuration: hidden values can not be set by the user in the options, but might be subject of being set automatically, e.g. the heartbeat. """ db.require(DBNAME, '0') c = cfg.ConfigBuilder() with c['keyboard_shortcuts'] as kbs: kbs.valid = '\d\d?\d?' kbs['prev'].value = 89 kbs['play'].value = 88 kbs['pause'].value = 67 kbs['stop'].value = 86 kbs['next'].value = 66 kbs['search'].value = 83 with c['misc.show_playlist_download_buttons'] as pl_download_buttons: pl_download_buttons.value = False with c['misc.autoplay_on_add'] as autoplay_on_add: autoplay_on_add.value = False with c['custom_theme.primary_color'] as primary_color: primary_color.value = '#F02E75' primary_color.valid = '#[0-9a-fA-F]{6}' with c['custom_theme.white_on_black'] as white_on_black: white_on_black.value = False with c['last_time_online'] as last_time_online: last_time_online.value = 0 last_time_online.valid = '\\d+' last_time_online.hidden = True last_time_online.doc = "UNIX TIME (1.1.1970 = never)" self.DEFAULTS = c.to_configuration() self.conn = BoundConnector(DBNAME, connector).connection()
def __init__(self, connector=None): database.require(DBNAME, version='1') self.normalize_basedir() connector = BoundConnector(DBNAME, connector) self.DBFILENAME = connector.dblocation self.conn = connector.connection() self.db = self.conn.cursor() #I don't care about journaling! self.conn.execute('PRAGMA synchronous = OFF') self.conn.execute('PRAGMA journal_mode = MEMORY') self.load_db_to_memory()
def __init__(self, connector=None): """user configuration: hidden values can not be set by the user in the options, but might be subject of being set automatically, e.g. the heartbeat. """ db.require(DBNAME, "0") c = cfg.ConfigBuilder() with c["keyboard_shortcuts"] as kbs: kbs.valid = "\d\d?\d?" kbs["prev"].value = 89 kbs["play"].value = 88 kbs["pause"].value = 67 kbs["stop"].value = 86 kbs["next"].value = 66 kbs["search"].value = 83 with c["misc.show_playlist_download_buttons"] as pl_download_buttons: pl_download_buttons.value = False with c["misc.autoplay_on_add"] as autoplay_on_add: autoplay_on_add.value = False with c["custom_theme.primary_color"] as primary_color: primary_color.value = "#F02E75" primary_color.valid = "#[0-9a-fA-F]{6}" with c["custom_theme.white_on_black"] as white_on_black: white_on_black.value = False with c["media.may_download"] as may_download: may_download.value = False with c["media.force_transcode_to_bitrate"] as force_transcode: force_transcode.value = 0 force_transcode.valid = "0|48|64|96|128|320" with c["ui.confirm_quit_dialog"] as confirm_quit_dialog: confirm_quit_dialog.value = True with c["ui.display_album_art"] as display_album_art: display_album_art.value = True with c["last_time_online"] as last_time_online: last_time_online.value = 0 last_time_online.valid = "\\d+" last_time_online.hidden = True last_time_online.doc = "UNIX TIME (1.1.1970 = never)" self.DEFAULTS = c.to_configuration() self.conn = BoundConnector(DBNAME, connector).connection()
def __init__(self, connector=None): database.require(DBNAME, version='1') self.conn = BoundConnector(DBNAME, connector).connection()