def get_module_items_from_files(m): import os, webnotes.defs from import_module import listfolders items = [] for item_type in listfolders(os.path.join(webnotes.defs.modules_path, m), 1): for item_name in listfolders(os.path.join(webnotes.defs.modules_path, m, item_type), 1): # read the file file = open(os.path.join(webnotes.defs.modules_path, m, item_type, item_name, item_name)+'.txt','r') doclist = eval(file.read()) file.close() # append items.append([item_type, item_name, doclist[0]['modified']]) return items
def get_modules_from_filesystem(): import os, webnotes.defs from import_module import listfolders modules = listfolders(webnotes.defs.modules_path, 1) out = [] modules.sort() modules = filter(lambda x: x!='patches', modules) for m in modules: file = open(os.path.join(webnotes.defs.modules_path, m, 'module.info'), 'r') out.append([m, eval(file.read()), get_last_update_for(m), \ webnotes.conn.exists('Module Def',m) and 'Installed' or 'Not Installed']) file.close() return out
def get_modules_from_filesystem(): import os, webnotes.defs from import_module import listfolders modules = listfolders(webnotes.defs.modules_path, 1) out = [] modules.sort() modules = filter(lambda x: x != "patches", modules) for m in modules: file = open(os.path.join(webnotes.defs.modules_path, m, "module.info"), "r") out.append( [ m, eval(file.read()), get_last_update_for(m), webnotes.conn.exists("Module Def", m) and "Installed" or "Not Installed", ] ) file.close() return out