Skip to content

Commit 2f28b71

Browse files
committed
add moveit version number to bags
1 parent 76a9f20 commit 2f28b71

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
build
2+
moveit.spec
13
.DS_Store
24
gui/node_modules
35
gui/package-lock.json
4-
gui/install
6+
gui/install

moveit.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from distutils.dir_util import copy_tree
1111
import tempfile
1212
import zerorpc
13+
import json
1314

1415
class MoveIt(object):
1516
def bag_package(self, contactname, jobtitle, department, email, phone, creator, rrsda, title, datefrom, dateto, description, metadata, package_folder):
@@ -20,10 +21,17 @@ def bag_package(self, contactname, jobtitle, department, email, phone, creator,
2021
os.makedirs(bag_dir)
2122
copy_tree(os.path.normpath(package_folder.strip('"')), bag_dir)
2223

24+
try:
25+
with open("package.json", "r") as package_json:
26+
version = json.load(package_json)['version']
27+
except:
28+
with open("gui/package.json", "r") as package_json:
29+
version = json.load(package_json)['version']
30+
2331
try:
2432
bag = bagit.make_bag(bag_dir, None, 1, ['sha256'])
2533
bag.info['Package-Time'] = strftime("%Y-%m-%d %H:%M:%S")
26-
bag.info['Bag-Software-Agent'] = "SFU MoveIt"
34+
bag.info['Bag-Software-Agent'] = "MoveIt " + version
2735
bag.info['Contact-Name'] = contactname
2836
bag.info['Contact-Title'] = jobtitle
2937
bag.info['Contact-Organization'] = department

0 commit comments

Comments
 (0)