Skip to content

Commit

Permalink
Merge "Allow setup.py bdist to complete happily."
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed May 22, 2012
2 parents 8d9633d + 1de3b24 commit 4210177
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 11 additions & 1 deletion horizon/management/commands/startdash.py
@@ -1,3 +1,4 @@
import glob
from optparse import make_option from optparse import make_option
import os import os


Expand Down Expand Up @@ -34,7 +35,7 @@ def handle(self, dash_name=None, **options):
options["template"] = self.template options["template"] = self.template


# We have html templates as well, so make sure those are included. # 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. # Check that the app_name cannot be imported.
try: try:
Expand All @@ -47,3 +48,12 @@ def handle(self, dash_name=None, **options):
"name. Please try another name." % dash_name) "name. Please try another name." % dash_name)


super(Command, self).handle('dash', dash_name, **options) 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])
11 changes: 10 additions & 1 deletion horizon/management/commands/startpanel.py
@@ -1,3 +1,4 @@
import glob
from optparse import make_option from optparse import make_option
import os import os


Expand Down Expand Up @@ -74,7 +75,7 @@ def handle(self, panel_name=None, **options):
options["template"] = self.template options["template"] = self.template


# We have html templates as well, so make sure those are included. # 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. # Check that the app_name cannot be imported.
try: try:
Expand All @@ -87,3 +88,11 @@ def handle(self, panel_name=None, **options):
"name. Please try another name." % panel_name) "name. Please try another name." % panel_name)


super(Command, self).handle('panel', panel_name, target, **options) 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.