incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [32/50] git commit: [#3154] pretty JSON output in exports
Date Wed, 21 Aug 2013 20:12:48 GMT
[#3154] pretty JSON output in exports


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/67947216
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/67947216
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/67947216

Branch: refs/heads/db/3154b
Commit: 6794721612346533ce5e4b1f94e88e3f2bfd8293
Parents: 69deb7e
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Thu Aug 1 19:24:48 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Aug 21 18:12:26 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tasks/export_tasks.py           |  2 +-
 ForgeBlog/forgeblog/main.py                   |  2 +-
 ForgeDiscussion/forgediscussion/forum_main.py |  2 +-
 ForgeLink/forgelink/link_main.py              |  2 +-
 ForgeTracker/forgetracker/tracker_main.py     | 14 +++++++-------
 ForgeWiki/forgewiki/wiki_main.py              |  2 +-
 6 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/67947216/Allura/allura/tasks/export_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/export_tasks.py b/Allura/allura/tasks/export_tasks.py
index 395970c..9933e26 100644
--- a/Allura/allura/tasks/export_tasks.py
+++ b/Allura/allura/tasks/export_tasks.py
@@ -67,7 +67,7 @@ def bulk_export(project_shortname, tools, username):
     try:
         path = create_export_dir(project)
         with open(os.path.join(path, 'project.json'), 'w') as f:
-            json.dump(project, f, cls=tg.jsonify.GenericJSON)
+            json.dump(project, f, cls=tg.jsonify.GenericJSON, indent=2)
     except:
         log.error('Something went wrong during export of project metadata', exc_info=True)
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/67947216/ForgeBlog/forgeblog/main.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/main.py b/ForgeBlog/forgeblog/main.py
index afcc076..e6da34f 100644
--- a/ForgeBlog/forgeblog/main.py
+++ b/ForgeBlog/forgeblog/main.py
@@ -195,7 +195,7 @@ class ForgeBlogApp(Application):
         posts = BM.BlogPost.query.find(dict(app_config_id=self.config._id)).sort('timestamp',
pymongo.DESCENDING)
         count = len(posts)
         for i, post in enumerate(posts):
-            json.dump(post, f, cls=jsonify.GenericJSON)
+            json.dump(post, f, cls=jsonify.GenericJSON, indent=2)
             if i < (count - 1):
                 f.write(',')
         f.write(']}')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/67947216/ForgeDiscussion/forgediscussion/forum_main.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/forum_main.py b/ForgeDiscussion/forgediscussion/forum_main.py
index 2465312..bf1835d 100644
--- a/ForgeDiscussion/forgediscussion/forum_main.py
+++ b/ForgeDiscussion/forgediscussion/forum_main.py
@@ -222,7 +222,7 @@ class ForgeDiscussionApp(Application):
         forums = DM.Forum.query.find(dict(app_config_id=self.config._id)).sort('mod_date',
pymongo.DESCENDING).all()
         count = len(forums)
         for i, forum in enumerate(forums):
-            json.dump(forum, f, cls=jsonify.GenericJSON)
+            json.dump(forum, f, cls=jsonify.GenericJSON, indent=2)
             if i < (count - 1):
                 f.write(',')
         f.write(']}')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/67947216/ForgeLink/forgelink/link_main.py
----------------------------------------------------------------------
diff --git a/ForgeLink/forgelink/link_main.py b/ForgeLink/forgelink/link_main.py
index b5dd0d4..199304a 100644
--- a/ForgeLink/forgelink/link_main.py
+++ b/ForgeLink/forgelink/link_main.py
@@ -96,7 +96,7 @@ class ForgeLinkApp(Application):
         super(ForgeLinkApp, self).uninstall(project)
 
     def bulk_export(self, f):
-        json.dump(RootRestController().link_json(), f, cls=jsonify.GenericJSON)
+        json.dump(RootRestController().link_json(), f, cls=jsonify.GenericJSON, indent=2)
 
 
 class RootController(BaseController):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/67947216/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index d6d20db..4ee0e74 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -415,17 +415,17 @@ class ForgeTrackerApp(Application):
             deleted=False)).all()
         count = len(tickets)
         for i, ticket in enumerate(tickets):
-            json.dump(ticket, f, cls=jsonify.GenericJSON)
+            json.dump(ticket, f, cls=jsonify.GenericJSON, indent=2)
             if i < (count - 1):
                 f.write(',')
-        f.write('], "tracker_config":')
-        json.dump(self.config, f, cls=jsonify.GenericJSON)
-        f.write(', "milestones":')
+        f.write('],\n"tracker_config":')
+        json.dump(self.config, f, cls=jsonify.GenericJSON, indent=2)
+        f.write(',\n"milestones":')
         milestones = self.milestones
-        json.dump(milestones, f, cls=jsonify.GenericJSON)
-        f.write(', "saved_bins":')
+        json.dump(milestones, f, cls=jsonify.GenericJSON, indent=2)
+        f.write(',\n"saved_bins":')
         bins = self.bins
-        json.dump(bins, f, cls=jsonify.GenericJSON)
+        json.dump(bins, f, cls=jsonify.GenericJSON, indent=2)
         f.write('}')
 
     @property

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/67947216/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index f27ff73..f0b85a7 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -294,7 +294,7 @@ The wiki uses [Markdown](%s) syntax.
             deleted=False)).all()
         count = len(pages)
         for i, page in enumerate(pages):
-            json.dump(page, f, cls=jsonify.GenericJSON)
+            json.dump(page, f, cls=jsonify.GenericJSON, indent=2)
             if i < (count - 1):
                 f.write(',')
         f.write(']}')


Mime
View raw message