Exemplo n.º 1
0
    def setUp(self):
        AbstractAPI.CACHE['http://www.animeseason.com/anime-list/'] = open(
            "../cache/animeseason.anime-list.html").read()
        AbstractAPI.CACHE['http://www.animeseason.com/gosick/'] = open("../cache/animeseason.gosick.html").read()

        self.api = AnimeSeason()
        self.log = Log.create_log(__name__)
Exemplo n.º 2
0
from db.mysql import Database


# Load the local cache into memory
AbstractAPI.CACHE["http://anidb.net/api/animetitles.xml.gz"] = open("cache/anidb.anime-titles.xml").read()
AbstractAPI.CACHE["http://www.animeseason.com/anime-list/"] = open("cache/animeseason.anime-list.html").read()
AbstractAPI.CACHE["http://myanimelist.net/malappinfo.php?u=coty9090&status=all&type=anime"] = \
    open("cache/mal.malappinfo.xml").read()
AbstractAPI.CACHE["http://www.animenewsnetwork.com/encyclopedia/reports.xml?id=155&nlist=all&type=anime"] = \
    open("cache/ann.reports.all.xml").read()

parser = argparse.ArgumentParser(description="Sync the animehunt database.")
#parser.add_argument('api', metavar='api', type=str, help="the api to use for the sync operation")
#parser.add_argument('--titles', dest='ops', type=str, const="all", default="all", help="a database sync operation")
#args = parser.parse_args()

log = Log.create_log("sync")
db = Database(**SETTINGS['db'])

api = {
    'as': api.AnimeSeason(),
    'mal': api.MyAnimeList(**SETTINGS['mal']),
    'anidb': api.AniDB(),
    'ann': api.AnimeNewsNetwork()}

ops = {
    'as': ops.AnimeSeasonOperations(db),
    'mal': ops.MALOperations(db, api['mal']),
    'anidb': ops.AniDBOperations(db),
    'ann': ops.AnimeNewsNetworkOperations(db)}
Exemplo n.º 3
0
 def __init__(self, module):
     # Initialize the Logger object
     self.log = Log.create_log(module)
Exemplo n.º 4
0
    def setUp(self):
        AbstractAPI.CACHE["http://anidb.net/api/animetitles.xml.gz"] = open("../cache/anidb.anime-titles.xml").read()

        self.api = AniDB()
        self.log = Log.create_log(__name__)
Exemplo n.º 5
0
 def __init__(self, db, api):
     self.log = Log.create_log(__name__)
     self.db = db
     self.api = api
Exemplo n.º 6
0
 def __init__(self, db):
     self.api = AniDB()
     self.db = db
     self.log = Log.create_log(__name__)
Exemplo n.º 7
0
 def __init__(self, db):
     self.db = db
     self.api = api.AnimeNewsNetwork()
     self.log = Log.create_log(__name__)
Exemplo n.º 8
0
 def setUp(self):
     self.log = Log.create_log(__name__)
     self.api = MyAnimeList(**SETTINGS['mal'])
Exemplo n.º 9
0
 def setUp(self):
     self.log = Log.create_log(__name__)
     self.anidb = AniDB()
     self.animeseason = AnimeSeason()