Mercurial > pidgin.yaz
annotate finch/libgnt/pygnt/file.py @ 21621:b2aa68cdc8b9
I had used memcpy to copy the struct tm to where the caller wants it, but
this assumes all callers provide their own allocated struct, which is not
necessarily always the case.
If callers want to keep the values of this struct tm across multiple calls
to purple_str_to_time, they had better copy it themselves. (which is
essentially the same as it was before when we were returning the pointer
to the struct as returned by localtime(), which is also statically
allocated)
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Fri, 23 Nov 2007 19:41:44 +0000 |
parents | 5e1412f4e67a |
children |
rev | line source |
---|---|
18556
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
2 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
3 import gnt, sys |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
4 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
5 def file_selected(widget, path, file, null): |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
6 sys.stderr.write(path + " " + file) |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
7 list = widget.get_selected_multi_files() |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
8 for i in list: |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
9 sys.stderr.write(i) |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
10 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
11 gnt.gnt_init() |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
12 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
13 win = gnt.Window() |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
14 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
15 files = gnt.FileSel() |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
16 files.set_multi_select(True) |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
17 files.set_title("Files") |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
18 files.connect("file_selected", file_selected, None) |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
19 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
20 files.show() |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
21 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
22 gnt.gnt_main() |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
23 |
5e1412f4e67a
Do some work to make pygnt more useful. The dbus-gnt script works fairly
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
24 gnt.gnt_quit() |