Ejemplo n.º 1
0
    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()
Ejemplo n.º 2
0
#!/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)