Allow setup.py bdist to complete happily.

Fixes bug 1002551.

Change-Id: Ied984f020a6ae97375824fbc1297739db032ed0b
This commit is contained in:
Gabriel Hurley 2012-05-21 15:42:26 -07:00
parent 908997c67c
commit 1de3b24ed9
5 changed files with 21 additions and 2 deletions

View File

@ -1,3 +1,4 @@
import glob
from optparse import make_option
import os
@ -34,7 +35,7 @@ class Command(TemplateCommand):
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 @@ class Command(TemplateCommand):
"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 File

@ -1,3 +1,4 @@
import glob
from optparse import make_option
import os
@ -74,7 +75,7 @@ class Command(TemplateCommand):
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 @@ class Command(TemplateCommand):
"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])