for i in range(NUM_UPDATER): job = UpdaterJob(temp) jobs.append(job) job.start() links, updates = [], {} for job in jobs: job.join() links = links + job.links updates.update(job.updates) # all series checked return links, updates if __name__ == "__main__": db = NyaaSQLiteDB(DBNAME) links, updates = update(db) if (links): print print len(links), "new updates found, download all? [y/n]", var = raw_input() if var in ['y', 'Y']: db_updates(db, links, updates) else: db.close() else: db.close()
#!/usr/bin/env python """ dbeditor (not yet tested in windows!) """ from Tkinter import * from nyaa_db import NyaaDB, NyaaSQLiteDB import tkSimpleDialog import tkMessageBox db = NyaaSQLiteDB() data = db.load() class App: def __init__(self, master): frame = Frame(master, width=650, height=320) frame.pack() lf = Frame(frame, width=150, height=300) lf.place(x=10, y=10) self.rf = Frame(frame, width=470, height=300) # rf.place(x=170,y=10) # left frame self.listbox = Listbox(lf, width=200, height=16) self.listbox.place(x=0, y=0) self.listbox.bind("<<ListboxSelect>>", self.show_entry_bind) self.update_list() Button(lf, text="+", command=self.additem).place(x=0, y=265)
#!/usr/bin/env python """ dbeditor (not yet tested in windows!) """ from Tkinter import * from nyaa_db import NyaaDB, NyaaSQLiteDB import tkSimpleDialog import tkMessageBox db = NyaaSQLiteDB() data = db.load() class App: def __init__(self, master): frame = Frame(master, width=650, height=320) frame.pack() lf = Frame(frame, width=150, height=300) lf.place(x=10,y=10) self.rf = Frame(frame, width=470, height=300) # rf.place(x=170,y=10) # left frame self.listbox = Listbox(lf, width=200, height=16) self.listbox.place(x=0, y=0) self.listbox.bind("<<ListboxSelect>>", self.show_entry_bind) self.update_list() Button(lf,text="+", command=self.additem).place(x=0, y=265)
for key, value in data.items(): temp[key] = value n = n + 1 total = total + 1 if (n==item_per_job or total == len(data)): n = 0 job = UpdaterJob(temp) jobs.append(job) job.start() temp = {} links, updates = [], {} for job in jobs: job.join() links = links + job.links updates.update(job.updates) # all series checked return links, updates if __name__ == "__main__": db = NyaaSQLiteDB(DBNAME) links, updates = update(db) if (links): print len(links), "new updates found" db_updates(db, links, updates) else: db.close()
n = 0 while(n < len(ret) and ret[n]['name'] != val[2]): links.append((ret[n]['link'], ret[n]['name'] + ".torrent")) n = n + 1 if (n == 0): print key, "is already updated" else: updates[key] = [None, None, ret[0]['name']] print key, "has", n, "new update(s)!" for i in range(n): print ret[i]['name'] else: print "Connection error on checking", key print return links, updates # create and load database object to be checked db = NyaaSQLiteDB() links, updates = checkUpdate(db.load()) n = len(links) # download available torrent(s) if applicable if n > 0: print "Download all", n, "torrent(s)? [y/n]", var = raw_input() if var=="y": for e in links: try: download(e[0],e[1]) print "Downloaded", e[1] except IOError: print "Connection Error" db.update(updates)
links.append((ret[n]['link'], ret[n]['name'] + ".torrent")) n = n + 1 if (n == 0): print key, "is already updated" else: updates[key] = [None, None, ret[0]['name']] print key, "has", n, "new update(s)!" for i in range(n): print ret[i]['name'] else: print "Connection error on checking", key print return links, updates # create and load database object to be checked db = NyaaSQLiteDB() links, updates = checkUpdate(db.load()) n = len(links) # download available torrent(s) if applicable if n > 0: print "Download all", n, "torrent(s)? [y/n]", var = raw_input() if var == "y": for e in links: try: download(e[0], e[1]) print "Downloaded", e[1] except IOError: print "Connection Error" db.update(updates)