Commit c218bfd9 authored by Antoine Regimbeau's avatar Antoine Regimbeau
Browse files

DEBUG: add trace

No related merge requests found
Showing with 31 additions and 24 deletions
+31 -24
...@@ -24,6 +24,8 @@ import glob ...@@ -24,6 +24,8 @@ import glob
import re import re
import unittest import unittest
trace = True
class Handler: class Handler:
# project # project
# site # site
...@@ -45,7 +47,8 @@ class Handler: ...@@ -45,7 +47,8 @@ class Handler:
build_dir = os.path.normpath(build_dir) build_dir = os.path.normpath(build_dir)
test_path = os.path.join( build_dir , "Testing/") test_path = os.path.join( build_dir , "Testing/")
list_folder = os.listdir(test_path) list_folder = os.listdir(test_path)
# print(list_folder) if trace:
print(list_folder)
configure_xml = "" configure_xml = ""
for folder in list_folder: for folder in list_folder:
if folder == "Temporary" or folder == "TAG": if folder == "Temporary" or folder == "TAG":
...@@ -54,7 +57,8 @@ class Handler: ...@@ -54,7 +57,8 @@ class Handler:
if os.path.exists( configure_xml ): if os.path.exists( configure_xml ):
break break
if os.path.exists( configure_xml ): if os.path.exists( configure_xml ):
print ( configure_xml ) if trace:
print ( configure_xml )
self.configure_path = configure_xml self.configure_path = configure_xml
return True return True
print("Could not find the Configure.xml produced by ctest") print("Could not find the Configure.xml produced by ctest")
...@@ -72,13 +76,14 @@ class Handler: ...@@ -72,13 +76,14 @@ class Handler:
configure_file = open( self.configure_path, "r" ) configure_file = open( self.configure_path, "r" )
content = configure_file.read() content = configure_file.read()
configure_file.close() configure_file.close()
# site_regex = re.compile( "\\bName\\b=\"([0-9,-,_,A-Z,a-z]+)\"")
site_regex = re.compile( "\\bName\\b=\"([0-9,\-,_,A-Z,a-z]+)") site_regex = re.compile( "\\bName\\b=\"([0-9,\-,_,A-Z,a-z]+)")
# print (site_regex)
site = site_regex.search( content ) site = site_regex.search( content )
# print(site) if trace:
print (site_regex)
print(site)
if site: if site:
# print("site value \n" , site.group(1)) if trace:
print("site value \n" , site.group(1))
self.site = site.group(1) self.site = site.group(1)
return True return True
print("Could not retreive site value") print("Could not retreive site value")
...@@ -99,12 +104,13 @@ class Handler: ...@@ -99,12 +104,13 @@ class Handler:
content = configure_file.read() content = configure_file.read()
configure_file.close() configure_file.close()
name_regex = re.compile( "\\bBuildName\\b=\"([0-9,\-,_,A-Z,a-z]+)\"") name_regex = re.compile( "\\bBuildName\\b=\"([0-9,\-,_,A-Z,a-z]+)\"")
# print (name_regex)
# print(content)
name = name_regex.search( content ) name = name_regex.search( content )
# print( name) if trace:
print (name_regex)
print( name)
if name: if name:
# print("name value \n" , name.group(1)) if trace:
print("name value \n" , name.group(1))
self.name = name.group(1) self.name = name.group(1)
return True return True
print("Could not retreive name value") print("Could not retreive name value")
...@@ -122,12 +128,13 @@ class Handler: ...@@ -122,12 +128,13 @@ class Handler:
configure_file = open( self.configure_path, "r" ) configure_file = open( self.configure_path, "r" )
content = configure_file.read() content = configure_file.read()
stamp_regex = re.compile( "\\bBuildStamp\\b=\"([0-9,\-,_,A-Z,a-z]+)\"") stamp_regex = re.compile( "\\bBuildStamp\\b=\"([0-9,\-,_,A-Z,a-z]+)\"")
# print (stamp_regex)
# print(content)
stamp = stamp_regex.search( content ) stamp = stamp_regex.search( content )
# print( stamp) if trace:
print( stamp_regex )
print( stamp )
if stamp: if stamp:
# print("Stamp value \n" , stamp.group(1)) if trace:
print("Stamp value \n" , stamp.group(1))
self.stamp = stamp.group(1) self.stamp = stamp.group(1)
return True return True
print("Could not retreive stamp value") print("Could not retreive stamp value")
...@@ -205,13 +212,13 @@ TODO : ...@@ -205,13 +212,13 @@ TODO :
the script aims only at recovering the build url the script aims only at recovering the build url
""" """
# The script needs the site name and the project name. # The script needs the project name.
# if __name__ == "__main__": if __name__ == "__main__":
# handler = Handler() handler = Handler()
# handler.build_dir = "" handler.build_dir = ""
# handler.GetStamp() handler.GetStamp()
# print (handler.stamp) print (handler.stamp)
# handler.GetSite() handler.GetSite()
# print (handler.site) print (handler.site)
# handler.GetName() handler.GetName()
# print (handler.name) print (handler.name)
\ No newline at end of file \ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment