Skip to content

Commit

Permalink
removed html5print #622 $ #621
Browse files Browse the repository at this point in the history
  • Loading branch information
jtgilbert committed Nov 2, 2022
1 parent 6411da4 commit 2051230
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion bin/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ distlib==0.3.1
docutils==0.15.2
filelock==3.0.12
GDAL>=3.0
html5print==0.1.2
isort==5.4.2
jinja2>=2.11.3
jmespath==0.10.0
Expand Down
2 changes: 1 addition & 1 deletion lib/commons/rscommons/classes/rs_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def create(self, name, project_type, meta: List[RSMeta] = None, meta_dict: Dict[

self.add_metadata([
RSMeta('ModelVersion', self.settings.version),
RSMeta('dateCreated', datetime.datetime.now().isoformat(), RSMetaTypes.ISODATE)
RSMeta('DateCreated', datetime.datetime.now().isoformat(), RSMetaTypes.ISODATE)
])
if meta is not None:
self.add_metadata(meta)
Expand Down
10 changes: 5 additions & 5 deletions lib/commons/rscommons/report/rs_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from uuid import uuid4
from xml.etree import ElementTree as ET
from jinja2 import Template
from html5print import HTMLBeautifier, CSSBeautifier
# from html5print import HTMLBeautifier, CSSBeautifier
from rscommons import Logger
from rscommons.util import sizeof_fmt

Expand Down Expand Up @@ -45,7 +45,7 @@ def write(self):
template = Template(t.read())

now = datetime.datetime.now()
final_render = HTMLBeautifier.beautify(template.render(report={
final_render = template.render(report={
'title': self.xml_project.XMLBuilder.find('Name').text,
'ProjectType': self.xml_project.XMLBuilder.find('ProjectType').text,
'MetaData': self.xml_project.get_metadata_dict(),
Expand All @@ -55,7 +55,7 @@ def write(self):
'toc': toc,
'body': html_inner,
'footer': self.footer
}))
})
with open(self.filepath, "w", encoding="utf-8") as f:
f.write(final_render)

Expand All @@ -64,8 +64,8 @@ def write(self):
def add_css(self, filepath):
with open(filepath) as css_file:
css = css_file.read()
beautiful = CSSBeautifier.beautify(css)
self.css_files.append(beautiful)
# beautiful = CSSBeautifier.beautify(css)
self.css_files.append(css)

def section(self, sectionid, title, el_parent=None, level=1, attrib=None):
if attrib is None:
Expand Down
2 changes: 1 addition & 1 deletion lib/commons/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'geojson', 'sciencebasepy', 'requests', 'semver>=2.10.2',
'termcolor', 'Cython==0.29.23', 'numpy>=1.21.0', 'scipy>=1.5.1',
'argparse', 'GDAL>=3.0', 'rasterio>=1.1.5', 'Shapely==1.8.2',
'jinja2>=2.11.3', 'html5print==0.1.2', 'psutil==5.8.0'
'jinja2>=2.11.3', 'psutil==5.8.0'
]

with open("README.md", "rb") as f:
Expand Down
8 changes: 4 additions & 4 deletions packages/rscontext/rscontext/rs_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ def rs_context(huc, landfire_dir, ownership, fair_market, ecoregions, us_states,
lyr_obj = RSLayer(name, name, 'Vector', os.path.relpath(file_path, output_folder))
ntd_node, _fpath = project.add_project_vector(datasets, lyr_obj)
project.add_metadata([RSMeta('Description', 'The USGS Transportation downloadable data from The National Map (TNM) is based on TIGER/Line data provided through U.S. Census Bureau and supplemented with HERE road data to create tile cache base maps. Some of the TIGER/Line data includes limited corrections done by USGS. Transportation data consists of roads, railroads, trails, airports, and other features associated with the transport of people or commerce. The data is downloaded from science base by state then clipped to the project extent.'),
RSMeta('DocsUrl', f'https://tools.riverscapes.net/data/html#{name}', RSMetaTypes.URL),
RSMeta('SourceUrl', 'https://data.usgs.gov/datacatalog/data/USGS:ad3d631d-f51f-4b6a-91a3-e617d6a58b4e', RSMetaTypes.URL),
RSMeta('ProductVersion', '2020')], ntd_node)
RSMeta('DataProductVersion', '2020'),
RSMeta('DocsUrl', f'https://tools.riverscapes.net/data/html#{name}', RSMetaTypes.URL), ], ntd_node)
project.add_metadata([RSMeta(k, v, RSMetaTypes.URL, RSMetaExt.DATASET) for k, v in ntd_urls.items()], ntd_node)

# download contributing DEM rasters, mosaic and reproject into compressed GeoTIF
Expand Down Expand Up @@ -442,14 +442,14 @@ def augment_layermeta():
sublyr.lyr_meta = [
RSMeta('Description', json_data[h][0]),
RSMeta('SourceUrl', json_data[h][1], RSMetaTypes.URL),
RSMeta('ProductVersion', json_data[h][2]),
RSMeta('DataProductVersion', json_data[h][2]),
RSMeta('DocsUrl', 'https://tools.riverscapes.net/rscontext/data.html#{}'.format(sublyr.id), RSMetaTypes.URL)
]
if k in json_data and len(json_data[k]) > 0:
lyr.lyr_meta = [
RSMeta('Description', json_data[k][0]),
RSMeta('SourceUrl', json_data[k][1], RSMetaTypes.URL),
RSMeta('ProductVersion', json_data[k][2]),
RSMeta('DataProductVersion', json_data[k][2]),
RSMeta('DocsUrl', 'https://tools.riverscapes.net/rscontext/data.html#{}'.format(lyr.id), RSMetaTypes.URL)
]

Expand Down
2 changes: 1 addition & 1 deletion packages/rscontext/rscontext/rs_context_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, report_path, rs_project, project_root):

def report_intro(self):
section = self.section('LayerSummary', 'Layer Summary')
layers = self.xml_project.XMLBuilder.find('Realizations').find('Realization')
layers = self.xml_project.XMLBuilder.find('Realizations').find('Realization').find('Datasets')

for lyr in layers:
if lyr.tag in ['DEM', 'Raster', 'Vector', 'Geopackage']:
Expand Down

0 comments on commit 2051230

Please sign in to comment.