hgblog / hooks.patch

# 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()
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.