Changeset 2469
- Timestamp:
- 02/15/09 23:13:04 (4 years ago)
- File:
-
- 1 edited
-
alternc-apps/trunk/bin/update_apps.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
alternc-apps/trunk/bin/update_apps.py
r2468 r2469 34 34 os.chown(dir,33,-1) 35 35 36 def removeRecursiveDir(dir): 37 if os.path.exists(dir): 38 try: 39 os.rmdir(dir) 40 except OSError: 41 for directory in os.listdir(dir): 42 removeRecursiveDir(os.path.normpath(dir + "/" + directory)) 43 44 removeRecursiveDir(dir) 45 36 46 def installFile(fromfile, tofile): 37 47 if not os.path.exists(tofile): … … 58 68 fromfiles = generateFileList(alterncapps + "/" + application) 59 69 tofiles = generateFileList(path) 60 print tofiles 70 61 71 for dir in files['dirs']: 62 72 createDirIfNotExist(path + dir) … … 77 87 updateFiles(files, tofiles, os.path.normpath(alterncapps + "/" + appname), row[2]) 78 88 89 def uninstallApplication(appname, path): 90 installFiles = generateFileList(alterncapps + "/" + appname) 91 92 for file in installFiles['files']: 93 if os.path.exists(os.path.normpath(path + "/" + file)): 94 os.unlink(os.path.normpath(path + "/" + file)) 95 96 for dir in installFiles['dirs']: 97 removeRecursiveDir(os.path.normpath(path + "/" + dir)) 79 98 80 99 def runCron(): 81 100 conn = adodb.NewADOConnection('mysql') 82 101 conn.Connect(host, username, password,database); 102 103 for row in conn.Execute('SELECT uid, application, path FROM applications WHERE installed = 2'): 104 uid = row[0] 105 application = row[1] 106 path = row[2] 107 uninstallApplication(application, path) 108 conn.Execute('DELETE FROM applications WHERE uid = %s AND application = %s AND path = %s',(uid,application,path)) 83 109 84 110 for row in conn.Execute('SELECT uid, application, path FROM applications WHERE installed = 0'):
Note: See TracChangeset
for help on using the changeset viewer.
