diff options
author | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-07-04 08:27:49 +0100 |
---|---|---|
committer | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-07-04 08:27:49 +0100 |
commit | b816463d1d81faeba373349c2728d435515a0a45 (patch) | |
tree | 7c051e8b06fe40b10f57d80e8bb76dbc4a8a3d64 /parsers | |
parent | 96533882c7c251dc039359b36dd2830c02976b1f (diff) | |
download | troggle-b816463d1d81faeba373349c2728d435515a0a45.tar.gz troggle-b816463d1d81faeba373349c2728d435515a0a45.tar.bz2 troggle-b816463d1d81faeba373349c2728d435515a0a45.zip |
[svn] * Adding JS fill in next QM number via ajax.
* Slight models cleanup- get rid of TroggleImageModel class, use mixin instead.
* Collect various troggle shared functions into utils.py
Diffstat (limited to 'parsers')
-rw-r--r-- | parsers/subcaves.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/parsers/subcaves.py b/parsers/subcaves.py index c3acc4d..bdd64a1 100644 --- a/parsers/subcaves.py +++ b/parsers/subcaves.py @@ -37,7 +37,20 @@ def importSubcaves(cave): logging.info("Added " + unicode(newSubcave) + " to " + unicode(cave))
except IOError:
logging.info("Subcave import couldn't open "+subcaveFilePath)
-
+
+def getLinksInSubcaveDescription(subcave):
+ pattern='<a href=\"(.*?)\">(.*?)</a>'
+ if subcave.description:
+ return re.findall(pattern,subcave.description)
+ else:
+ return []
+
+def getLinksInAllSubcaves():
+ bigList=[]
+ for subcave in Subcave.objects.all():
+ bigList+=getLinksInSubcaveDescription(subcave)
+ return bigList
+
def importAllSubcaves():
for cave in Cave.objects.all():
importSubcaves(cave)
|