Commit db5303dc authored by Michal Kreps's avatar Michal Kreps
Browse files

Merge branch 'kreps/getCuts' into 'master'

Use gitlab API to obtain list of cuts from repository

See merge request !444
parents 625ff8c3 5627c4df
Pipeline #1512408 passed with stages
in 2 minutes and 24 seconds
......@@ -147,11 +147,7 @@ for line in file:
if tmp:
cuts = tmp
order += ["cuts"]
test_cuts = ["DiLeptonInAcceptance",
"None",
"DaughtersInLHCb",
"ListOfDaughtersInLHCb",
"DaughtersInLHCbAndMinP"]
test_cuts = [ "None" ]
if settings.use_url:
test_cuts = grabnos.grabcuts()
test_cuts += ["None"]
......
......@@ -3,6 +3,7 @@
from __future__ import print_function
import sys
import json
import urllib
if sys.version_info[0] > 2:
import urllib.request
......@@ -87,18 +88,13 @@ def grabcuts():
else:
handle = urllib.request.urlopen(settings.cuts_url)
sourcecode = handle.read().decode()
for line in sourcecode.split('\n'):
if ".cpp" in line and "span" in line:
line = line.partition("<span>")[2]
line = line.partition("<")[0]
line = line.partition(".cpp")[0]
cuts+=[line.strip()]
for cut in cuts:
if is_number(cut):
cuts.remove(cut)
revs+=[cut]
result = json.loads(sourcecode)
for line in result:
if '.cpp' in line['name']:
cutName = line['name'].split('.')[0]
cuts.append(cutName)
return cuts
def grabIdToName():
......
......@@ -11,8 +11,8 @@ partdictpath = os.path.dirname(os.path.abspath(sys.argv[0]))+"/particle_diction
use_url = True
dec_url = "http://lhcbdoc.web.cern.ch/lhcbdoc/decfiles/"
obs_url = "https://gitlab.cern.ch/lhcb-datapkg/Gen/DecFiles/raw/master/doc/table_obsolete.sql"
cuts_url = "https://gitlab.cern.ch/lhcb/Gauss/tree/Sim09/Gen/GenCuts/src"
#cuts_url = "https://svnweb.cern.ch/trac/lhcb/browser/Gauss/trunk/Gen/GenCuts/src"
#cuts_url = "https://gitlab.cern.ch/lhcb/Gauss/tree/Sim09/Gen/GenCuts/src"
cuts_url = 'https://gitlab.cern.ch/api/v4/projects/2606/repository/tree?path=Gen%2FGenCuts%2Fsrc&ref=Sim09&per_page=500'
#table_url= "http://svn.cern.ch/guest/evtgen/tags/R01-01-00/evt.pdl"
table_url= "http://www2.warwick.ac.uk/fac/sci/physics/staff/academic/kreps/tmp/evt.pdl"
......
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