Update create_plugin script a bit

This commit is contained in:
Andrew Resch 2009-06-02 00:57:04 +00:00
parent 1091054b38
commit c4782e91f0
1 changed files with 4 additions and 4 deletions

View File

@ -48,9 +48,9 @@ def create_plugin():
name = options.name.replace(" ", "_") name = options.name.replace(" ", "_")
safe_name = name.lower() safe_name = name.lower()
plugin_base = os.path.realpath(os.path.join(options.path, name)) plugin_base = os.path.realpath(os.path.join(options.path, safe_name))
src = os.path.join(plugin_base, safe_name) src = os.path.join(plugin_base, safe_name)
template_dir = os.path.join(src,"template") template_dir = os.path.join(src, "template")
if os.path.exists(plugin_base): if os.path.exists(plugin_base):
print "the directory %s already exists, delete it first" % plugin_base print "the directory %s already exists, delete it first" % plugin_base
@ -77,7 +77,7 @@ def create_plugin():
print "creating folders.." print "creating folders.."
os.mkdir(plugin_base) os.mkdir(plugin_base)
os.mkdir(src) os.mkdir(src)
os.mkdir(os.path.join(src,"data")) os.mkdir(os.path.join(src, "data"))
os.mkdir(template_dir) os.mkdir(template_dir)
print "creating files.." print "creating files.."
@ -195,7 +195,7 @@ setup(
COMMON = """ COMMON = """
def get_resource(filename): def get_resource(filename):
import pkg_resources, os import pkg_resources, os
return pkg_resources.resource_filename("extractor", os.path.join("data", filename)) return pkg_resources.resource_filename("%(safe_name)s", os.path.join("data", filename))
""" """
GTKUI = """ GTKUI = """