summaryrefslogtreecommitdiff
path: root/admin.py
diff options
context:
space:
mode:
authormartin.von.loewis <devnull@localhost>2009-03-27 19:07:38 +0000
committermartin.von.loewis <devnull@localhost>2009-03-27 19:07:38 +0000
commit7a2010a9e84ff3d436e24e06c9cdd33931f4fcd0 (patch)
treea1b00dddcb7919e81a936eb41d9eba12647ca8f4 /admin.py
parent725c6ee0f2d435b00dd73b6b00ab489c2bfc86f4 (diff)
downloaddecorator-7a2010a9e84ff3d436e24e06c9cdd33931f4fcd0.tar.gz
Merged revisions 566-578 via svnmerge from
https://svn.python.org/packages/branches/tarek-pypi/pypi ........ r566 | tarek.ziade | 2008-11-22 07:17:54 -0600 (Sa, 22 Nov 2008) | 1 line started the work on the stat generator (using a apache log reader class) ........ r567 | tarek.ziade | 2008-11-23 10:46:52 -0600 (So, 23 Nov 2008) | 1 line now using csv to build the stats file ........ r568 | tarek.ziade | 2008-11-23 11:46:07 -0600 (So, 23 Nov 2008) | 1 line now can build monthly or daily stats ........ r569 | tarek.ziade | 2008-11-23 12:21:52 -0600 (So, 23 Nov 2008) | 1 line added read_stats function ........ r570 | tarek.ziade | 2008-11-23 13:13:47 -0600 (So, 23 Nov 2008) | 1 line introduced compression for stat files ........ r571 | tarek.ziade | 2008-11-27 02:36:22 -0600 (Do, 27 Nov 2008) | 1 line now able to get stats from mirrors ........ r572 | tarek.ziade | 2008-11-30 07:20:31 -0600 (So, 30 Nov 2008) | 1 line added the mirrors page ........ r573 | tarek.ziade | 2008-11-30 12:51:50 -0600 (So, 30 Nov 2008) | 1 line now using the mirrors to build the local counts ........ r574 | tarek.ziade | 2008-11-30 14:25:42 -0600 (So, 30 Nov 2008) | 1 line adding the mirror section ........ r575 | tarek.ziade | 2008-12-01 08:14:49 -0600 (Mo, 01 Dez 2008) | 1 line writing local and global stats file ........ r576 | tarek.ziade | 2008-12-01 08:16:04 -0600 (Mo, 01 Dez 2008) | 1 line typos ........ r577 | tarek.ziade | 2008-12-04 02:07:56 -0600 (Do, 04 Dez 2008) | 1 line fixed typo ........ r578 | tarek.ziade | 2008-12-04 02:10:06 -0600 (Do, 04 Dez 2008) | 1 line more doc ........
Diffstat (limited to 'admin.py')
-rw-r--r--admin.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/admin.py b/admin.py
index ef28355..58c0e06 100644
--- a/admin.py
+++ b/admin.py
@@ -77,8 +77,23 @@ def rename_package(store, old, new):
store.rename_package(old, new)
+def add_mirror(store, root, user, index, last_modified, locat_stats, stats, mirrors):
+ ''' Add a mirror to the mirrors list
+ '''
+ store.add_mirror(root, user, index, last_modified, locat_stats,
+ stats, mirrors)
+
+ print 'done'
+
+def delete_mirror(store, root):
+ ''' Delete a mirror
+ '''
+ store.delete_mirror(root)
+ print 'done'
+
if __name__ == '__main__':
- config = config.Config('/usr/local/pypi/config.ini', 'webui')
+ #config = config.Config('/usr/local/pypi/config.ini', 'webui')
+ config = config.Config('config.ini', 'webui')
store = store.Store(config)
store.open()
command = sys.argv[1]
@@ -96,6 +111,10 @@ if __name__ == '__main__':
delete_owner(*args)
elif command == 'rename':
rename_package(*args)
+ elif command == 'addmirror':
+ add_mirror(*args)
+ elif command == 'delmirror':
+ delete_mirror(*args)
else:
print "unknown command '%s'!"%command
store.commit()