Skip to content
Browse files

Merge "Allow setup.py bdist to complete happily."

  • Loading branch information...
2 parents 8d9633d + 1de3b24 commit 4210177f939f3ab99eb9247dff216b87930c20ca Jenkins committed with openstack-gerrit May 22, 2012
View
0 horizon/conf/dash_template/dashboard.py → horizon/conf/dash_template/dashboard.py.tmpl
File renamed without changes.
View
0 horizon/conf/panel_template/panel.py → horizon/conf/panel_template/panel.py.tmpl
File renamed without changes.
View
0 horizon/conf/panel_template/tests.py → horizon/conf/panel_template/tests.py.tmpl
File renamed without changes.
View
12 horizon/management/commands/startdash.py
@@ -1,3 +1,4 @@
+import glob
from optparse import make_option
import os
@@ -34,7 +35,7 @@ def handle(self, dash_name=None, **options):
options["template"] = self.template
# We have html templates as well, so make sure those are included.
- options["extensions"].extend(["html", "js", "css"])
+ options["extensions"].extend(["tmpl", "html", "js", "css"])
# Check that the app_name cannot be imported.
try:
@@ -47,3 +48,12 @@ def handle(self, dash_name=None, **options):
"name. Please try another name." % dash_name)
super(Command, self).handle('dash', dash_name, **options)
+
+ target = options.pop("target", None)
+ if not target:
+ target = os.path.join(os.curdir, dash_name)
+
+ # Rename our python template files.
+ file_names = glob.glob(os.path.join(target, "*.py.tmpl"))
+ for filename in file_names:
+ os.rename(filename, filename[:-5])
View
11 horizon/management/commands/startpanel.py
@@ -1,3 +1,4 @@
+import glob
from optparse import make_option
import os
@@ -74,7 +75,7 @@ def handle(self, panel_name=None, **options):
options["template"] = self.template
# We have html templates as well, so make sure those are included.
- options["extensions"].extend(["html"])
+ options["extensions"].extend(["tmpl", "html"])
# Check that the app_name cannot be imported.
try:
@@ -87,3 +88,11 @@ def handle(self, panel_name=None, **options):
"name. Please try another name." % panel_name)
super(Command, self).handle('panel', panel_name, target, **options)
+
+ if not target:
+ target = os.path.join(os.curdir, panel_name)
+
+ # Rename our python template files.
+ file_names = glob.glob(os.path.join(target, "*.py.tmpl"))
+ for filename in file_names:
+ os.rename(filename, filename[:-5])

0 comments on commit 4210177

Please sign in to comment.
Something went wrong with that request. Please try again.