#!/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)
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)
#!/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)
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)