diff options
author | Ian Weller <ianweller@gmail.com> | 2008-11-02 12:23:08 -0600 |
---|---|---|
committer | Ian Weller <ianweller@gmail.com> | 2008-11-02 12:23:08 -0600 |
commit | 6a3752bf45daead85162f4b1469f8de1747f7ae2 (patch) | |
tree | 2a6d2e410eaa9879dca8498938e2d010d9d58090 | |
parent | 98996b1b1c43958220ba00ba9314b0a764641a14 (diff) | |
download | fedora-business-cards-6a3752bf45daead85162f4b1469f8de1747f7ae2.tar.gz fedora-business-cards-6a3752bf45daead85162f4b1469f8de1747f7ae2.tar.xz fedora-business-cards-6a3752bf45daead85162f4b1469f8de1747f7ae2.zip |
Change install_templates to install_data
-rw-r--r-- | config.ini | 1 | ||||
-rw-r--r-- | pavement.py | 17 |
2 files changed, 14 insertions, 4 deletions
@@ -1,3 +1,4 @@ [location] ; this can be relative to the directory with the fedora-business-cards executable in it templates = templates +ui = ui diff --git a/pavement.py b/pavement.py index 1eb9706..a790396 100644 --- a/pavement.py +++ b/pavement.py @@ -14,8 +14,9 @@ options( license="GPLv2+", url="https://fedoraproject.org/wiki/Business_cards" ), - install_templates=Bunch( + install_data=Bunch( templates=glob("templates/*"), + ui=glob("ui/*"), data_dir="/usr/share/fedora-business-cards" ), install_executable=Bunch( @@ -27,9 +28,9 @@ options( @task @cmdopts([('root=', None, 'install everything relative to this alternative root' ' directory')]) -def install_templates(): - """install necessary templates for generator""" - options.order("install_templates", add_rest=True) +def install_data(): + """install necessary data for generator""" + options.order("install_data", add_rest=True) try: root_dir = options.root except AttributeError: @@ -38,6 +39,8 @@ def install_templates(): parser.read("config.ini") templates_dir = options.data_dir + "/templates" parser.set("location", "templates", templates_dir) + ui_dir = options.data_dir + "/ui" + parser.set("location", "ui", ui_dir) data_dir = paver.path.path(root_dir + options.data_dir) if not os.path.exists(data_dir): data_dir.makedirs(0755) @@ -49,6 +52,12 @@ def install_templates(): templates_dir.makedirs(0755) command = "install -cpm 644 %s %s" % (template_file, templates_dir) dry(command, paver.runtime.sh, [command]) + for ui_file in options.ui: + ui_dir = paver.path.path(root_dir + options.data_dir + "/ui") + if not os.path.exists(ui_dir): + templates_dir.makedirs(0755) + command = "install -cpm 644 %s %s" % (ui_file, ui_dir) + dry(command, paver.runtime.sh, [command]) @task |