(path, err=False)
| 212 | return rst |
| 213 | |
| 214 | def build_widgets(path, err=False): |
| 215 | root = err in (True, False) |
| 216 | if root: sta, err = err, [] |
| 217 | subtree = [] |
| 218 | cont = os.listdir(os.path.join(root_dir, path)) |
| 219 | for i in cont: |
| 220 | subp = os.path.join(path,i) |
| 221 | if root and os.path.isdir(os.path.join(root_dir, subp)): |
| 222 | sub = build_widgets(subp, err) |
| 223 | if len(sub)!=0:subtree.append(sub) |
| 224 | elif not root: |
| 225 | if i[len(i)-7:] in ('_wgt.py', 'wgts.py'): |
| 226 | subtree.append(i[:-3]) |
| 227 | #print('====', subtree) |
| 228 | if len(subtree)==0:return [] |
| 229 | rpath = path.replace('/', '.').replace('\\','.') |
| 230 | #rpath = rpath[rpath.index('imagepy.'):] |
| 231 | pg = __import__('imagepy.' + rpath,'','',['']) |
| 232 | pg.title = os.path.basename(path) |
| 233 | if hasattr(pg, 'catlog'): |
| 234 | subtree = sort_widgets(pg.catlog, subtree) |
| 235 | if not root: |
| 236 | subtree = extend_widgets(path, subtree, err) |
| 237 | elif sta and len(err)>0: |
| 238 | IPy.write('widgets not loaded:') |
| 239 | for i in err: IPy.write('>>> %-50s%-20s%s'%i) |
| 240 | return (pg, subtree) |
| 241 | |
| 242 | def build_document(path): |
| 243 | docs = [] |
nothing calls this directly
no test coverage detected