Check-in [9f252677fa]
Overview
| Comment: | Stub placeholder version: as `0` |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
9f252677fa563fdc11ad05dc65edd0d2 |
| User & Date: | mario on 2015-05-04 22:29:23 |
| Other Links: | manifest | tags |
Context
|
2015-05-05
| ||
| 10:42 | Fix missing channel key error. Add icon. check-in: f4dfbc1e53 user: mario tags: trunk | |
|
2015-05-04
| ||
| 22:29 | Stub placeholder version: as `0` check-in: 9f252677fa user: mario tags: trunk | |
| 17:47 | Rewrite some comments. check-in: d08461a712 user: mario tags: trunk | |
Changes
Modified pluginconf.py from [1109b86183] to [e41a1aac5c].
| ︙ | ︙ | |||
81 82 83 84 85 86 87 | # Injectables # ‾‾‾‾‾‾‾‾‾‾‾ log_WARN = lambda *x:None log_ERR = lambda *x:None # File lookup relation for get_data(), should name a top-level module/package | | | | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# Injectables
# ‾‾‾‾‾‾‾‾‾‾‾
log_WARN = lambda *x:None
log_ERR = lambda *x:None
# File lookup relation for get_data(), should name a top-level module/package
module_base = "config"
# Package names or base paths for module_list() and plugin_meta() lookups
plugin_base = ["channels"]
# [conf.share+"/channels", conf.dir+"/plugins"])
# Resource retrieval
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
| ︙ | ︙ | |||
107 108 109 110 111 112 113 |
if gz:
bin = gzip_decode(bin)
if decode:
return bin.decode("utf-8", errors='ignore')
else:
return str(bin)
except:
| | | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
if gz:
bin = gzip_decode(bin)
if decode:
return bin.decode("utf-8", errors='ignore')
else:
return str(bin)
except:
log_WARN("get_data() didn't find:", fn, "in", file_base)
# Plugin name lookup
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
# Search through ./plugins/ (and other configured plugin_base
# names or paths) and get module basenames.
|
| ︙ | ︙ | |||
151 152 153 154 155 156 157 | # # module= lookup per pkgutil, from plugin bases # or top-level modules # # frame= extract comment header of caller # (default) # | | | 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
#
# module= lookup per pkgutil, from plugin bases
# or top-level modules
#
# frame= extract comment header of caller
# (default)
#
def plugin_meta(fn=None, src=None, module=None, frame=1, extra_base=[]):
# Try via pkgutil first,
# find any plugins.* modules, or main packages
if module:
fn = module
for base in plugin_base + extra_base:
try:
|
| ︙ | ︙ | |||
208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
meta = {
"id": os.path.splitext(os.path.basename(fn or "")),
"fn": fn,
"api": "python",
"type": "module",
"category": None,
"priority": None,
"title": fn,
"description": "no description",
"config": [],
"doc": ""
}
# Extract coherent comment block
| > | 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
meta = {
"id": os.path.splitext(os.path.basename(fn or "")),
"fn": fn,
"api": "python",
"type": "module",
"category": None,
"priority": None,
"version": "0",
"title": fn,
"description": "no description",
"config": [],
"doc": ""
}
# Extract coherent comment block
|
| ︙ | ︙ |