3 # ljdump-gui.py - gui interface to ljdump
4 # Greg Hewgill <greg@hewgill.com> http://hewgill.com
6 # NOTE: This is a work in progress and is probably not suitable for
7 # general release just yet.
11 # This software is provided 'as-is', without any express or implied
12 # warranty. In no event will the author be held liable for any damages
13 # arising from the use of this software.
15 # Permission is granted to anyone to use this software for any purpose,
16 # including commercial applications, and to alter it and redistribute it
17 # freely, subject to the following restrictions:
19 # 1. The origin of this software must not be misrepresented; you must not
20 # claim that you wrote the original software. If you use this software
21 # in a product, an acknowledgment in the product documentation would be
22 # appreciated but is not required.
23 # 2. Altered source versions must be plainly marked as such, and must not be
24 # misrepresented as being the original software.
25 # 3. This notice may not be removed or altered from any source distribution.
27 # Copyright (c) 2005-2009 Greg Hewgill
40 if gWorkerThread.isAlive():
44 status['text'] = "Completed."
46 cancel['state'] = NORMAL
48 def do_ok(event = None):
51 status['text'] = "Running..."
52 ok['state'] = DISABLED
53 cancel['state'] = DISABLED
55 gWorkerThread = threading.Thread(None, ljdump.ljdump, args=("http://livejournal.com", username.get(), password.get()))
59 def do_cancel(event = None):
67 Label(body, text="Username:").grid(row=0, sticky=W)
68 Label(body, text="Password:").grid(row=1, sticky=W)
69 Label(body, text="Status:").grid(row=2, sticky=W)
70 username = Entry(body)
71 password = Entry(body, show="*")
72 status = Label(body, text="Waiting")
73 username.grid(row=0, column=1)
74 password.grid(row=1, column=1)
75 status.grid(row=2, column=1, sticky=W)
76 body.pack(padx=5, pady=5)
80 ok = Button(box, text="OK", width=10, command=do_ok, default=ACTIVE)
81 ok.pack(side=LEFT, padx=5, pady=5)
82 cancel = Button(box, text="Cancel", width=10, command=do_cancel)
83 cancel.pack(side=LEFT, padx=5, pady=5)
85 root.bind("<Return>", do_ok)
86 root.bind("<Escape>", do_cancel)