You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/08/10 19:32:47 UTC
[16/50] [abbrv] allura git commit: [#7947] remove unnecessary line
breakage
[#7947] remove unnecessary line breakage
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/556a99e9
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/556a99e9
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/556a99e9
Branch: refs/heads/hs/7925
Commit: 556a99e9d986a9ebff4b84c36bf64886da02e4fd
Parents: 7075554
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Aug 3 18:10:54 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Aug 3 18:10:54 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/markdown_extensions.py | 36 +++++++++------------------
Allura/allura/model/project.py | 3 +--
2 files changed, 13 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/556a99e9/Allura/allura/lib/markdown_extensions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/markdown_extensions.py b/Allura/allura/lib/markdown_extensions.py
index 9a68e1a..83e8069 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -74,18 +74,14 @@ class CommitMessageExtension(markdown.Extension):
md.registerExtension(self)
# remove default preprocessors and add our own
md.preprocessors.clear()
- md.preprocessors['trac_refs'] = PatternReplacingProcessor(
- TracRef1(), TracRef2(), TracRef3(self.app))
+ md.preprocessors['trac_refs'] = PatternReplacingProcessor(TracRef1(), TracRef2(), TracRef3(self.app))
# remove all inlinepattern processors except short refs and links
md.inlinePatterns.clear()
- md.inlinePatterns["link"] = markdown.inlinepatterns.LinkPattern(
- markdown.inlinepatterns.LINK_RE, md)
- md.inlinePatterns['short_reference'] = ForgeLinkPattern(
- markdown.inlinepatterns.SHORT_REF_RE, md, ext=self)
+ md.inlinePatterns["link"] = markdown.inlinepatterns.LinkPattern(markdown.inlinepatterns.LINK_RE, md)
+ md.inlinePatterns['short_reference'] = ForgeLinkPattern(markdown.inlinepatterns.SHORT_REF_RE, md, ext=self)
# remove all default block processors except for paragraph
md.parser.blockprocessors.clear()
- md.parser.blockprocessors['paragraph'] = \
- markdown.blockprocessors.ParagraphProcessor(md.parser)
+ md.parser.blockprocessors['paragraph'] = markdown.blockprocessors.ParagraphProcessor(md.parser)
# wrap artifact link text in square brackets
self.forge_link_tree_processor = ForgeLinkTreeProcessor(md)
md.treeprocessors['links'] = self.forge_link_tree_processor
@@ -253,31 +249,23 @@ class ForgeExtension(markdown.Extension):
# https://github.com/waylan/Python-Markdown/issues/52
md.preprocessors['html_block'].markdown_in_raw = True
md.preprocessors['fenced-code'] = FencedCodeProcessor()
- md.preprocessors.add('plain_text_block',
- PlainTextPreprocessor(md), "_begin")
- md.preprocessors.add(
- 'macro_include', ForgeMacroIncludePreprocessor(md), '_end')
+ md.preprocessors.add('plain_text_block', PlainTextPreprocessor(md), "_begin")
+ md.preprocessors.add('macro_include', ForgeMacroIncludePreprocessor(md), '_end')
# this has to be before the 'escape' processor, otherwise weird
# placeholders are inserted for escaped chars within urls, and then the
# autolink can't match the whole url
- md.inlinePatterns.add('autolink_without_brackets', AutolinkPattern(
- r'(http(?:s?)://[a-zA-Z0-9./\-\\_%?&=+#;~:!]+)', md), '<escape')
+ md.inlinePatterns.add('autolink_without_brackets', AutolinkPattern(r'(http(?:s?)://[a-zA-Z0-9./\-\\_%?&=+#;~:!]+)', md), '<escape')
# replace the link pattern with our extended version
- md.inlinePatterns['link'] = ForgeLinkPattern(
- markdown.inlinepatterns.LINK_RE, md, ext=self)
- md.inlinePatterns['short_reference'] = ForgeLinkPattern(
- markdown.inlinepatterns.SHORT_REF_RE, md, ext=self)
+ md.inlinePatterns['link'] = ForgeLinkPattern(markdown.inlinepatterns.LINK_RE, md, ext=self)
+ md.inlinePatterns['short_reference'] = ForgeLinkPattern(markdown.inlinepatterns.SHORT_REF_RE, md, ext=self)
# macro must be processed before links
- md.inlinePatterns.add(
- 'macro', ForgeMacroPattern(MACRO_PATTERN, md, ext=self), '<link')
+ md.inlinePatterns.add('macro', ForgeMacroPattern(MACRO_PATTERN, md, ext=self), '<link')
self.forge_link_tree_processor = ForgeLinkTreeProcessor(md)
md.treeprocessors['links'] = self.forge_link_tree_processor
# Sanitize HTML
md.postprocessors['sanitize_html'] = HTMLSanitizer()
- # Rewrite all relative links that don't start with . to have a '../'
- # prefix
- md.postprocessors['rewrite_relative_links'] = RelativeLinkRewriter(
- make_absolute=self._is_email)
+ # Rewrite all relative links that don't start with . to have a '../' prefix
+ md.postprocessors['rewrite_relative_links'] = RelativeLinkRewriter(make_absolute=self._is_email)
# Put a class around markdown content for custom css
md.postprocessors['add_custom_class'] = AddCustomClass()
md.postprocessors['mark_safe'] = MarkAsSafe()
http://git-wip-us.apache.org/repos/asf/allura/blob/556a99e9/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index b45af77..cef25bc 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -859,8 +859,7 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
named_roles = security.RoleCache(
g.credentials,
g.credentials.project_roles(project_id=self.root_project._id).named)
- uids = [
- uid for uid in named_roles.userids_that_reach if uid is not None]
+ uids = [uid for uid in named_roles.userids_that_reach if uid is not None]
return list(User.query.find({'_id': {'$in': uids}, 'disabled': False, 'pending': False}))
def users_with_role(self, *role_names):