summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrent s <r00t@square-r00t.net>2017-11-26 05:39:34 -0500
committerbrent s <r00t@square-r00t.net>2017-11-26 05:39:34 -0500
commit591a5ba7790f4d12941409f89ed1d923f544e7e5 (patch)
tree09ca653ebd373a47bb7a88e0f7125e643484cbef
parentc2c3696d6933b633a44857737f73c79d55190f7f (diff)
downloadRelSpec-591a5ba7790f4d12941409f89ed1d923f544e7e5.tar.xz
checking in beginnings of sample python script
-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())