incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [32/36] git commit: [#6534] ticket:442 Small refactoring and comments update
Date Fri, 27 Sep 2013 16:43:37 GMT
[#6534] ticket:442 Small refactoring and comments update


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

Branch: refs/heads/db/6534
Commit: ffc4387c03786c64a0844cbadf54356aff4b4863
Parents: a76be70
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Sep 26 17:02:45 2013 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Sep 27 16:40:25 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/wiki.py | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ffc4387c/ForgeImporters/forgeimporters/github/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/wiki.py b/ForgeImporters/forgeimporters/github/wiki.py
index 0a4b2ee..87a09e6 100644
--- a/ForgeImporters/forgeimporters/github/wiki.py
+++ b/ForgeImporters/forgeimporters/github/wiki.py
@@ -223,15 +223,15 @@ class GitHubWikiImporter(ToolImporter):
 
         Conversion happens in 4 phases:
 
-        1. Convert source text to a html using h.render_any_markup,
-           if file format is not mediawiki. If mediawiki, it will
-           converted using mediawiki2markdown method.
-        2. Rewrite links that match the wiki URL prefix with new location
-        3. Convert resulting html to a markdown using html2text, if available,
-           and not mediawiki.
+        1. Convert source text to a html using h.render_any_markup.
+        2. Rewrite links that match the wiki URL prefix with new location.
+        3. Convert resulting html to a markdown using html2text, if available.
         4. Convert gollum tags
 
         If html2text module isn't available then only phases 1 and 2 will be executed.
+
+        Files in mediawiki format are converted using mediawiki2markdown
+        if html2text is available.
         """
         try:
             import html2text
@@ -244,11 +244,7 @@ class GitHubWikiImporter(ToolImporter):
         else:
             name, ext = name_and_ext
 
-        is_mediawiki = False
         if ext and ext in ['wiki', 'mediawiki']:
-            is_mediawiki = True
-
-        if is_mediawiki:
             if html2text:
                 text = mediawiki2markdown(text)
                 text = self.convert_gollum_tags(text)


Mime
View raw message