Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dax/jmc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rousselie <dax@happycoders.org>2008-03-08 00:01:59 +0300
committerDavid Rousselie <dax@happycoders.org>2008-03-08 00:01:59 +0300
commitfc6952c5731fc7f1de383afce2228c3036ad525d (patch)
treeac7551b3e9cba69ac763d326b3c80165df6ba566 /setup.py
parent64b7823403bf16a847e0063cc7ca5a00ab8b2baa (diff)
Fix setup script
darcs-hash:20080307210159-86b55-586662b9ae0917210a774dee49baace0a1ac4f6e.gz
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/setup.py b/setup.py
index 702d489..dd3dcdd 100644
--- a/setup.py
+++ b/setup.py
@@ -24,6 +24,7 @@ from setuptools import setup, find_packages
import sys
import re
import shutil
+import os
prefix = "/usr"
for arg in sys.argv:
@@ -52,15 +53,16 @@ setup(name='jmc',
entry_points={'console_scripts': ['jmc=jmc.runner:main']},
test_suite='jmc.tests.suite')
-shutil.copy("conf/jmc.conf", config_dir)
-runner_file = open("src/jmc/runner.py")
-dest_runner_file = open("build/lib/jmc/runner.py", "w")
-
-config_file_re = re.compile("(.*self\.config_file = \")(jmc.conf\")")
-for line in runner_file:
- match = config_file_re.match(line)
- if match is not None:
- dest_runner_file.write(match.group(1) + config_dir
- + match.group(2) + "\n")
- else:
- dest_runner_file.write(line)
+if len(sys.argv) >= 2 and sys.argv[1] == "install":
+ os.makedirs(config_dir)
+ shutil.copy("conf/jmc.conf", config_dir)
+ runner_file = open("src/jmc/runner.py")
+ dest_runner_file = open("build/lib/jmc/runner.py", "w")
+ config_file_re = re.compile("(.*self\.config_file = \")(jmc.conf\")")
+ for line in runner_file:
+ match = config_file_re.match(line)
+ if match is not None:
+ dest_runner_file.write(match.group(1) + config_dir
+ + match.group(2) + "\n")
+ else:
+ dest_runner_file.write(line)