Skip to content

Commit

Permalink
See CHANGELOG tag-1.0-20210105
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnavarro committed Jan 5, 2021
1 parent d1bd28a commit ea30f55
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
tag-1.0-20210105 JP
- Format Description additions as lists

tag-1.0-20201223 JP
- Generate full Description and no ShortDescription
- Implement Description construction and html rendering class
Expand Down
42 changes: 25 additions & 17 deletions bin/route_resource_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def append(self, value):
self.value = clean_value
else:
self.value += '\n{}'.format(clean_value)
def html(self, ID=None):
def blank_line(self): # Forced blank line used to start a markup list
self.value += '\n'
def html(self, ID=None): # If an ID is provided, log it to record what resource had the warnings
if self.value is None:
return(None)
output = formatter(self.value, filter_name='restructuredtext', settings_overrides=self.markup_settings)
Expand Down Expand Up @@ -203,7 +205,7 @@ def Setup(self, peak_sleep=10, offpeak_sleep=60, max_stale=24 * 60):

# Connect Elasticsearch
if 'ELASTIC_HOSTS' in self.config:
self.logger.info('Warehouse elastichost={}'.format(self.config['ELASTIC_HOSTS']))
self.logger.critical('Warehouse elastichost={}'.format(self.config['ELASTIC_HOSTS']))
self.ESEARCH = elasticsearch_dsl.connections.create_connection( \
hosts = self.config['ELASTIC_HOSTS'], \
connection_class = RequestsHttpConnection, \
Expand Down Expand Up @@ -570,9 +572,10 @@ def Write_RSP_Support_Providers(self, content, contype, config):
try:
ShortDescription = None
Description = Format_Description(item.get('Description'))
Description.blank_line()
for c in ['ContactURL', 'ContactEmail', 'ContactPhone']:
if c in item and item[c] is not None and item[c] is not '':
Description.append(' {} is {}'.format(c, item[c]))
Description.append('- {} is {}'.format(c, item[c]))
# if not bool(BeautifulSoup(Description, "html.parser").find()): # Test for pre-existing HTML
resource = ResourceV3(
ID = myGLOBALURN,
Expand Down Expand Up @@ -821,10 +824,11 @@ def Write_RSP_Vendor_Software(self, content, contype, config):
try:
ShortDescription = None
Description = Format_Description(item.get('Description'))
Description.blank_line()
if item.get('VendorSoftwareURL'):
Description.append('Vendor Software URL: ' + item.get('VendorSoftwareURL'))
Description.append('- Vendor Software URL: ' + item.get('VendorSoftwareURL'))
if item.get('RelatedDiscussionForums'):
Description.append('Related Discussion Forum: ' + item.get('RelatedDiscussionForums'))
Description.append('- Related Discussion Forum: ' + item.get('RelatedDiscussionForums'))
# if not bool(BeautifulSoup(Description, "html.parser").find()): # Test for pre-existing HTML
resource = ResourceV3(
ID = myGLOBALURN,
Expand Down Expand Up @@ -925,14 +929,15 @@ def Write_RSP_Network_Service(self, content, contype, config):
try:
ShortDescription = None
Description = Format_Description(item.get('Description') or item.get('Title') or None)
Description.blank_line()
if item.get('NetworkServiceEndpoints'):
Description.append('Service Access URL: {}'.format(item.get('NetworkServiceEndpoints')))
Description.append('- Service Access URL: {}'.format(item.get('NetworkServiceEndpoints')))
if item.get('UserDocumentationURL'):
Description.append('Service Documentation: {}'.format(item.get('UserDocumentationURL')))
Description.append('- Service Documentation: {}'.format(item.get('UserDocumentationURL')))
if item.get('VendorSoftwareURL') and item.get('NetworkServiceEndpoints') and item.get('VendorSoftwareURL') != item.get('NetworkServiceEndpoints'):
Description.append('Vendor Software URL: {}'.format(item.get('VendorSoftwareURL')))
Description.append('- Vendor Software URL: {}'.format(item.get('VendorSoftwareURL')))
if item.get('VendorURL') and item.get('VendorSoftwareURL') and item.get('VendorURL') != item.get('VendorSoftwareURL'):
Description.append('Vendor URL: {}'.format(item.get('VendorURL')))
Description.append('- Vendor URL: {}'.format(item.get('VendorURL')))
# if not bool(BeautifulSoup(Description, "html.parser").find()): # Test for pre-existing HTML
resource = ResourceV3(
ID = myGLOBALURN,
Expand Down Expand Up @@ -1049,10 +1054,11 @@ def Write_Glue2_Network_Service(self, content, contype, config):

try:
ShortDescription = None
Description.blank_line()
if item.get('URL'):
Description.append('Service URL: {}'.format(item.get('URL')))
Description.append('- Service URL: {}'.format(item.get('URL')))
try:
Description.append('Running on {} ({})'.format(self.HPCRESOURCE_INFO[item['ResourceID']]['Name'], item['ResourceID']))
Description.append('- Running on {} ({})'.format(self.HPCRESOURCE_INFO[item['ResourceID']]['Name'], item['ResourceID']))
except:
pass
# if not bool(BeautifulSoup(Description, "html.parser").find()): # Test for pre-existing HTML
Expand Down Expand Up @@ -1151,14 +1157,15 @@ def Write_RSP_Executable_Software(self, content, contype, config):
try:
ShortDescription = (item.get('VendorCommonName') or item.get('Title') or '').strip()
Description = Format_Description(item.get('Description'))
Description.blank_line()
if item.get('NetworkServiceEndpoints'):
Description.append('Service URL: {}'.format(item.get('NetworkServiceEndpoints')))
Description.append('- Service URL: {}'.format(item.get('NetworkServiceEndpoints')))
if item.get('UserDocumentationURL'):
Description.append('Service Documentation: {}'.format(item.get('UserDocumentationURL')))
Description.append('- Service Documentation: {}'.format(item.get('UserDocumentationURL')))
if item.get('VendorSoftwareURL','') != item.get('NetworkServiceEndpoints', ''):
Description.append('Vendor Product URL: {}'.format(item.get('VendorSoftwareURL')))
Description.append('- Vendor Product URL: {}'.format(item.get('VendorSoftwareURL')))
if item.get('VendorURL','') != item.get('VendorSoftwareURL', ''):
Description.append('Vendor URL: {}'.format(item.get('VendorURL')))
Description.append('- Vendor URL: {}'.format(item.get('VendorURL')))
# if not bool(BeautifulSoup(Description, "html.parser").find()): # Test for pre-existing HTML
resource = ResourceV3(
ID = myGLOBALURN,
Expand Down Expand Up @@ -1368,12 +1375,13 @@ def Write_RSP_Packaged_Software(self, content, contype, config):
if TargetAudience:
Description.append('For target audience: {}'.format(TargetAudience))
PackageURL = item.get('PackageURL')
Description.blank_line()
if PackageURL:
PackageFormat = '({})'.format(item.get('PackageFormat')) if item.get('PackageFormat') else ''
Description.append('Package {} URL: {}'.format(PackageFormat, PackageURL))
Description.append('- Package {} URL: {}'.format(PackageFormat, PackageURL))
ProvisioningInstructionsURL = item.get('ProvisioningInstructionsURL')
if ProvisioningInstructionsURL:
Description.append('Installation Instructions: {}'.format(ProvisioningInstructionsURL))
Description.append('- Installation Instructions: {}'.format(ProvisioningInstructionsURL))
# if not bool(BeautifulSoup(Description, "html.parser").find()): # Test for pre-existing HTML
resource = ResourceV3(
ID = myGLOBALURN,
Expand Down

0 comments on commit ea30f55

Please sign in to comment.