4 usage: %(progname)s [args] 7 import os, sys, string, time, getopt, re
10 import neo_cgi, neo_util, neo_cs
12 from pyclearsilver
import CSPage
13 from pyclearsilver
import odb
14 from launchman
import app
22 self.
db = db_webui.initSchema()
25 webutil.set_tabs(hdf, [
"apps",
"appinfo"])
26 webutil.grabTopics(hdf, [])
27 taskid = hdf.getValue(
"Query.taskid",
"")
28 doc = app.App(taskid).load_yaml()
30 prefix =
"CGI.cur.app" 31 hdf.setValue(prefix +
"." +
"taskid", taskid)
32 for key, val
in doc.items():
34 for i
in range(0,len(val)):
35 hdf.setValue(prefix +
"." + key +
"." + str(i), val[i])
37 hdf.setValue(prefix +
"." + key, val)
39 hdf.setValue(prefix +
"." + key,
'')
42 user_record = self.authdb.users.lookup(self.
username)
43 hdf.setValue(
"CGI.cur.user.favorite_apps", user_record.favorite_apps)
45 if user_record.is_favorite_app(taskid):
46 hdf.setValue(
"CGI.cur.app.favorite",
"1")
49 taskid = hdf.getValue(
"Query.taskid",
"")
50 doc = app.App(taskid).load_yaml()
52 prefix =
"CGI.cur.app" 53 hdf.setValue(prefix +
"." +
"taskid", taskid)
56 user_record = self.authdb.users.lookup(self.
username)
57 if hdf.getValue(
"Query.set_favorite",
"") ==
"1":
58 user_record.add_favorite_app(taskid)
59 elif hdf.getValue(
"Query.set_favorite",
"") ==
"0":
60 user_record.remove_favorite_app(taskid)
62 if user_record.is_favorite_app(taskid):
63 hdf.setValue(
"CGI.cur.favorite",
"1")
65 hdf.setValue(
"Content",
"appinfo_favorites.cs")
68 return MyPage(context, pagename=
"appinfo", nologin=
False)
71 context = CSPage.Context()
74 if __name__ ==
"__main__":
def Action_Favorites(self, hdf)