コード例 #1
0
ファイル: webserve.py プロジェクト: manders2600/mylar
 def from_Exceptions(self, comicid, gcdid, comicname=None, comicyear=None, comicissues=None, comicpublisher=None):
     mismatch = "yes"
     print ("gcdid:" + str(gcdid))
     #write it to the custom_exceptions.csv and reload it so that importer will pick it up and do it's thing :)
     #custom_exceptions in this format...
     #99, (comicid), (gcdid), none
     logger.info("saving new information into custom_exceptions.csv...")
     except_info = "none #" + str(comicname) + "-(" + str(comicyear) + ")"
     with open('custom_exceptions.csv', 'a') as f:
         f.write('%s,%s,%s,%s\n' % ("99", str(comicid), str(gcdid), str(except_info)) )
     
     logger.info("re-loading csv file so it's all nice and current.")
     mylar.csv_load()
    
     threading.Thread(target=importer.addComictoDB, args=[comicid,mismatch]).start()
     raise cherrypy.HTTPRedirect("artistPage?ComicID=%s" % comicid)
コード例 #2
0
ファイル: webserve.py プロジェクト: brunnels/mylar
    def from_Exceptions(self, comicid, gcdid, comicname=None, comicyear=None, comicissues=None, comicpublisher=None):
        mismatch = "yes"
        #print ("gcdid:" + str(gcdid))
        #write it to the custom_exceptions.csv and reload it so that importer will pick it up and do it's thing :)
        #custom_exceptions in this format...
        #99, (comicid), (gcdid), none
        logger.info("saving new information into custom_exceptions.csv...")
        except_info = "none #" + str(comicname) + "-(" + str(comicyear) + ")"
        except_file = os.path.join(mylar.DATA_DIR,"custom_exceptions.csv")
        if not os.path.exists(except_file):
            try:
                 csvfile = open(str(except_file), 'rb')
                 csvfile.close()
            except (OSError,IOError):
                logger.error("Could not locate " + str(except_file) + " file. Make sure it's in datadir: " + mylar.DATA_DIR + " with proper permissions.")
                return

        with open(str(except_file), 'a') as f:
            f.write('%s,%s,%s,%s\n' % ("99", str(comicid), str(gcdid), str(except_info)) )
        logger.info("re-loading csv file so it's all nice and current.")
        mylar.csv_load()
       
        threading.Thread(target=importer.addComictoDB, args=[comicid,mismatch]).start()
        raise cherrypy.HTTPRedirect("artistPage?ComicID=%s" % comicid)