-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFindStream.py
More file actions
43 lines (38 loc) · 1.85 KB
/
Copy pathFindStream.py
File metadata and controls
43 lines (38 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#--------------------------------------------------------------------------------------
#
# $Source: CommonTasks/FindStream.py $
#
# $Copyright: (c) 2017 Bentley Systems, Incorporated. All rights reserved. $
#
#--------------------------------------------------------------------------------------
import os, sys
import xml.etree.ElementTree as ET
#-------------------------------------------------------------------------------------------
# bsimethod Majd.Uddin 10/2017
#-------------------------------------------------------------------------------------------
def GetStreamName():
TREE_CONFIG_PATH = os.path.join(os.getenv('SrcRoot'), 'teamConfig', 'treeConfiguration.xml')
Stream = FindStreamDetails(TREE_CONFIG_PATH)
return Stream
#-------------------------------------------------------------------------------------------
# bsimethod Ridha.Malik 08/2017
#-------------------------------------------------------------------------------------------
def FindStreamDetails(TREE_CONFIG_PATH):
Buildconfig=""
Stream=""
tree = ET.parse(TREE_CONFIG_PATH)
root = tree.getroot()
for child in root.iter('Stream'):
Stream=child.attrib
Stream=Stream['Name']
return Stream
#-------------------------------------------------------------------------------------------
# bsimethod Ridha.Malik 08/2017
#-------------------------------------------------------------------------------------------
if __name__ == '__main__':
srcpath=sys.argv[1]
RELATIVE_TREE_CONFIG_PATH = 'teamConfig' + os.sep + 'treeConfiguration.xml'
TREE_CONFIG_PATH = os.path.join(srcpath,RELATIVE_TREE_CONFIG_PATH)
Stream=FindStreamDetails(TREE_CONFIG_PATH)
print Stream
exit(0)