From e19d76f0515b291f9c6994bfd0faccccf5b894aa Mon Sep 17 00:00:00 2001 From: "Clayton G. Hobbs" Date: Wed, 30 Dec 2015 23:33:29 -0500 Subject: Added number parsing capabilities See commands.tmp for an example. It's pretty neat, but it could still use some work. I thought of a really clever way to parse numbers, better than the one I came up with last night, but since I have a working implementation now I figure I'd better commit it. We have a new bug which causes the dictionary to be updated every time the program starts. I hope I didn't force that to happen last night or something, but I have a vague feeling I did. --- languageupdater.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'languageupdater.py') diff --git a/languageupdater.py b/languageupdater.py index 662a988..afdfc21 100644 --- a/languageupdater.py +++ b/languageupdater.py @@ -1,7 +1,7 @@ # This is part of Kaylee # -- this code is licensed GPLv3 -# Copyright 2013 Jezra # Copyright 2015 Clayton G. Hobbs +# Portions Copyright 2013 Jezra import hashlib import json @@ -56,7 +56,7 @@ class LanguageUpdater: # Parse response to get URLs of the files we need path_re = r'.*Index of (.*?).*' - number_re = r'.*TAR[0-9]*?\.tgz.*' + number_re = r'.*TAR([0-9]*?)\.tgz.*' for line in r.text.split('\n'): # If we found the directory, keep it and don't break if re.search(path_re, line): -- cgit 1.4.1