diff options
Diffstat (limited to 'parsers/caves.py')
-rw-r--r-- | parsers/caves.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/parsers/caves.py b/parsers/caves.py index 63c9f94..ba1c358 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -10,12 +10,12 @@ def readcaves(): newArea.save() newArea = models.Area(short_name = "1626", parent = None) newArea.save() - print "Reading Entrances" + print("Reading Entrances") #print "list of <Slug> <Filename>" for filename in os.walk(settings.ENTRANCEDESCRIPTIONS).next()[2]: #Should be a better way of getting a list of files if filename.endswith('.html'): readentrance(filename) - print "Reading Caves" + print ("Reading Caves") for filename in os.walk(settings.CAVEDESCRIPTIONS).next()[2]: #Should be a better way of getting a list of files if filename.endswith('.html'): readcave(filename) @@ -154,7 +154,7 @@ def readcave(filename): primary = primary) cs.save() except: - print "Can't find text (slug): %s, skipping %s" % (slug, context) + print("Can't find text (slug): %s, skipping %s" % (slug, context)) primary = False for entrance in entrances: @@ -165,17 +165,17 @@ def readcave(filename): ce = models.CaveAndEntrance(cave = c, entrance_letter = letter, entrance = entrance) ce.save() except: - print "Entrance text (slug) %s missing %s" % (slug, context) + print ("Entrance text (slug) %s missing %s" % (slug, context)) def getXML(text, itemname, minItems = 1, maxItems = None, printwarnings = True, context = ""): items = re.findall("<%(itemname)s>(.*?)</%(itemname)s>" % {"itemname": itemname}, text, re.S) if len(items) < minItems and printwarnings: - print "%(count)i %(itemname)s found, at least %(min)i expected" % {"count": len(items), + print("%(count)i %(itemname)s found, at least %(min)i expected" % {"count": len(items), "itemname": itemname, - "min": minItems} + context + "min": minItems} + context) if maxItems is not None and len(items) > maxItems and printwarnings: - print "%(count)i %(itemname)s found, no more than %(max)i expected" % {"count": len(items), + print("%(count)i %(itemname)s found, no more than %(max)i expected" % {"count": len(items), "itemname": itemname, - "max": maxItems} + context + "max": maxItems} + context) return items |