Source

hgblog / hooks.patch

Full commit
# HG changeset patch
# Parent 8a2adc556d541e0a6ebe18883e755b987bb432d2

diff -r 8a2adc556d54 hgblog/generate_html.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hgblog/generate_html.py	Mon Apr 26 13:02:28 2010 -0400
@@ -0,0 +1,7 @@
+from hgblog.refresh import refresh
+
+def htmlize_articles(ui, repo, **kwargs):
+    """Calls on Sphinx to turn our .rst files into pretty HTML"""
+
+    refresh(repo)
+
diff -r 8a2adc556d54 hgblog/refresh.py
--- a/hgblog/refresh.py	Mon Apr 26 13:01:22 2010 -0400
+++ b/hgblog/refresh.py	Mon Apr 26 13:02:28 2010 -0400
@@ -1,13 +1,13 @@
-from mercurial.match import match
-from mercurial.ui import ui
-from sphinx.cmdline import main as sphinxify
 import os
 
-from hgblog.utils import get_repo
-
 def refresh(repo=None):
     """Calls on Sphinx to turn our .rst files into pretty HTML"""
 
+    from mercurial.match import match
+    from mercurial.ui import ui
+    from sphinx.cmdline import main as sphinxify
+    from hgblog.utils import get_repo
+
     if repo is None:
         repo = get_repo()
 
diff -r 8a2adc556d54 hgblog/utils.py
--- a/hgblog/utils.py	Mon Apr 26 13:01:22 2010 -0400
+++ b/hgblog/utils.py	Mon Apr 26 13:02:28 2010 -0400
@@ -1,9 +1,10 @@
-from mercurial.cmdutil import findrepo
-from mercurial import hg
-from mercurial.ui import ui
 import os
 
 def get_repo(path=None):
+    from mercurial.cmdutil import findrepo
+    from mercurial import hg
+    from mercurial.ui import ui
+
     if path is None:
         path = os.getcwd()