From ec69b444152def40f197b92e27f7f0c6b247e279 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 12 Apr 2023 02:55:50 +0000 Subject: automatic import of python-htmllistparse --- .gitignore | 1 + python-htmllistparse.spec | 117 ++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 119 insertions(+) create mode 100644 python-htmllistparse.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..478ca3d 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/htmllistparse-0.6.0.tar.gz diff --git a/python-htmllistparse.spec b/python-htmllistparse.spec new file mode 100644 index 0000000..e25975b --- /dev/null +++ b/python-htmllistparse.spec @@ -0,0 +1,117 @@ +%global _empty_manifest_terminate_build 0 +Name: python-htmllistparse +Version: 0.6.0 +Release: 1 +Summary: Python parser for Apache/nginx-style HTML directory listing. +License: MIT +URL: https://github.com/gumblex/htmllisting-parser +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/89/8a/5a19ad816836eb5163401a21d2ae3cc1435df01f7d181dba3a4804c992f0/htmllistparse-0.6.0.tar.gz +BuildArch: noarch + + +%description +Python parser for Apache/nginx-style HTML directory listing + import htmllistparse + cwd, listing = htmllistparse.fetch_listing(some_url, timeout=30) + # or you can get the url and make a BeautifulSoup yourself, then use + # cwd, listing = htmllistparse.parse(soup) +where ``cwd`` is the current directory, ``listing`` is a list of ``FileEntry`` named tuples: +* ``name``: File name, ``str``. Have a trailing / if it's a directory. +* ``modified``: Last modification time, ``time.struct_time`` or ``None``. Timezone is not known. +* ``size``: File size, ``int`` or ``None``. May be estimated from the prefix, such as "K", "M". +* ``description``: File description, file type, or any other things found. ``str`` as HTML, or ``None``. +Supports: +* Vanilla Apache/nginx/lighttpd/darkhttpd autoindex +* Most ``
``-style index
+* Many other ````-style index
+* ``
``-style index +* ``
``-style index +* ``