def get_fsmodule_info(): info = "" mod = "" if len (request.args) > 0: mod = request.args[0] else: return info try: from applications.everule.modules.everest import evst_get_module_info info = evst_get_module_info (mod) #print info except: print "Cann't get fsmodule info for %s" % mod return info
def reload_module_packages(): mid = -1 mname = "" if len (request.args) > 0: rows = db(db.modules.name == request.args[0]).select() if len (rows) > 0: mname = request.args[0] mid = rows[0]['id'] print "Reload pkgs for %s, %s" % (mname, mid) else: redirect(URL(r=request, f='index')) # Load package list pkgs = [] try: from applications.everule.modules.everest import evst_get_module_packages pkgs = evst_get_module_packages (mname) print pkgs except: print "Cann't get packages for %s" % mname rows = db(db.packages.module_id == mid).select() opkgs = [] for r in rows: opkgs.append (r['name']) for p in pkgs: if p not in opkgs: db.packages.insert (module_id = mid, name = p) # Update version/release info = "" try: from applications.everule.modules.everest import evst_get_module_info info = evst_get_module_info (mname) (n, version, release) = info.split(',') if (len(version) > 0): db.modules[mid] = dict(version=version) if (len(release) > 0): db.modules[mid] = dict(release=release) except: print "Cann't get fsmodule info for %s" % mname redirect(URL(r=request, f='detail', args=[mname]))