Custom Query (2449 matches)
Results (553 - 555 of 2449)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #927 | Fixed | [PATCH] Add support for boost 1.37 | ||
| Description |
This simple patch adds support for boost 1.37. |
|||
| #932 | Fixed | [PATCH] Optimize ti_name even more | ||
| Description |
Looking through pydoc str accidentally gave a sight to optional arg to str.split(). So here are some more tests import os def f1(name): first_slash_index = name.find("/") if first_slash_index != -1: name = name[:first_slash_index] return name def f2(name): name = os.path.split(name)[0] return name def f3(name): name = name.split("/")[0] return name def f4(name): name = name.split("/", 1)[0] return name if __name__ == "__main__": import timeit print timeit.Timer("f1('11/22/33/44/55/66/test.txt')", "from __main__ import f1").timeit() print timeit.Timer("f2('11/22/33/44/55/66/test.txt')", "from __main__ import f2").timeit() print timeit.Timer("f3('11/22/33/44/55/66/test.txt')", "from __main__ import f3").timeit() print timeit.Timer("f4('11/22/33/44/55/66/test.txt')", "from __main__ import f4").timeit() 0.595607995987 2.00995993614 0.795026063919 0.599367141724 And a patch based on this Index: deluge/core/torrent.py
===================================================================
--- deluge/core/torrent.py (revision 5251)
+++ deluge/core/torrent.py (working copy)
@@ -621,7 +584,7 @@
def ti_name():
if self.handle.has_metadata():
- name = self.torrent_info.file_at(0).path.split("/")[0]
+ name = self.torrent_info.file_at(0).path.split("/", 1)[0]
try:
return name.decode("utf8", "ignore")
except UnicodeDecodeError:
|
|||
| #933 | WontFix | Issue with glib, threads and SIGCHLD eating 100% cpu | ||
| Description |
As it turned out if gtk2reactor is used instead of gtk.main() then after subprocess.Popen-ed process finishes deluge starts to eat 100% cpu. A simple examle: import os import pygtk pygtk.require('2.0') import gtk from twisted.internet import gtk2reactor from twisted.internet.protocol import ProcessProtocol reactor = gtk2reactor.install() def on_button_clicked(button): #import subprocess #subprocess.Popen(['mplayer', '/mnt/d/11.avi']) reactor.spawnProcess(ProcessProtocol(), 'mplayer', ['mplayer', '/mnt/d/11.avi'], os.environ) sw = gtk.ScrolledWindow() win = gtk.Window() win.connect('delete-event', gtk.main_quit) button = gtk.Button(u"Press me!") button.connect("clicked", on_button_clicked) vbox = gtk.VBox() vbox.pack_start(button, gtk.FALSE) win.add(vbox) win.show_all() reactor.run() #gtk.main() I tried to change subprocess.Popen to reactor.spawnProcess as twisted docs suggest but nothing changed. If in above example we change reactor.run() to gtk.main() and use subprocess.Popen - then no cpu eating occurs, but leaving zombie though, which we can address later i think, as it is not so important as issue with reactor. Can gtkui be changed back to use gtk.main() ? |
|||
