diff options
author | martin.von.loewis <devnull@localhost> | 2009-09-11 10:26:55 +0000 |
---|---|---|
committer | martin.von.loewis <devnull@localhost> | 2009-09-11 10:26:55 +0000 |
commit | 6f068d9b15900cdfc34fdd05df9a90c258c4b88f (patch) | |
tree | 51faf67da43094625cbd77312a6dfa62f5beb129 /admin.py | |
parent | b55c81413f9b8dfdf5c1fe652709ed8a9e5309e4 (diff) | |
download | decorator-6f068d9b15900cdfc34fdd05df9a90c258c4b88f.tar.gz |
Add deleteolddocs command.
Diffstat (limited to 'admin.py')
-rw-r--r-- | admin.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -90,6 +90,15 @@ def delete_mirror(store, root): store.delete_mirror(root) print 'done' +def delete_old_docs(config, store): + '''Delete documentation directories for packages that have been deleted''' + for i in os.listdir(config.database_docs_dir): + if not store.has_package(i): + path = os.path.join(config.database_docs_dir, i) + print "Deleting", path + shutil.rmtree(path) + + if __name__ == '__main__': config = config.Config('/usr/local/pypi/config.ini') store = store.Store(config) @@ -113,6 +122,8 @@ if __name__ == '__main__': add_mirror(*args) elif command == 'delmirror': delete_mirror(*args) + elif command == 'delolddocs': + delete_old_docs(config, *args) else: print "unknown command '%s'!"%command store.commit() |