incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [24/50] git commit: [#6735] Fixed typo in "threshold"
Date Tue, 22 Oct 2013 15:00:51 GMT
[#6735] Fixed typo in "threshold"

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


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

Branch: refs/heads/cj/6692
Commit: 658f68f761a256475921a259456d625d477875d6
Parents: c5889c8
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Tue Oct 15 21:56:08 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Tue Oct 15 21:56:08 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/app_globals.py    | 12 ++++++------
 Allura/allura/tests/test_globals.py | 16 ++++++++--------
 Allura/development.ini              |  4 ++--
 3 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/658f68f7/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 4fb96b8..14fa5a1 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -84,7 +84,7 @@ class ForgeMarkdown(markdown.Markdown):
 
     def cached_convert(self, artifact, field_name):
         """Convert ``artifact.field_name`` markdown source to html, caching
-        the result if the render time is greater than the defined threshhold.
+        the result if the render time is greater than the defined threshold.
 
         """
         source_text = getattr(artifact, field_name)
@@ -105,15 +105,15 @@ class ForgeMarkdown(markdown.Markdown):
         html = self.convert(source_text)
         render_time = time.time() - start
 
-        threshhold = config.get('markdown_cache_threshhold')
+        threshold = config.get('markdown_cache_threshold')
         try:
-            threshhold = float(threshhold) if threshhold else None
+            threshold = float(threshold) if threshold else None
         except ValueError:
-            threshhold = None
+            threshold = None
             log.warn('Skipping Markdown caching - The value for config param '
-                    '"markdown_cache_threshhold" must be a float.')
+                    '"markdown_cache_threshold" must be a float.')
 
-        if threshhold != None and render_time > threshhold:
+        if threshold != None and render_time > threshold:
             if md5 is None:
                 md5 = hashlib.md5(source_text).hexdigest()
             cache.md5, cache.html, cache.render_time = md5, html, render_time

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/658f68f7/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index f6d6849..a1e8e55 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -562,7 +562,7 @@ class TestCachedMarkdown(unittest.TestCase):
         html = self.md.cached_convert(self.post, 'text')
         self.assertEqual(html, self.expected_html)
 
-    @patch.dict('allura.lib.app_globals.config', markdown_cache_threshhold='0')
+    @patch.dict('allura.lib.app_globals.config', markdown_cache_threshold='0')
     def test_empty_cache(self):
         html = self.md.cached_convert(self.post, 'text')
         self.assertEqual(html, self.expected_html)
@@ -571,7 +571,7 @@ class TestCachedMarkdown(unittest.TestCase):
                 self.post.text_cache.md5)
         self.assertTrue(self.post.text_cache.render_time > 0)
 
-    @patch.dict('allura.lib.app_globals.config', markdown_cache_threshhold='0')
+    @patch.dict('allura.lib.app_globals.config', markdown_cache_threshold='0')
     def test_stale_cache(self):
         old = self.md.cached_convert(self.post, 'text')
         self.post.text = u'new, different source text'
@@ -582,7 +582,7 @@ class TestCachedMarkdown(unittest.TestCase):
                 self.post.text_cache.md5)
         self.assertTrue(self.post.text_cache.render_time > 0)
 
-    @patch.dict('allura.lib.app_globals.config', markdown_cache_threshhold='0')
+    @patch.dict('allura.lib.app_globals.config', markdown_cache_threshold='0')
     def test_valid_cache(self):
         self.md.cached_convert(self.post, 'text')
         with patch.object(self.md, 'convert') as convert_func:
@@ -591,23 +591,23 @@ class TestCachedMarkdown(unittest.TestCase):
             self.assertFalse(convert_func.called)
 
     @patch.dict('allura.lib.app_globals.config', {})
-    def test_no_threshhold_defined(self):
+    def test_no_threshold_defined(self):
         html = self.md.cached_convert(self.post, 'text')
         self.assertEqual(html, self.expected_html)
         self.assertIsNone(self.post.text_cache.md5)
         self.assertIsNone(self.post.text_cache.html)
         self.assertIsNone(self.post.text_cache.render_time)
 
-    @patch.dict('allura.lib.app_globals.config', markdown_cache_threshhold='foo')
-    def test_invalid_threshhold(self):
+    @patch.dict('allura.lib.app_globals.config', markdown_cache_threshold='foo')
+    def test_invalid_threshold(self):
         html = self.md.cached_convert(self.post, 'text')
         self.assertEqual(html, self.expected_html)
         self.assertIsNone(self.post.text_cache.md5)
         self.assertIsNone(self.post.text_cache.html)
         self.assertIsNone(self.post.text_cache.render_time)
 
-    @patch.dict('allura.lib.app_globals.config', markdown_cache_threshhold='99999')
-    def test_render_time_below_threshhold(self):
+    @patch.dict('allura.lib.app_globals.config', markdown_cache_threshold='99999')
+    def test_render_time_below_threshold(self):
         html = self.md.cached_convert(self.post, 'text')
         self.assertEqual(html, self.expected_html)
         self.assertIsNone(self.post.text_cache.md5)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/658f68f7/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index 241e491..b8bb304 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -300,10 +300,10 @@ auth.method = local
 registration.method = local
 
 # When rendering discussion post Markdown to html, if the render takes longer
-# than `markdown_cache_threshhold` (in seconds), the resulting html will be
+# than `markdown_cache_threshold` (in seconds), the resulting html will be
 # cached and served from cache on subsequent requests. Set to 0 to cache all
 # posts. Remove entirely to cache nothing.
-markdown_cache_threshhold = .1
+markdown_cache_threshold = .1
 
 [app:task]
 use = main


Mime
View raw message