summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-09-22 20:08:17 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-09-22 20:08:17 -0700
commit85b1cdc94d1d78723d7ded8c128b4b521e56df90 (patch)
tree943af9a80c73240cb0ac69481b525793ca75459a /setup.py
parent4360bf23d6bd35856ae8d0201dc7891fafc928f4 (diff)
downloadpystache-85b1cdc94d1d78723d7ded8c128b4b521e56df90.tar.gz
Move convert_md_to_rst() function.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py52
1 files changed, 26 insertions, 26 deletions
diff --git a/setup.py b/setup.py
index 538291f..330de7e 100644
--- a/setup.py
+++ b/setup.py
@@ -184,6 +184,32 @@ def make_temp_path(path):
return temp_path
+def convert_md_to_rst(path):
+ """
+ Convert the given file from markdown to reStructuredText.
+
+ Returns the new path.
+
+ """
+ # We write the converted files to temp files to simplify debugging.
+ temp_path = make_temp_path(path)
+ print("Converting: %s to %s" % (path, temp_path))
+
+ if os.path.exists(temp_path):
+ os.remove(temp_path)
+
+ # Pandoc uses the UTF-8 character encoding for both input and output.
+ command = "pandoc --write=rst --output=%s %s" % (temp_path, path)
+ os.system(command)
+
+ if not os.path.exists(temp_path):
+ s = ("Error running: %s\n"
+ " Did you install pandoc per the %s docstring?" % (command, __file__))
+ sys.exit(s)
+
+ return temp_path
+
+
def write_long_description(target_path):
"""
Generate the long_description for setup().
@@ -240,32 +266,6 @@ Run the following command and commit the changes--
os.system('python setup.py sdist upload')
-def convert_md_to_rst(path):
- """
- Convert the given file from markdown to reStructuredText.
-
- Returns the new path.
-
- """
- # We write the converted files to temp files to simplify debugging.
- temp_path = make_temp_path(path)
- print("Converting: %s to %s" % (path, temp_path))
-
- if os.path.exists(temp_path):
- os.remove(temp_path)
-
- # Pandoc uses the UTF-8 character encoding for both input and output.
- command = "pandoc --write=rst --output=%s %s" % (temp_path, path)
- os.system(command)
-
- if not os.path.exists(temp_path):
- s = ("Error running: %s\n"
- " Did you install pandoc per the %s docstring?" % (command, __file__))
- sys.exit(s)
-
- return temp_path
-
-
# We use the package simplejson for older Python versions since Python
# does not contain the module json before 2.6:
#