summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-PyRSS2Gen.spec363
-rw-r--r--sources1
3 files changed, 365 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..14ff524 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/PyRSS2Gen-1.1.tar.gz
diff --git a/python-PyRSS2Gen.spec b/python-PyRSS2Gen.spec
new file mode 100644
index 0000000..1b2c6a9
--- /dev/null
+++ b/python-PyRSS2Gen.spec
@@ -0,0 +1,363 @@
+%global _empty_manifest_terminate_build 0
+Name: python-PyRSS2Gen
+Version: 1.1
+Release: 1
+Summary: Generate RSS2 using a Python data structure
+License: BSD
+URL: http://dalkescientific.com/Python/PyRSS2Gen.html
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/6d/01/fd610d5fc86f7dbdbefc4baa8f7fe15a2e5484244c41dcf363ca7e89f60c/PyRSS2Gen-1.1.tar.gz
+BuildArch: noarch
+
+
+%description
+I've finally decided to catch up with 1999 and play around a bit with
+RSS. I looked around, and while there are many ways to read RSS there
+are remarkably few which write them. I could use a DOM or other
+construct, but I want the code to feel like Python. There are more
+Pythonic APIs I might use, like the effbot's ElementTree, but I also
+wanted integers, dates, and lists to be real integers, dates, and
+lists. (And I want bug-eyed monsters from Alpha Centauri to be *real*
+bug-eyed monsters from Alpha Centauri - is that too much I ask you?)
+The RSS generators I found were built around print statements.
+Workable, but they almost invariably left out proper HTML escaping the
+sort which leads to Mark Pilgrim's to write feed_parser, to make sense
+of documents which are neither XML nor HTML. Annoying, but sadly all
+too common.
+So I messed around a bit with the spec from
+ http://blogs.law.harvard.edu/tech/rss
+The result looks like this:
+import datetime
+import PyRSS2Gen
+rss = PyRSS2Gen.RSS2(
+ title = "Andrew's PyRSS2Gen feed",
+ link = "http://www.dalkescientific.com/Python/PyRSS2Gen.html",
+ description = "The latest news about PyRSS2Gen, a "
+ "Python library for generating RSS2 feeds",
+ lastBuildDate = datetime.datetime.now(),
+ items = [
+ PyRSS2Gen.RSSItem(
+ title = "PyRSS2Gen-0.0 released",
+ link = "http://www.dalkescientific.com/news/030906-PyRSS2Gen.html",
+ description = "Dalke Scientific today announced PyRSS2Gen-0.0, "
+ "a library for generating RSS feeds for Python. ",
+ guid = PyRSS2Gen.Guid("http://www.dalkescientific.com/news/"
+ "030906-PyRSS2Gen.html"),
+ pubDate = datetime.datetime(2003, 9, 6, 21, 31)),
+ PyRSS2Gen.RSSItem(
+ title = "Thoughts on RSS feeds for bioinformatics",
+ link = "http://www.dalkescientific.com/writings/diary/"
+ "archive/2003/09/06/RSS.html",
+ description = "One of the reasons I wrote PyRSS2Gen was to "
+ "experiment with RSS for data collection in "
+ "bioinformatics. Last year I came across...",
+ guid = PyRSS2Gen.Guid("http://www.dalkescientific.com/writings/"
+ "diary/archive/2003/09/06/RSS.html"),
+ pubDate = datetime.datetime(2003, 9, 6, 21, 49)),
+ ])
+rss.write_xml(open("pyrss2gen.xml", "w"))
+The output does not contain newlines, so if you want to read it,
+you'll need to use your favorite XML tools to reformat it.
+RSS is not a fixed format. People are free to add various metadata,
+like Dublin Core elements.
+The RSS objects are converted to XML using the 'publish' method, which
+takes a SAX2 ContentHandler. If you want different output, implement
+your own 'publish'. The "simple" data types which takes a string,
+int, or date, can be replaced with a publishable object, so you can
+add metadata to, say, the "description" field. To support new
+elements for RSS and RSSItem, derive from them and use the
+'publish_extensions" hook. To add your own attributes (needed for
+namespace declarations), redefine 'element_attrs' or 'rss_attrs' in
+your subclass.
+To use a different encoding, create your own ContentHandler instead of
+using the helper methods 'to_xml' and 'write_xml.' You'll need to
+make sure the 'characters' method in the handler does the appropriate
+translation.
+The "categories" list is somewhat special. It needs to be a list and
+doesn't have a publish method. That's because the RSS spec doesn't
+have an explicit concept for the set of categories -- an RSS2 channel
+can have 0 or more 'category' elements, but doesn't have a "list of
+categories" -- my "categories" attribute is an API fiction.
+BUGS:
+Several people have used this package since its first release in
+September of 2003 and reported a couple of bugs. All those are fixed.
+There are no known bugs.
+The name PyRSS2Gen is a mouthful. It didn't think it was useful to
+come up with a cute name. You might consider having
+ import PyRSS2Gen as RSS2
+in any code which uses this module. I'm not changing the name because
+anyone who reads "RSS2" will likely think it's a parser and not a
+generator. Plus, the current name is very easy to find via a web
+search.
+LICENSE:
+This is copyright (c) by Andrew Dalke Scientific, AB (previously
+'Dalke Scientific Software, LLC') and released under the BSD
+license. See the file LICENSE in the distribution, or
+ http://www.opensource.org/licenses/bsd-license.php
+for details.
+CHANGES for 1.1: Released August 25, 2012
+ - Ported to Python 3.x. Thanks to Graham Bell for the initial patch.
+CHANGES for 1.0: Released November 6, 2005
+ - Many people (Richard Chamberlain, Daniel Hsu, Leonart Richardson
+ and Daniel Holth) pointed out that Guid sets "isPermaLink" (with a
+ "L" not "l"). Fixed, and changed it so the isPermaLink RSS attribute
+ is always either "true" or "false" instead of assuming empty means false.
+ - Added patches from Erik de Jonge and MATSUNO Tokuhiro to set the
+ output encoding.
+ - Implemented a suggestion by Daniel Hoth to convert the enclosure
+ length to a string.
+CHANGES for 0.1.1: Released in September 2003
+ - retroactively renamed "0.0" to "0.1"
+ - fixed bug in Image height. Patch thanks to Edward Dale.
+
+%package -n python3-PyRSS2Gen
+Summary: Generate RSS2 using a Python data structure
+Provides: python-PyRSS2Gen
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-PyRSS2Gen
+I've finally decided to catch up with 1999 and play around a bit with
+RSS. I looked around, and while there are many ways to read RSS there
+are remarkably few which write them. I could use a DOM or other
+construct, but I want the code to feel like Python. There are more
+Pythonic APIs I might use, like the effbot's ElementTree, but I also
+wanted integers, dates, and lists to be real integers, dates, and
+lists. (And I want bug-eyed monsters from Alpha Centauri to be *real*
+bug-eyed monsters from Alpha Centauri - is that too much I ask you?)
+The RSS generators I found were built around print statements.
+Workable, but they almost invariably left out proper HTML escaping the
+sort which leads to Mark Pilgrim's to write feed_parser, to make sense
+of documents which are neither XML nor HTML. Annoying, but sadly all
+too common.
+So I messed around a bit with the spec from
+ http://blogs.law.harvard.edu/tech/rss
+The result looks like this:
+import datetime
+import PyRSS2Gen
+rss = PyRSS2Gen.RSS2(
+ title = "Andrew's PyRSS2Gen feed",
+ link = "http://www.dalkescientific.com/Python/PyRSS2Gen.html",
+ description = "The latest news about PyRSS2Gen, a "
+ "Python library for generating RSS2 feeds",
+ lastBuildDate = datetime.datetime.now(),
+ items = [
+ PyRSS2Gen.RSSItem(
+ title = "PyRSS2Gen-0.0 released",
+ link = "http://www.dalkescientific.com/news/030906-PyRSS2Gen.html",
+ description = "Dalke Scientific today announced PyRSS2Gen-0.0, "
+ "a library for generating RSS feeds for Python. ",
+ guid = PyRSS2Gen.Guid("http://www.dalkescientific.com/news/"
+ "030906-PyRSS2Gen.html"),
+ pubDate = datetime.datetime(2003, 9, 6, 21, 31)),
+ PyRSS2Gen.RSSItem(
+ title = "Thoughts on RSS feeds for bioinformatics",
+ link = "http://www.dalkescientific.com/writings/diary/"
+ "archive/2003/09/06/RSS.html",
+ description = "One of the reasons I wrote PyRSS2Gen was to "
+ "experiment with RSS for data collection in "
+ "bioinformatics. Last year I came across...",
+ guid = PyRSS2Gen.Guid("http://www.dalkescientific.com/writings/"
+ "diary/archive/2003/09/06/RSS.html"),
+ pubDate = datetime.datetime(2003, 9, 6, 21, 49)),
+ ])
+rss.write_xml(open("pyrss2gen.xml", "w"))
+The output does not contain newlines, so if you want to read it,
+you'll need to use your favorite XML tools to reformat it.
+RSS is not a fixed format. People are free to add various metadata,
+like Dublin Core elements.
+The RSS objects are converted to XML using the 'publish' method, which
+takes a SAX2 ContentHandler. If you want different output, implement
+your own 'publish'. The "simple" data types which takes a string,
+int, or date, can be replaced with a publishable object, so you can
+add metadata to, say, the "description" field. To support new
+elements for RSS and RSSItem, derive from them and use the
+'publish_extensions" hook. To add your own attributes (needed for
+namespace declarations), redefine 'element_attrs' or 'rss_attrs' in
+your subclass.
+To use a different encoding, create your own ContentHandler instead of
+using the helper methods 'to_xml' and 'write_xml.' You'll need to
+make sure the 'characters' method in the handler does the appropriate
+translation.
+The "categories" list is somewhat special. It needs to be a list and
+doesn't have a publish method. That's because the RSS spec doesn't
+have an explicit concept for the set of categories -- an RSS2 channel
+can have 0 or more 'category' elements, but doesn't have a "list of
+categories" -- my "categories" attribute is an API fiction.
+BUGS:
+Several people have used this package since its first release in
+September of 2003 and reported a couple of bugs. All those are fixed.
+There are no known bugs.
+The name PyRSS2Gen is a mouthful. It didn't think it was useful to
+come up with a cute name. You might consider having
+ import PyRSS2Gen as RSS2
+in any code which uses this module. I'm not changing the name because
+anyone who reads "RSS2" will likely think it's a parser and not a
+generator. Plus, the current name is very easy to find via a web
+search.
+LICENSE:
+This is copyright (c) by Andrew Dalke Scientific, AB (previously
+'Dalke Scientific Software, LLC') and released under the BSD
+license. See the file LICENSE in the distribution, or
+ http://www.opensource.org/licenses/bsd-license.php
+for details.
+CHANGES for 1.1: Released August 25, 2012
+ - Ported to Python 3.x. Thanks to Graham Bell for the initial patch.
+CHANGES for 1.0: Released November 6, 2005
+ - Many people (Richard Chamberlain, Daniel Hsu, Leonart Richardson
+ and Daniel Holth) pointed out that Guid sets "isPermaLink" (with a
+ "L" not "l"). Fixed, and changed it so the isPermaLink RSS attribute
+ is always either "true" or "false" instead of assuming empty means false.
+ - Added patches from Erik de Jonge and MATSUNO Tokuhiro to set the
+ output encoding.
+ - Implemented a suggestion by Daniel Hoth to convert the enclosure
+ length to a string.
+CHANGES for 0.1.1: Released in September 2003
+ - retroactively renamed "0.0" to "0.1"
+ - fixed bug in Image height. Patch thanks to Edward Dale.
+
+%package help
+Summary: Development documents and examples for PyRSS2Gen
+Provides: python3-PyRSS2Gen-doc
+%description help
+I've finally decided to catch up with 1999 and play around a bit with
+RSS. I looked around, and while there are many ways to read RSS there
+are remarkably few which write them. I could use a DOM or other
+construct, but I want the code to feel like Python. There are more
+Pythonic APIs I might use, like the effbot's ElementTree, but I also
+wanted integers, dates, and lists to be real integers, dates, and
+lists. (And I want bug-eyed monsters from Alpha Centauri to be *real*
+bug-eyed monsters from Alpha Centauri - is that too much I ask you?)
+The RSS generators I found were built around print statements.
+Workable, but they almost invariably left out proper HTML escaping the
+sort which leads to Mark Pilgrim's to write feed_parser, to make sense
+of documents which are neither XML nor HTML. Annoying, but sadly all
+too common.
+So I messed around a bit with the spec from
+ http://blogs.law.harvard.edu/tech/rss
+The result looks like this:
+import datetime
+import PyRSS2Gen
+rss = PyRSS2Gen.RSS2(
+ title = "Andrew's PyRSS2Gen feed",
+ link = "http://www.dalkescientific.com/Python/PyRSS2Gen.html",
+ description = "The latest news about PyRSS2Gen, a "
+ "Python library for generating RSS2 feeds",
+ lastBuildDate = datetime.datetime.now(),
+ items = [
+ PyRSS2Gen.RSSItem(
+ title = "PyRSS2Gen-0.0 released",
+ link = "http://www.dalkescientific.com/news/030906-PyRSS2Gen.html",
+ description = "Dalke Scientific today announced PyRSS2Gen-0.0, "
+ "a library for generating RSS feeds for Python. ",
+ guid = PyRSS2Gen.Guid("http://www.dalkescientific.com/news/"
+ "030906-PyRSS2Gen.html"),
+ pubDate = datetime.datetime(2003, 9, 6, 21, 31)),
+ PyRSS2Gen.RSSItem(
+ title = "Thoughts on RSS feeds for bioinformatics",
+ link = "http://www.dalkescientific.com/writings/diary/"
+ "archive/2003/09/06/RSS.html",
+ description = "One of the reasons I wrote PyRSS2Gen was to "
+ "experiment with RSS for data collection in "
+ "bioinformatics. Last year I came across...",
+ guid = PyRSS2Gen.Guid("http://www.dalkescientific.com/writings/"
+ "diary/archive/2003/09/06/RSS.html"),
+ pubDate = datetime.datetime(2003, 9, 6, 21, 49)),
+ ])
+rss.write_xml(open("pyrss2gen.xml", "w"))
+The output does not contain newlines, so if you want to read it,
+you'll need to use your favorite XML tools to reformat it.
+RSS is not a fixed format. People are free to add various metadata,
+like Dublin Core elements.
+The RSS objects are converted to XML using the 'publish' method, which
+takes a SAX2 ContentHandler. If you want different output, implement
+your own 'publish'. The "simple" data types which takes a string,
+int, or date, can be replaced with a publishable object, so you can
+add metadata to, say, the "description" field. To support new
+elements for RSS and RSSItem, derive from them and use the
+'publish_extensions" hook. To add your own attributes (needed for
+namespace declarations), redefine 'element_attrs' or 'rss_attrs' in
+your subclass.
+To use a different encoding, create your own ContentHandler instead of
+using the helper methods 'to_xml' and 'write_xml.' You'll need to
+make sure the 'characters' method in the handler does the appropriate
+translation.
+The "categories" list is somewhat special. It needs to be a list and
+doesn't have a publish method. That's because the RSS spec doesn't
+have an explicit concept for the set of categories -- an RSS2 channel
+can have 0 or more 'category' elements, but doesn't have a "list of
+categories" -- my "categories" attribute is an API fiction.
+BUGS:
+Several people have used this package since its first release in
+September of 2003 and reported a couple of bugs. All those are fixed.
+There are no known bugs.
+The name PyRSS2Gen is a mouthful. It didn't think it was useful to
+come up with a cute name. You might consider having
+ import PyRSS2Gen as RSS2
+in any code which uses this module. I'm not changing the name because
+anyone who reads "RSS2" will likely think it's a parser and not a
+generator. Plus, the current name is very easy to find via a web
+search.
+LICENSE:
+This is copyright (c) by Andrew Dalke Scientific, AB (previously
+'Dalke Scientific Software, LLC') and released under the BSD
+license. See the file LICENSE in the distribution, or
+ http://www.opensource.org/licenses/bsd-license.php
+for details.
+CHANGES for 1.1: Released August 25, 2012
+ - Ported to Python 3.x. Thanks to Graham Bell for the initial patch.
+CHANGES for 1.0: Released November 6, 2005
+ - Many people (Richard Chamberlain, Daniel Hsu, Leonart Richardson
+ and Daniel Holth) pointed out that Guid sets "isPermaLink" (with a
+ "L" not "l"). Fixed, and changed it so the isPermaLink RSS attribute
+ is always either "true" or "false" instead of assuming empty means false.
+ - Added patches from Erik de Jonge and MATSUNO Tokuhiro to set the
+ output encoding.
+ - Implemented a suggestion by Daniel Hoth to convert the enclosure
+ length to a string.
+CHANGES for 0.1.1: Released in September 2003
+ - retroactively renamed "0.0" to "0.1"
+ - fixed bug in Image height. Patch thanks to Edward Dale.
+
+%prep
+%autosetup -n PyRSS2Gen-1.1
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-PyRSS2Gen -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon Mar 06 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..03dfe88
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+3529f831c6a4ed717b55315974e16317 PyRSS2Gen-1.1.tar.gz