Merge branch 'master' into dev

Signed-off-by: Dave Brondsema dbrondsema@geek.net

Dave Brondsema Dave Brondsema 2011-05-03

changed Allura/allura/command/__init__.py
changed Allura/allura/model/auth.py
changed Allura/setup.py
changed scripts/update-acls.py
changed Allura/allura/model/__init__.py
changed Allura/allura/model/repository.py
changed Allura/allura/templates/widgets/markdown_edit.html
changed Allura/allura/tests/model/test_repo.py
changed ForgeTracker/forgetracker/templates/tracker/mass_edit.html
changed ForgeTracker/forgetracker/templates/tracker/milestone.html
changed ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
changed ForgeTracker/forgetracker/tests/unit/test_root_controller.py
changed ForgeTracker/forgetracker/widgets/ticket_search.py
changed ForgeTracker/forgetracker/tracker_main.py
copied scripts/create-neighborhood.py -> Allura/allura/command/create_neighborhood.py
Allura/allura/command/__init__.py Diff Switch to side-by-side view
Loading...
Allura/allura/model/auth.py Diff Switch to side-by-side view
Loading...
Allura/setup.py Diff Switch to side-by-side view
Loading...
scripts/update-acls.py Diff Switch to side-by-side view
Loading...
Allura/allura/model/__init__.py Diff Switch to side-by-side view
Loading...
Allura/allura/model/repository.py Diff Switch to side-by-side view
Loading...
Allura/allura/templates/widgets/markdown_edit.html Diff Switch to side-by-side view
Loading...
Allura/allura/tests/model/test_repo.py Diff Switch to side-by-side view
Loading...
ForgeTracker/forgetracker/templates/tracker/mass_edit.html Diff Switch to side-by-side view
Loading...
ForgeTracker/forgetracker/templates/tracker/milestone.html Diff Switch to side-by-side view
Loading...
ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html Diff Switch to side-by-side view
Loading...
ForgeTracker/forgetracker/tests/unit/test_root_controller.py Diff Switch to side-by-side view
Loading...
ForgeTracker/forgetracker/widgets/ticket_search.py Diff Switch to side-by-side view
Loading...
ForgeTracker/forgetracker/tracker_main.py Diff Switch to side-by-side view
Loading...
scripts/create-neighborhood.py to Allura/allura/command/create_neighborhood.py
--- a/scripts/create-neighborhood.py
+++ b/Allura/allura/command/create_neighborhood.py
@@ -1,29 +1,21 @@
-import sys
-
-from ming.orm import ThreadLocalORMSession
+from . import base
 
 from allura import model as M
 from allura.lib import plugin
 
-USAGE='%s <neighborhood_prefix> <neighborhood_admin0>...'
+class CreateNeighborhoodCommand(base.Command):
+    min_args=3
+    max_args=None
+    usage = '<ini file> <neighborhood_shortname> <admin1> [<admin2>...]'
+    summary = 'Create a new neighborhood with the listed admins'
+    parser = base.Command.standard_parser(verbose=True)
 
-def main():
-    assert len(sys.argv) > 2, USAGE
-    admins = [
-        M.User.by_username(un)
-        for un in sys.argv[2:] ]
-    prefix = sys.argv[1]
-    n = M.Neighborhood(
-        name=prefix,
-        url_prefix='/' + prefix + '/',
-        acl=dict(
-            read=[None],
-            create=[],
-            moderate=[ u._id for u in admins ],
-            admin=[ u._id for u in admins ]))
-    project_reg = plugin.ProjectRegistrationProvider.get()
-    project_reg.register_neighborhood_project(n, admins)
-    ThreadLocalORMSession.flush_all()
-
-if __name__ == '__main__':
-    main()
+    def command(self):
+        self.basic_setup()
+        admins = [ M.User.by_username(un) for un in self.args[2:] ]
+        shortname = self.args[1]
+        n = M.Neighborhood(
+            name=shortname,
+            url_prefix='/' + shortname + '/')
+        project_reg = plugin.ProjectRegistrationProvider.get()
+        project_reg.register_neighborhood_project(n, admins)