Check-in [d781433c78]
Overview
| Comment: | Safeguard get_data for plugin_meta(), as global or local extras would be found by module_list, but not get_data(). |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
d781433c7894429f8b9884fbe5bac297 |
| User & Date: | mario on 2015-04-11 16:09:52 |
| Other Links: | manifest | tags |
Context
|
2015-04-11
| ||
| 19:14 | Manually implement $XDG_MUSIC_DIR lookup. check-in: b3afb7ed76 user: mario tags: trunk | |
| 16:09 | Safeguard get_data for plugin_meta(), as global or local extras would be found by module_list, but not get_data(). check-in: d781433c78 user: mario tags: trunk | |
| 16:09 | Give up. Just use embedded PNG for transparent empty_pixbif. check-in: c4adfede4a user: mario tags: trunk | |
Changes
Modified config.py from [cbe5c8fdc6] to [d7b33fd59d].
| ︙ | ︙ | |||
370 371 372 373 374 375 376 |
# ยท frame= automatically extract comment header from caller
#
def plugin_meta(fn=None, src=None, module=None, frame=1, plugin_base="channels"):
# try via pkgutil first
if module:
fn = module
| | > | 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
# ยท frame= automatically extract comment header from caller
#
def plugin_meta(fn=None, src=None, module=None, frame=1, plugin_base="channels"):
# try via pkgutil first
if module:
fn = module
try: src = pkgutil.get_data(plugin_base, fn+".py")
except: pass
# get source directly from caller
elif not src and not fn:
module = inspect.getmodule(sys._getframe(frame))
fn = inspect.getsourcefile(module)
src = inspect.getcomments(module)
|
| ︙ | ︙ | |||
414 415 416 417 418 419 420 |
"type": "module", "api": "python", "doc": ""
}
# extract coherent comment block, split doc section
if not literal:
src = rx.comment.search(src)
if not src:
| | | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
"type": "module", "api": "python", "doc": ""
}
# extract coherent comment block, split doc section
if not literal:
src = rx.comment.search(src)
if not src:
__print__(dbg.ERR, "Couldn't read source meta information:", fn)
return meta
src = src.group(0)
src = rx.hash.sub("", src).strip()
# split comment block
if src.find("\n\n") > 0:
src, meta["doc"] = src.split("\n\n", 1)
|
| ︙ | ︙ |