diff options
author | nico <nico@magicbroccoli.de> | 2018-11-07 00:37:24 +0100 |
---|---|---|
committer | nico <nico@magicbroccoli.de> | 2018-11-07 00:37:24 +0100 |
commit | d7fc664d3be4634a693a24fa98ff3f15d2c97c41 (patch) | |
tree | ed646ce57bc4992de4502fbeb0669fa5e48c6ae1 /classes | |
parent | 0c313565f2b649366f7382dc1b3f28a3e80f4ffc (diff) |
* corrected CamelCase
* corrected logging.INFO to .info
* small changes to HandleError class
Diffstat (limited to 'classes')
-rw-r--r-- | classes/xep.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/classes/xep.py b/classes/xep.py index 98f4b78..a74c30f 100644 --- a/classes/xep.py +++ b/classes/xep.py @@ -1,8 +1,7 @@ -#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import requests -import defusedxml.ElementTree as et +import defusedxml.ElementTree as Et class XEPRequest: @@ -36,12 +35,12 @@ class XEPRequest: # compare etag with local_etag if they match up no request is made if local_etag == etag: with open("./common/xeplist.xml", "r") as file: - self.xeplist = et.fromstring(file.read()) + self.xeplist = Et.fromstring(file.read()) # if the connection is not possible use cached xml if present elif os.path.isfile("./common/xeplist.xml") and head.status_code != 200: with open("./common/xeplist.xml", "r") as file: - self.xeplist = et.fromstring(file.read()) + self.xeplist = Et.fromstring(file.read()) # in any other case request the latest xml else: @@ -51,7 +50,7 @@ class XEPRequest: with open("./common/xeplist.xml", "w") as file: file.write(r.content.decode()) - self.xeplist = et.fromstring(r.content.decode()) + self.xeplist = Et.fromstring(r.content.decode()) with open('./common/.etag', 'w') as string: string.write(local_etag) |