sdbus++: find templates in datadir
Change-Id: Ib6ffd1ad51774825fe7227fc8ce48447bfd5b1f8
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/tools/sdbus++ b/tools/sdbus++
index 9f7d111..2e4e330 100755
--- a/tools/sdbus++
+++ b/tools/sdbus++
@@ -7,6 +7,8 @@
def main():
+ module_path = os.path.dirname(sdbusplus.__file__)
+
valid_types = {'interface': sdbusplus.Interface}
valid_processes = {'markdown': "markdown",
'server-header': "server_header",
@@ -17,7 +19,7 @@
parser.add_argument('-r', '--rootdir', dest='rootdir', default='example',
type=str, help='Location of files to process.')
parser.add_argument('-t', '--templatedir', dest='templatedir',
- default=os.path.join('sdbusplus', 'templates'),
+ default=os.path.join(module_path, 'templates'),
type=str, help='Location of templates files.')
parser.add_argument('typeName', metavar='TYPE', type=str,
choices=valid_types.keys(), help='Type to operate on.')