Check-in [4997a22651]
Overview
| Comment: | Fix conf.debug checking. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
4997a22651d918bad8a8218aec79209f |
| User & Date: | mario on 2015-04-01 15:44:31 |
| Other Links: | manifest | tags |
Context
|
2015-04-01
| ||
| 15:45 | Split extension_main and extension_context menus. Fix pixmap icon back. check-in: 04f454a7a3 user: mario tags: trunk | |
| 15:44 | Fix conf.debug checking. check-in: 4997a22651 user: mario tags: trunk | |
| 15:43 | Nicer error message, and compacter plugin comment. Add default config value in init. check-in: 6226dc5594 user: mario tags: trunk | |
Changes
Modified config.py from [799d76f2f1] to [a316308630].
| ︙ | |||
121 122 123 124 125 126 127 128 129 130 131 132 133 134 | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | + |
for opt in config:
if ("name" in opt) and ("value" in opt) and (opt["name"] not in vars(self)):
self.__dict__[opt["name"]] = opt["value"]
# plugin state
if module and module not in conf.plugins:
conf.plugins[module] = 1
#@TODO: use meta["priority"] in ("core", "builtin", "default") etc.
# http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
def xdg(self, path="/streamtuner2"):
home = os.environ.get("HOME", self.tmp)
config = os.environ.get("XDG_CONFIG_HOME", os.environ.get("APPDATA", home+"/.config"))
|
| ︙ | |||
185 186 187 188 189 190 191 | 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | - + |
else:
return # file not found
# decode
r = json.load(f)
f.close()
return r
except Exception as e:
|
| ︙ | |||
301 302 303 304 305 306 307 | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | - + - + |
keyval = re.compile(r"""
^([\w-]+):(.*$(?:\n(?![\w-]+:).+$)*) # plain key:value lines
""", re.M|re.X)
config = re.compile(r"""
[\{\<] (.+?) [\}\>] # JSOL/YAML scheme {...} dicts
""", re.X)
options = re.compile(r"""
|
| ︙ |