"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "EmailReminder/Utils.py" between
email-reminder-0.8.0.tar.gz and email-reminder-0.8.1.tar.gz

About: Email-Reminder lets define events to be reminded of by email via cronjob (with GUI).

Utils.py  (email-reminder-0.8.0):Utils.py  (email-reminder-0.8.1)
skipping to change at line 26 skipping to change at line 26
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
import re import re
EMAIL_REGEX = re.compile(r"[^@]+@[^@]+\.[^@]+") EMAIL_REGEX = re.compile(r"[^@]+@[^@]+\.[^@]+")
def readXMLValue(parent, name): def readXMLValue(parent, name):
element = None element = None
for candidate in parent.getElementsByTagName(name): for candidate in parent.getElementsByTagName(name):
element = candidate element = candidate
if candidate.parentNode != parent: if candidate.parentNode == parent:
element = None # not the right node break # found the right node
element = None # keep looking
if not element: if not element:
return None return None
if not element.firstChild: if not element.firstChild:
return None return None
return element.firstChild.nodeValue return element.firstChild.nodeValue
def writeXMLValue(document, parent, name, value): def writeXMLValue(document, parent, name, value):
element = None element = None
for candidate in parent.getElementsByTagName(name): for candidate in parent.getElementsByTagName(name):
element = candidate element = candidate
if candidate.parentNode != parent: if candidate.parentNode == parent:
element = None # not the right node break # found the right node
element = None # keep looking
if not value: if not value:
if element: if element:
parent.removeChild(element) parent.removeChild(element)
return return
if not element: if not element:
element = document.createElement(name) element = document.createElement(name)
element.appendChild( element.appendChild(
document.createTextNode(str(value))) document.createTextNode(str(value)))
 End of changes. 2 change blocks. 
4 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)