Commits

Jason R. Coombs committed 79d09ad

Added entry point for creating the IIS site.

Comments (0)

Files changed (2)

adamsrow/tracker/isapi.py

 import sys
 import os
 import traceback
+from textwrap import dedent
 
 import isapi_wsgi
 import isapi.install
 		)
 	params.VirtualDirs = [vd]
 	isapi.install.HandleCommandLine(params)
+
+def create_site():
+	root = 'C:\\inetpub\\adams row tracker'
+	os.makedirs(root)
+	script = os.path.join(root, 'tracker.py')
+	open(script, 'w').write(dedent("""
+		from adamsrow.tracker.isapi import (
+			factory as __ExtensionFactory__,
+			handle_command_line, setup_environment,
+		)
+		setup_environment(__file__)
+		if __name__ == '__main__': handle_command_line()
+		"""))
+	#subprocess.check_call([sys.executable, script, 'install'])
 	setup_requires=[
 		'hgtools',
 	],
+	entry_points = dict(
+		console_scripts = [
+			'adams-row-tracker-create-site = adamsrow.tracker.isapi:create_site',
+		]
+	),
 )
 if __name__ == '__main__':
 	from setuptools import setup