summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorrsiddharth <rsiddharth@ninthfloor.org>2014-01-02 16:40:03 +0530
committerrsiddharth <rsiddharth@ninthfloor.org>2014-01-02 16:40:03 +0530
commitb6e406da07b5ac327c28deb7f1bfc7e5a7399adb (patch)
tree8aa64633dea5da4bd2c077af4b8140beeb30a450 /src
parent5e44da9ab175ba17079c6703f2034ea51e791489 (diff)
bugfix: local copy of the wiki page is made only when the remote update is successful.
Diffstat (limited to 'src')
-rw-r--r--src/gns_wiki.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/gns_wiki.py b/src/gns_wiki.py
index 6b40936..749a89f 100644
--- a/src/gns_wiki.py
+++ b/src/gns_wiki.py
@@ -54,17 +54,21 @@ def update(table, src_dir):
# Send the updated wiki page to moin wiki:
mc.putPage(pagename, wiki_page_content)
result = mc()
+ success = None
try:
- success, raw = tuple(result)
-
- if success:
- print "Updated %s" % pagename
- else:
- print "Something went wrong. Please report this issue."
-
+ success = result[1]
except Fault, e:
print e
+
+ if success:
+ print "Updated %s" % (pagename)
+ update_wiki_page_locally(
+ wiki_page_content,
+ path.join(src_dir, "wiki-files",
+ "differences-with-debian.txt"))
+ else:
+ print ">> Script did not update wiki <<"
else:
print "Nothing new! %s/%s was not updated" % (wikiurl,
pagename)
@@ -112,13 +116,10 @@ def wiki_page_updated(wiki_page_content, src_dir):
update = (filecmp.cmp(temp_file.name,
diff_with_deb, 1) == False)
else:
- # This is the first time the page is generated,
- # so update the wiki.
+ # we don't have a local copy of the wiki page. So, let's
+ # update the wiki.
update = True
- if(update):
- update_wiki_page_locally(wiki_page_content, diff_with_deb)
-
return update