lazylandscape
clone your own copy | download snapshot

Snapshots | iceberg

No images in this repository’s iceberg at this time

Inside this repository

example.json
application/json

Download raw (2.1 KB)

[{"pk": 4, "model": "sh.shclasses", "fields": {"comment": "List Applications", "lang": "python", "name": "ListApps", "field": "Application", "parents": [], "deps": [], "public": false}}, {"pk": 3, "model": "sh.shmethods", "fields": {"comment": "", "body": "\r\nhtmlopen = r'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html lang=\"en\" dir=\"ltr\" xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"> <title>Lazy Landscape Shell</title> </head> <body>'\r\nhtmlClose = '</body></html>'\r\nstyle = r' <style> *{ border:none; padding:0; margin:0; } #wrapper{ width:90%; margin: 20px auto; } #page-title{ top:0; left:0; padding:12px; background-color:#000; color: #eee; font-family:sans-serif; } .app-box{ width: 300px; float:left; margin:12px; height:200px; } .app-title{ font-family:sans-serif; font-size:24pt; } .app-title a{ color:#f47; text-decoration:none; } .app-title-noexec a{ font-size:24pt; color:#a47; text-decoration:none; } .app-desc{ color:#aaa; font-style:italic; font-family:serif; font-size:12pt; } .app-noexec{ font-family:sans-serif; font-weight:bold; font-size:12pt; color:#000; } </style>'\r\ntitle = r' <h3 id=\"page-title\">Applications</h3> <div id=\"wrapper\"> '\r\n\r\nret = [htmlopen, style, title]\r\n\r\n\r\nfor c in ShClasses.objects.all():\r\n    if c.lang == 'python':\r\n        hasexec = False\r\n        for m in c.methods.all():\r\n            if m.name == 'app':\r\n                hasexec = True\r\n                break\r\n                   \r\n        exec_warning = ''\r\n        if not hasexec:\r\n            exec_warning = '<div class=\"app-noexec\">This app lacks an \"app\" method.</div>'\r\n            \r\n        ret += r' <div class=\"app-box\"> <div class=\"app-title\"><a href=\"/app/%s\">%s</a></div> <div class=\"app-desc\">%s</div> %s </div> ' % (c.name, c.name, c.comment, exec_warning)\r\n            \r\nret += '</div>'\r\nret += htmlClose\r\n\r\nresponse.write(''.join(ret))", "args": "", "name": "app", "cls": 4}}]