summaryrefslogtreecommitdiff
path: root/sample-scripts/relchk.py
diff options
context:
space:
mode:
Diffstat (limited to 'sample-scripts/relchk.py')
-rwxr-xr-xsample-scripts/relchk.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/sample-scripts/relchk.py b/sample-scripts/relchk.py
new file mode 100755
index 0000000..2a337d3
--- /dev/null
+++ b/sample-scripts/relchk.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+
+from urllib.request import urlopen
+try:
+ from lxml import etree
+ has_lxml = True
+except ImportError:
+ import xml.etree.ElementTree as etree
+ has_lxml = False
+
+# Normally this'd be passed via calling the class, but this is mostly for
+# demonstration purposes only so we're not too worried about it.
+feed_url = 'https://git.square-r00t.net/RelSpec/tree/samplefeed.xml'
+
+class Release(object):
+ def __init__(self, feed):
+ self.xml = etree.fromstring(feed)
+
+ def getChannels(self):
+ self.channels = []
+
+
+if __name__ == '__main__':
+ with urlopen(feed_url) as http:
+ feed = Release(http.read())