Mercurial > libervia-desktop-kivy
diff src/cagou/core/cagou_main.py @ 31:4f9e701d76b4
core: expand now accepts extra arguments, which will be used in format
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 21 Aug 2016 17:47:23 +0200 |
parents | 8b5827c43155 |
children | fdaf914e2729 |
line wrap: on
line diff
--- a/src/cagou/core/cagou_main.py Sun Aug 21 17:31:07 2016 +0200 +++ b/src/cagou/core/cagou_main.py Sun Aug 21 17:47:23 2016 +0200 @@ -163,13 +163,16 @@ def build(self): return CagouRootWidget(ProfileManager()) - def expand(self, path): + def expand(self, path, *args, **kwargs): """expand path and replace known values + @param path(unicode): path to expand + @param *args: additional arguments used in format + @param **kwargs: additional keyword arguments used in format useful in kv. Values which can be used: - {media}: media dir """ - return os.path.expanduser(path).format(media=self.host.media_dir) + return os.path.expanduser(path).format(*args, media=self.host.media_dir, **kwargs) class Cagou(QuickApp):