builtin: crlf -> lf (#50505)
This commit is contained in:
parent
9738f1c026
commit
b8c31b22a5
@ -1,47 +1,47 @@
|
||||
import re
|
||||
import urllib.request
|
||||
from html.parser import HTMLParser
|
||||
|
||||
|
||||
class my_html_parser(HTMLParser):
|
||||
def error(self, message):
|
||||
pass
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.state = 0
|
||||
self.processes = []
|
||||
|
||||
def handle_starttag(self, tag, attrs):
|
||||
if tag == "tr" and self.state == 2:
|
||||
for att in attrs:
|
||||
if att[0] == "id":
|
||||
return
|
||||
self.state = 3
|
||||
if tag == "td" and self.state == 3:
|
||||
self.state = 4
|
||||
pass
|
||||
|
||||
def handle_endtag(self, tag):
|
||||
if tag == "table" and self.state == 1:
|
||||
self.state = 2
|
||||
pass
|
||||
|
||||
def handle_data(self, data):
|
||||
# print("Encountered some data :", data)
|
||||
if data == "Categories" and self.state == 0:
|
||||
self.state = 1
|
||||
|
||||
if self.state == 4:
|
||||
if re.findall("[^a-z0-9_]", data):
|
||||
return
|
||||
self.processes.append(data)
|
||||
self.state = 2
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
url = "https://openloops.hepforge.org/process_library.php?repo=public"
|
||||
data = urllib.request.urlopen(url).read()
|
||||
parser = my_html_parser()
|
||||
parser.feed(data.decode("UTF8"))
|
||||
print(parser.processes)
|
||||
import re
|
||||
import urllib.request
|
||||
from html.parser import HTMLParser
|
||||
|
||||
|
||||
class my_html_parser(HTMLParser):
|
||||
def error(self, message):
|
||||
pass
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.state = 0
|
||||
self.processes = []
|
||||
|
||||
def handle_starttag(self, tag, attrs):
|
||||
if tag == "tr" and self.state == 2:
|
||||
for att in attrs:
|
||||
if att[0] == "id":
|
||||
return
|
||||
self.state = 3
|
||||
if tag == "td" and self.state == 3:
|
||||
self.state = 4
|
||||
pass
|
||||
|
||||
def handle_endtag(self, tag):
|
||||
if tag == "table" and self.state == 1:
|
||||
self.state = 2
|
||||
pass
|
||||
|
||||
def handle_data(self, data):
|
||||
# print("Encountered some data :", data)
|
||||
if data == "Categories" and self.state == 0:
|
||||
self.state = 1
|
||||
|
||||
if self.state == 4:
|
||||
if re.findall("[^a-z0-9_]", data):
|
||||
return
|
||||
self.processes.append(data)
|
||||
self.state = 2
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
url = "https://openloops.hepforge.org/process_library.php?repo=public"
|
||||
data = urllib.request.urlopen(url).read()
|
||||
parser = my_html_parser()
|
||||
parser.feed(data.decode("UTF8"))
|
||||
print(parser.processes)
|
||||
|
@ -1,25 +1,25 @@
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class PyCairosvg(PythonPackage):
|
||||
"""
|
||||
CairoSVG is an SVG converter based on Cairo.
|
||||
It can export SVG files to PDF, EPS, PS, and PNG files.
|
||||
"""
|
||||
|
||||
homepage = "https://cairosvg.org/"
|
||||
pypi = "CairoSVG/CairoSVG-2.7.1.tar.gz"
|
||||
|
||||
version("2.7.1", sha256="432531d72347291b9a9ebfb6777026b607563fd8719c46ee742db0aef7271ba0")
|
||||
|
||||
depends_on("python@3.5:", type=("build", "run"))
|
||||
depends_on("py-setuptools", type="build")
|
||||
depends_on("py-cairocffi", type=("build", "run"))
|
||||
depends_on("py-cssselect2", type=("build", "run"))
|
||||
depends_on("py-defusedxml", type=("build", "run"))
|
||||
depends_on("py-pillow", type=("build", "run"))
|
||||
depends_on("py-tinycss2", type=("build", "run"))
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class PyCairosvg(PythonPackage):
|
||||
"""
|
||||
CairoSVG is an SVG converter based on Cairo.
|
||||
It can export SVG files to PDF, EPS, PS, and PNG files.
|
||||
"""
|
||||
|
||||
homepage = "https://cairosvg.org/"
|
||||
pypi = "CairoSVG/CairoSVG-2.7.1.tar.gz"
|
||||
|
||||
version("2.7.1", sha256="432531d72347291b9a9ebfb6777026b607563fd8719c46ee742db0aef7271ba0")
|
||||
|
||||
depends_on("python@3.5:", type=("build", "run"))
|
||||
depends_on("py-setuptools", type="build")
|
||||
depends_on("py-cairocffi", type=("build", "run"))
|
||||
depends_on("py-cssselect2", type=("build", "run"))
|
||||
depends_on("py-defusedxml", type=("build", "run"))
|
||||
depends_on("py-pillow", type=("build", "run"))
|
||||
depends_on("py-tinycss2", type=("build", "run"))
|
||||
|
@ -1,22 +1,22 @@
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class PyCssselect2(PythonPackage):
|
||||
"""
|
||||
cssselect2 is a straightforward implementation of CSS4 Selectors for markup
|
||||
documents (HTML, XML, etc.) that can be read by ElementTree-like parsers
|
||||
(including cElementTree, lxml, html5lib, etc.)
|
||||
"""
|
||||
|
||||
homepage = "https://github.com/Kozea/cssselect2"
|
||||
pypi = "cssselect2/cssselect2-0.7.0.tar.gz"
|
||||
|
||||
version("0.7.0", sha256="1ccd984dab89fc68955043aca4e1b03e0cf29cad9880f6e28e3ba7a74b14aa5a")
|
||||
depends_on("python@3.7:", type=("build", "run"))
|
||||
depends_on("py-flit-core@3.2:3", type="build")
|
||||
depends_on("py-tinycss2", type=("build", "run"))
|
||||
depends_on("py-webencodings", type=("build", "run"))
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class PyCssselect2(PythonPackage):
|
||||
"""
|
||||
cssselect2 is a straightforward implementation of CSS4 Selectors for markup
|
||||
documents (HTML, XML, etc.) that can be read by ElementTree-like parsers
|
||||
(including cElementTree, lxml, html5lib, etc.)
|
||||
"""
|
||||
|
||||
homepage = "https://github.com/Kozea/cssselect2"
|
||||
pypi = "cssselect2/cssselect2-0.7.0.tar.gz"
|
||||
|
||||
version("0.7.0", sha256="1ccd984dab89fc68955043aca4e1b03e0cf29cad9880f6e28e3ba7a74b14aa5a")
|
||||
depends_on("python@3.7:", type=("build", "run"))
|
||||
depends_on("py-flit-core@3.2:3", type="build")
|
||||
depends_on("py-tinycss2", type=("build", "run"))
|
||||
depends_on("py-webencodings", type=("build", "run"))
|
||||
|
@ -1,17 +1,17 @@
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class PyNarwhals(PythonPackage):
|
||||
"""Extremely lightweight compatibility layer between dataframe libraries"""
|
||||
|
||||
homepage = "https://github.com/narwhals-dev/narwhals"
|
||||
pypi = "narwhals/narwhals-1.8.1.tar.gz"
|
||||
|
||||
version("1.8.1", sha256="97527778e11f39a1e5e2113b8fbb9ead788be41c0337f21852e684e378f583e8")
|
||||
|
||||
depends_on("python@3.8:", type=("build", "run"))
|
||||
depends_on("py-hatchling", type=("build"))
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class PyNarwhals(PythonPackage):
|
||||
"""Extremely lightweight compatibility layer between dataframe libraries"""
|
||||
|
||||
homepage = "https://github.com/narwhals-dev/narwhals"
|
||||
pypi = "narwhals/narwhals-1.8.1.tar.gz"
|
||||
|
||||
version("1.8.1", sha256="97527778e11f39a1e5e2113b8fbb9ead788be41c0337f21852e684e378f583e8")
|
||||
|
||||
depends_on("python@3.8:", type=("build", "run"))
|
||||
depends_on("py-hatchling", type=("build"))
|
||||
|
@ -1,33 +1,33 @@
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class PyVlConvertPython(PythonPackage):
|
||||
"""Convert Vega-Lite chart specifications to SVG, PNG, PDF, or Vega"""
|
||||
|
||||
homepage = "https://github.com/vega/vl-convert"
|
||||
pypi = "vl_convert_python/vl_convert_python-1.4.0.tar.gz"
|
||||
|
||||
version("1.4.0", sha256="264d6f2338c7d3474e60c6907cca016b880b0c1c9be302bb84abc6690188a7e9")
|
||||
|
||||
version(
|
||||
"1.3.0",
|
||||
sha256="de1462151dfbba7b2a17881dac1d2269662012c252f1e9d1537a4daed5e36067",
|
||||
deprecated=True,
|
||||
)
|
||||
version(
|
||||
"0.13.1",
|
||||
sha256="d70a608257dd6b5b782d96cccebfe7289992e522e47a8bebb7d928253ca8b396",
|
||||
deprecated=True,
|
||||
)
|
||||
|
||||
depends_on("python@3.7:", type=("build", "run"))
|
||||
|
||||
# TODO: This package currently requires internet access to install.
|
||||
depends_on("py-maturin@1.1:1", type="build")
|
||||
|
||||
depends_on("cmake", type="build") # some rust dependencies need this
|
||||
depends_on("protobuf", type="build") # rust dependency prost need this
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class PyVlConvertPython(PythonPackage):
|
||||
"""Convert Vega-Lite chart specifications to SVG, PNG, PDF, or Vega"""
|
||||
|
||||
homepage = "https://github.com/vega/vl-convert"
|
||||
pypi = "vl_convert_python/vl_convert_python-1.4.0.tar.gz"
|
||||
|
||||
version("1.4.0", sha256="264d6f2338c7d3474e60c6907cca016b880b0c1c9be302bb84abc6690188a7e9")
|
||||
|
||||
version(
|
||||
"1.3.0",
|
||||
sha256="de1462151dfbba7b2a17881dac1d2269662012c252f1e9d1537a4daed5e36067",
|
||||
deprecated=True,
|
||||
)
|
||||
version(
|
||||
"0.13.1",
|
||||
sha256="d70a608257dd6b5b782d96cccebfe7289992e522e47a8bebb7d928253ca8b396",
|
||||
deprecated=True,
|
||||
)
|
||||
|
||||
depends_on("python@3.7:", type=("build", "run"))
|
||||
|
||||
# TODO: This package currently requires internet access to install.
|
||||
depends_on("py-maturin@1.1:1", type="build")
|
||||
|
||||
depends_on("cmake", type="build") # some rust dependencies need this
|
||||
depends_on("protobuf", type="build") # rust dependency prost need this
|
||||
|
Loading…
Reference in New Issue
Block a user