incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] git commit: [#6796] refactor MARKDOWN_EXTENSIONS to shared location
Date Tue, 05 Nov 2013 22:39:24 GMT
Updated Branches:
  refs/heads/master 49f2e8d7c -> d43e302f8


[#6796] refactor MARKDOWN_EXTENSIONS to shared location


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

Branch: refs/heads/master
Commit: d43e302f8b4c2d79ccbd8a348c1237c6c640ac15
Parents: 112cbf7
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Tue Nov 5 22:39:09 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Tue Nov 5 22:39:16 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/utils.py                   | 4 ++++
 Allura/allura/model/repo.py                  | 6 +++---
 ForgeImporters/forgeimporters/github/wiki.py | 3 ++-
 3 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d43e302f/Allura/allura/lib/utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index abd3fd4..7d4c081 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -48,6 +48,10 @@ from feedparser import _HTMLSanitizer
 from ew import jinja2_ew as ew
 from ming.utils import LazyProperty
 
+
+MARKDOWN_EXTENSIONS = ['.markdown', '.mdown', '.mkdn', '.mkd', '.md']
+
+
 def permanent_redirect(url):
     try:
         tg.redirect(url)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d43e302f/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index b598e20..3b4feca 100644
--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -54,7 +54,7 @@ README_RE = re.compile('^README(\.[^.]*)?$', re.IGNORECASE)
 VIEWABLE_EXTENSIONS = ['.php','.py','.js','.java','.html','.htm','.yaml','.sh',
     '.rb','.phtml','.txt','.bat','.ps1','.xhtml','.css','.cfm','.jsp','.jspx',
     '.pl','.php4','.php3','.rhtml','.svg','.markdown','.json','.ini','.tcl','.vbs','.xsl']
-MARKDOWN_EXTENSIONS = ['.markdown', '.mdown', '.mkdn', '.mkd', '.md', '.rst']
+PYPELINE_EXTENSIONS = utils.MARKDOWN_EXTENSIONS + ['.rst']
 
 DIFF_SIMILARITY_THRESHOLD = .5  # used for determining file renames
 
@@ -725,7 +725,7 @@ class Blob(object):
 
     @property
     def has_pypeline_view(self):
-        if README_RE.match(self.name) or self.extension in MARKDOWN_EXTENSIONS:
+        if README_RE.match(self.name) or self.extension in PYPELINE_EXTENSIONS:
             return True
         return False
 
@@ -733,7 +733,7 @@ class Blob(object):
     def has_html_view(self):
         if (self.content_type.startswith('text/') or
             self.extension in VIEWABLE_EXTENSIONS or
-            self.extension in MARKDOWN_EXTENSIONS or
+            self.extension in PYPELINE_EXTENSIONS or
             self.extension in self.repo._additional_viewable_extensions or
             utils.is_text_file(self.text)):
             return True

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d43e302f/ForgeImporters/forgeimporters/github/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/wiki.py b/ForgeImporters/forgeimporters/github/wiki.py
index b12ea93..fff43ad 100644
--- a/ForgeImporters/forgeimporters/github/wiki.py
+++ b/ForgeImporters/forgeimporters/github/wiki.py
@@ -40,6 +40,7 @@ from tg.decorators import (
 
 from allura.controllers import BaseController
 from allura.lib import helpers as h
+from allura.lib import utils
 from allura.lib.plugin import ImportIdConverter
 from allura.lib.decorators import (
         require_post,
@@ -115,7 +116,7 @@ class GitHubWikiImporter(ToolImporter):
     tool_option = {"import_history": "Import history"}
 
     mediawiki_exts = ['.wiki', '.mediawiki']
-    markdown_exts = ['.markdown', '.mdown', '.mkdn', '.mkd', '.md']
+    markdown_exts = utils.MARKDOWN_EXTENSIONS
     textile_exts = ['.textile']
     # List of supported formats https://github.com/gollum/gollum/wiki#page-files
     supported_formats = [


Mime
View raw message