From 53b7e46db4ec63e10792a87888172de860673e17 Mon Sep 17 00:00:00 2001 From: Jesse Cirimelli-Low Date: Thu, 3 Jan 2019 12:28:29 -0800 Subject: [PATCH] fixed bug where retrieving git id would fail depending on cwd --- compiler/characterizer/lib.py | 14 ++++++++++++-- .../datasheet/server_scripts/deliverable.py | 19 ------------------- 2 files changed, 12 insertions(+), 21 deletions(-) delete mode 100644 compiler/datasheet/server_scripts/deliverable.py diff --git a/compiler/characterizer/lib.py b/compiler/characterizer/lib.py index 3e97aba1..0ed7b3e6 100644 --- a/compiler/characterizer/lib.py +++ b/compiler/characterizer/lib.py @@ -510,9 +510,19 @@ class lib: git_id = 'AAAAAAAAAAAAAAAAAAAA' else: with open(os.devnull, 'wb') as devnull: - proc = subprocess.Popen(['git','rev-parse','HEAD'], stdout=subprocess.PIPE) + print(os.path.abspath(os.environ.get("OPENRAM_HOME")) + '/') + proc = subprocess.Popen(['git','rev-parse','HEAD'], cwd=os.path.abspath(os.environ.get("OPENRAM_HOME")) + '/', stdout=subprocess.PIPE) + git_id = str(proc.stdout.read()) - git_id = git_id[2:-3] + + try: + git_id = git_id[2:-3] + except: + pass + + if len(git_id) != 40: + debug.warning("Failed to retrieve git id") + git_id = 'Failed to retruieve' datasheet = open(OPTS.openram_temp +'/datasheet.info', 'a+') diff --git a/compiler/datasheet/server_scripts/deliverable.py b/compiler/datasheet/server_scripts/deliverable.py deleted file mode 100644 index 9ba3c0e6..00000000 --- a/compiler/datasheet/server_scripts/deliverable.py +++ /dev/null @@ -1,19 +0,0 @@ -from flask_table import * - -class deliverables(Table): - """ - Set up delivarables table columns and title information - """ - typ = Col('Type') - description = Col('Description') - link = Col('Link') - - -class deliverables_item(object): - """ - Define deliverables table row elemenent information - """ - def __init__(self, typ, description,link): - self.typ = typ - self.description = description - self.link = link