comparison 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
comparison
equal deleted inserted replaced
30:8ea3f335307d 31:4f9e701d76b4
161 """Kivy App for Cagou""" 161 """Kivy App for Cagou"""
162 162
163 def build(self): 163 def build(self):
164 return CagouRootWidget(ProfileManager()) 164 return CagouRootWidget(ProfileManager())
165 165
166 def expand(self, path): 166 def expand(self, path, *args, **kwargs):
167 """expand path and replace known values 167 """expand path and replace known values
168 168
169 @param path(unicode): path to expand
170 @param *args: additional arguments used in format
171 @param **kwargs: additional keyword arguments used in format
169 useful in kv. Values which can be used: 172 useful in kv. Values which can be used:
170 - {media}: media dir 173 - {media}: media dir
171 """ 174 """
172 return os.path.expanduser(path).format(media=self.host.media_dir) 175 return os.path.expanduser(path).format(*args, media=self.host.media_dir, **kwargs)
173 176
174 177
175 class Cagou(QuickApp): 178 class Cagou(QuickApp):
176 MB_HANDLE = False 179 MB_HANDLE = False
177 180