Skip to content

Commit 33a6659

Browse files
committed
oslcquery now shows the query url using oslc_config.context parameter if you use the -V option - although it still uses the Configuration.Context header when making the query
1 parent 546e17a commit 33a6659

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+17396
-15635
lines changed

.bumpversion.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.26.0
2+
current_version = 0.26.2
33
commit = True
44
tag = True
55

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
SPDX-License-Identifier: MIT
1010

11-
version="0.26.0"
11+
version="0.26.2"
1212

1313
What's New?
1414
===========

elmclient/__meta__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
app = 'elmoslcquery'
1111
description = 'Commandline OSLC query for ELM'
12-
version = '0.26.0'
12+
version = '0.26.2'
1313
license = 'MIT'
1414
author_name = 'Ian Barnard'
1515
author_mail = '[email protected]'

elmclient/oslcqueryapi.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: MIT
44
##
55

6-
6+
import copy
77
import logging
88
import re
99
import time
@@ -338,7 +338,7 @@ def _evaluate_steps(self, querycapabilityuri,querysteps,*,resultstack=None, sele
338338
# raise Exception( f"Very strange parse result! {step}" )
339339
else:
340340
# do an actual query
341-
results = self.execute_oslc_query(querycapabilityuri,whereterms=[step], select=select, prefixes=prefixes, orderbys=orderbys, searchterms=searchterms, show_progress=show_progress, maxresults=maxresults, delaybetweenpages=delaybetweenpages, pagesize=pagesize, verbose=verbose, saverawresults=saverawresults, cacheable=cacheable)
341+
results = self.execute_oslc_query(querycapabilityuri,whereterms=[step], select=select, prefixes=prefixes, orderbys=orderbys, searchterms=searchterms, show_progress=show_progress, maxresults=maxresults, delaybetweenpages=delaybetweenpages, pagesize=pagesize, verbose=verbose, saverawresults=saverawresults, cacheable=cacheable, intent="Perform OSLC Query")
342342
if isinstance(results, list):
343343
resultlist = {}
344344
for result in results:
@@ -580,12 +580,15 @@ def _execute_vanilla_oslc_query(self, querycapabilityuri, query_params, orderby=
580580
params = {}
581581
params.update(query)
582582
logger.info( f"The parameters for this query are {params}" )
583-
584583
fullurl = f"{query_url}?{urllib.parse.urlencode( params, quote_via=urllib.parse.quote, safe='/')}"
585584
if verbose:
586585
print( f"Full query URL is {fullurl}" )
586+
if self.local_config:
587+
params1 = copy.copy( params )
588+
params1['oslc_config.context'] = self.local_config
589+
fullurlparam = f"{query_url}?{urllib.parse.urlencode( params1, quote_via=urllib.parse.quote, safe='/')}"
590+
print( f"FYI the query URL with local configuration is {fullurlparam}" )
587591

588-
# print( f"Full query URL is {fullurl}" )
589592
# retrieve all pages of results - they will be processed later
590593
total = 1
591594
page = 0
@@ -689,7 +692,7 @@ def _execute_vanilla_oslc_query(self, querycapabilityuri, query_params, orderby=
689692
if delaybetweenpages>0.0:
690693
time.sleep(delaybetweenpages)
691694

692-
# suppress the Configuration-Context header because it seems that
695+
# after the first page suppress the Configuration-Context header because it seems that
693696
# when that and param oslc_config.context are provided they both get added
694697
# to each nextpage URL which grows ever longer and eventually breaks
695698
# requests see https://github.com/IBM/ELM-Python-Client/discussions/44#discussioncomment-6151370

elmclient/tests/results/ccm301.html

+1,287-1,293
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)