+
+ open("/tmp/pad_%s.txt" % pid, 'w').write(text.encode('utf-8'))
+
+ if options.get('tag_edumed'):
+ auto_tagger = 'edumed'
+ else:
+ auto_tagger = options.get('auto_tagger')
+ if auto_tagger:
+ text = auto_taggers[auto_tagger](text)
+ try:
+ info = BookInfo.from_string(text.encode('utf-8'))
+ slug = info.url.slug
+ except (ParseError, ValidationError):
+ slug = slughifi(pid)
+
+ print "Importing %s (slug %s)..." % (pid, slug)