config: Switch all paths and files to use the Path in schemas.

Also renames static_dir to static_path for better consistency.
This commit is contained in:
Thomas Adamcik 2013-04-05 22:50:31 +02:00
parent 90efbb6be7
commit 36266064d3
5 changed files with 8 additions and 8 deletions

View File

@ -55,9 +55,9 @@ class Extension(ext.Extension):
def get_config_schema(self):
schema = config.ExtensionConfigSchema()
schema['music_path'] = config.String()
schema['playlist_path'] = config.String()
schema['tag_cache_file'] = config.String()
schema['music_path'] = config.Path()
schema['playlist_path'] = config.Path()
schema['tag_cache_file'] = config.Path()
return schema
def validate_environment(self):

View File

@ -80,7 +80,7 @@ class Extension(ext.Extension):
schema['password'] = config.String(secret=True)
schema['bitrate'] = config.Integer(choices=(96, 160, 320))
schema['timeout'] = config.Integer(minimum=0)
schema['cache_path'] = config.String()
schema['cache_path'] = config.Path()
schema['proxy_hostname'] = config.Hostname(optional=True)
schema['proxy_username'] = config.String(optional=True)
schema['proxy_password'] = config.String(optional=True, secret=True)

View File

@ -22,7 +22,7 @@ config_schemas = {} # TODO: use ordered dict?
config_schemas['logging'] = config.ConfigSchema()
config_schemas['logging']['console_format'] = config.String()
config_schemas['logging']['debug_format'] = config.String()
config_schemas['logging']['debug_file'] = config.String()
config_schemas['logging']['debug_file'] = config.Path()
config_schemas['logging.levels'] = config.LogLevelConfigSchema()

View File

@ -31,7 +31,7 @@ port = 6680
# Change this to have Mopidy serve e.g. files for your JavaScript client.
# "/mopidy" will continue to work as usual even if you change this setting.
#
static_dir =
static_path =
[logging.levels]
cherrypy = warning
@ -533,7 +533,7 @@ class Extension(ext.Extension):
schema = config.ExtensionConfigSchema()
schema['hostname'] = config.Hostname()
schema['port'] = config.Port()
schema['static_dir'] = config.String(optional=True)
schema['static_path'] = config.Path(optional=True)
return schema
def validate_environment(self):

View File

@ -79,7 +79,7 @@ class Extension(ext.Extension):
def get_config_schema(self):
schema = config.ExtensionConfigSchema()
schema['desktop_file'] = config.String()
schema['desktop_file'] = config.Path()
return schema
def validate_environment(self):