0.6 Development Report

Suggestions and discussion of future versions
cvig
Member
Member
Posts: 13
Joined: Sun Mar 09, 2008 7:24 am

Re: 0.6 Development Report

Post by cvig »

Is anyone else getting "maximum recursion depth exceeded" with webui + deluged? It's been happening since at least SVN 3018. I'll get this when I try to start a 100% torrent to keep seeding. When I go back to the main page, a random portion of the torrents will be in a paused state while the torrent that I had selected to start that resulted in the exception will typically be started. There are 77 torrents loaded.

Code: Select all

--Deluge Error--
Fault : <Fault 1: "<type 'exceptions.RuntimeError'>:maximum recursion depth exceeded">
path : /torrent/start/6c7b45f533b05525e2c21932f7d0a4a13c5428f5
file : /usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py in close, line 786

--Input--
<Storage {}>

--Versions--
WebUi : rev.185
Python : 2.5.1 (r251:54863, Aug 23 2007, 17:26:06) 
[GCC 4.1.2 (Gentoo 4.1.2)]
dbus:0.80.2

--Traceback--
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/webapi.py", line 304, in wsgifunc
    result = func()
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/request.py", line 131, in <lambda>
    func = lambda: handle(inp, fvars)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/request.py", line 61, in handle
    return tocall(*([x and urllib.unquote(x) for x in args] + fna))
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 40, in deco
    return func(self, name) #check_session:ok
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 77, in deco
    return func (self, name.split(',')) #torrent_ids
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/pages.py", line 168, in POST
    getattr(proxy, command)(torrent_ids)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1150, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1440, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1204, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1343, in _parse_response
    return u.close()
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 787, in close
    raise Fault(**self._stack[0])
Update:

I tried a bunch of things and then finally decided to delete the torrent states:
rm /home/deluge/.config/deluge/torrents.state
rm -rf /home/deluge/.config/deluge/torrentfiles (after saving all the .torrents to another location)

I still had problems so I removed all of the cookies and it looks like things are working okay now.

Update2:

Right after the first update I did a refresh (by clicking on the water drop on the left) and:

Code: Select all

--Deluge Error--
ExpatError : not well-formed (invalid token): line 274, column 15
path : /index
file : /usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py in feed, line 546

--Input--
<Storage {}>

--Versions--
WebUi : rev.185
Python : 2.5.1 (r251:54863, Mar 30 2008, 02:03:26) 
[GCC 4.1.2 (Gentoo 4.1.2)]
dbus:0.80.2

--Traceback--
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/webapi.py", line 304, in wsgifunc
    result = func()
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/request.py", line 131, in <lambda>
    func = lambda: handle(inp, fvars)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/request.py", line 61, in handle
    return tocall(*([x and urllib.unquote(x) for x in args] + fna))
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 40, in deco
    return func(self, name) #check_session:ok
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 57, in deco
    return func(self, name) #check_connected:ok
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 24, in deco
    res = func(self, name) #deluge_page_noauth
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 109, in deco
    return func(self, name) #auto_refreshed
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/pages.py", line 108, in GET
    torrent_list = utils.get_enhanced_torrent_list(torrent_ids)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/utils.py", line 189, in get_enhanced_torrent_list
    torrent_dict = proxy.get_torrents_status(torrent_ids, TORRENT_KEYS)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1150, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1440, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1204, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1338, in _parse_response
    p.feed(response)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 547, in feed
    self._parser.Parse(data, 0)
andar
Top Bloke
Top Bloke
Posts: 1050
Joined: Fri Jun 08, 2007 8:38 pm
Location: Victoria, BC
Contact:

Re: 0.6 Development Report

Post by andar »

cvig wrote:Is anyone else getting "maximum recursion depth exceeded" with webui + deluged? It's been happening since at least SVN 3018. I'll get this when I try to start a 100% torrent to keep seeding. When I go back to the main page, a random portion of the torrents will be in a paused state while the torrent that I had selected to start that resulted in the exception will typically be started. There are 77 torrents loaded.

Code: Select all

--Deluge Error--
Fault : <Fault 1: "<type 'exceptions.RuntimeError'>:maximum recursion depth exceeded">
path : /torrent/start/6c7b45f533b05525e2c21932f7d0a4a13c5428f5
file : /usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py in close, line 786

--Input--
<Storage {}>

--Versions--
WebUi : rev.185
Python : 2.5.1 (r251:54863, Aug 23 2007, 17:26:06) 
[GCC 4.1.2 (Gentoo 4.1.2)]
dbus:0.80.2

--Traceback--
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/webapi.py", line 304, in wsgifunc
    result = func()
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/request.py", line 131, in <lambda>
    func = lambda: handle(inp, fvars)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/request.py", line 61, in handle
    return tocall(*([x and urllib.unquote(x) for x in args] + fna))
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 40, in deco
    return func(self, name) #check_session:ok
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 77, in deco
    return func (self, name.split(',')) #torrent_ids
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/pages.py", line 168, in POST
    getattr(proxy, command)(torrent_ids)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1150, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1440, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1204, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1343, in _parse_response
    return u.close()
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 787, in close
    raise Fault(**self._stack[0])
Update:

I tried a bunch of things and then finally decided to delete the torrent states:
rm /home/deluge/.config/deluge/torrents.state
rm -rf /home/deluge/.config/deluge/torrentfiles (after saving all the .torrents to another location)

I still had problems so I removed all of the cookies and it looks like things are working okay now.

Update2:

Right after the first update I did a refresh (by clicking on the water drop on the left) and:

Code: Select all

--Deluge Error--
ExpatError : not well-formed (invalid token): line 274, column 15
path : /index
file : /usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py in feed, line 546

--Input--
<Storage {}>

--Versions--
WebUi : rev.185
Python : 2.5.1 (r251:54863, Mar 30 2008, 02:03:26) 
[GCC 4.1.2 (Gentoo 4.1.2)]
dbus:0.80.2

--Traceback--
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/webapi.py", line 304, in wsgifunc
    result = func()
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/request.py", line 131, in <lambda>
    func = lambda: handle(inp, fvars)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/request.py", line 61, in handle
    return tocall(*([x and urllib.unquote(x) for x in args] + fna))
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 40, in deco
    return func(self, name) #check_session:ok
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 57, in deco
    return func(self, name) #check_connected:ok
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 24, in deco
    res = func(self, name) #deluge_page_noauth
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 109, in deco
    return func(self, name) #auto_refreshed
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/pages.py", line 108, in GET
    torrent_list = utils.get_enhanced_torrent_list(torrent_ids)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/utils.py", line 189, in get_enhanced_torrent_list
    torrent_dict = proxy.get_torrents_status(torrent_ids, TORRENT_KEYS)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1150, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1440, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1204, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1338, in _parse_response
    p.feed(response)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 547, in feed
    self._parser.Parse(data, 0)
I think that may be fixed in svn now.
cvig
Member
Member
Posts: 13
Joined: Sun Mar 09, 2008 7:24 am

Re: 0.6 Development Report

Post by cvig »

andar wrote:I think that may be fixed in svn now.
Great! I pulled down the latest and will give it a try.

Update: Worked fine for a while and then (when accessing with second computer without cleared cookies):

Code: Select all

--Deluge Error--
Fault : <Fault 1: "<type 'exceptions.RuntimeError'>:maximum recursion depth exceeded">
path : /torrent/start/733403b6a950c7d867ac710bd775816d076e5d6b
file : /usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py in close, line 786

--Input--
<Storage {}>

--Versions--
WebUi : rev.185
Python : 2.5.1 (r251:54863, Mar 30 2008, 02:03:26) 
[GCC 4.1.2 (Gentoo 4.1.2)]
dbus:0.80.2

--Traceback--
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/webapi.py", line 304, in wsgifunc
    result = func()
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/request.py", line 131, in <lambda>
    func = lambda: handle(inp, fvars)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/lib/webpy022/request.py", line 61, in handle
    return tocall(*([x and urllib.unquote(x) for x in args] + fna))
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 52, in deco
    return func(self, name) #check_session:ok
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/page_decorators.py", line 88, in deco
    return func (self, name.split(',')) #torrent_ids
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/ui/webui/pages.py", line 133, in POST
    getattr(proxy, proxy_command)(torrent_ids)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1150, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1440, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1204, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 1343, in _parse_response
    return u.close()
  File "/usr/lib/python2.5/site-packages/deluge-0.6.0.0-py2.5-linux-i686.egg/deluge/xmlrpclib.py", line 787, in close
    raise Fault(**self._stack[0])
Then the torrent page showed them all as paused yet some where still seeding. I was able to click for a couple and then another error. I cleared the cookies (not sure if this is a red herring) and then was able to login and restart them all one by one.
cvig
Member
Member
Posts: 13
Joined: Sun Mar 09, 2008 7:24 am

Re: 0.6 Development Report

Post by cvig »

Besides that first problem everything has been stable.
oshiri
Member
Member
Posts: 40
Joined: Thu Nov 29, 2007 10:34 am

Re: 0.6 Development Report

Post by oshiri »

Report for svn3062 :

1. deluge-shell add and delete torrent still not working

2. everytime upgrading to new svn, gtk ui will fail with error: IndexError: list index out of range
Temporary Solution: delete torrents.state
This will make all torrent list gone.

3. add url now working and that make me a happy man.

4. some annoying Debug message were sent to deluge-shell. I think Debug message should be sent to other place.
Perhaps it is time for deluge to implement some sort of log file like syslog.
The Debug message were sent looks something like this:

Code: Select all

Welcome to deluge-shell. Type 'help' to see a list of available commands.
> info

*** ID: 56c09351764cc9b26246a294ba1eb97515675a2a
*** Name: XXXXXXXX
*** Path: /home/oshiri/torrent
*** Completed: 7.3 MiB/7.7 MiB
*** Status: Downloading

> [DEBUG   ] __init__:1072 torrent_finished_alert: torrent has finished downloading
[DEBUG   ] __init__:1072 tracker_announce_alert: tracker announce
[DEBUG   ] __init__:1072 on_alert_torrent_finished
[DEBUG   ] __init__:1072 56c09351764cc9b26246a294ba1eb97515675a2a is finished..
[DEBUG   ] __init__:1072 Move torrent 56c09351764cc9b26246a294ba1eb97515675a2a to bottom..
[DEBUG   ] __init__:1072 Append torrent 56c09351764cc9b26246a294ba1eb97515675a2a to queue..
[DEBUG   ] __init__:1072 Saving fastresume file: /home/oshiri/.config/deluge/torrent/tmpO58RrF.fastresume
[DEBUG   ] __init__:1072 on_alert_tracker_announce
[DEBUG   ] __init__:1072 tracker_reply_alert: Got response from tracker: http://vip.tracker.thepiratebay.org/announce
[DEBUG   ] __init__:1072 on_alert_tracker_reply
[DEBUG   ] __init__:1072 Saving torrent state file.
5. minor error for Webui. File deluge_webserver.py.

Code: Select all

Compiling /var/lib/python-support/python2.4/deluge/ui/webui/deluge_webserver.py ...
Sorry: IndentationError: ('unindent does not match any outer indentation level', ('/var/lib/python-support/python2.4/deluge/ui/webui/deluge_webserver.py', 87, 46, '   pagemanager = component.get("PageManager")\n'))
Easily fix. Caused by error tab on line 87.

Thanks.
andar
Top Bloke
Top Bloke
Posts: 1050
Joined: Fri Jun 08, 2007 8:38 pm
Location: Victoria, BC
Contact:

Re: 0.6 Development Report

Post by andar »

oshiri wrote:Report for svn3062 :

1. deluge-shell add and delete torrent still not working

2. everytime upgrading to new svn, gtk ui will fail with error: IndexError: list index out of range
Temporary Solution: delete torrents.state
This will make all torrent list gone.

3. add url now working and that make me a happy man.

4. some annoying Debug message were sent to deluge-shell. I think Debug message should be sent to other place.
Perhaps it is time for deluge to implement some sort of log file like syslog.
The Debug message were sent looks something like this:

Code: Select all

Welcome to deluge-shell. Type 'help' to see a list of available commands.
> info

*** ID: 56c09351764cc9b26246a294ba1eb97515675a2a
*** Name: XXXXXXXX
*** Path: /home/oshiri/torrent
*** Completed: 7.3 MiB/7.7 MiB
*** Status: Downloading

> [DEBUG   ] __init__:1072 torrent_finished_alert: torrent has finished downloading
[DEBUG   ] __init__:1072 tracker_announce_alert: tracker announce
[DEBUG   ] __init__:1072 on_alert_torrent_finished
[DEBUG   ] __init__:1072 56c09351764cc9b26246a294ba1eb97515675a2a is finished..
[DEBUG   ] __init__:1072 Move torrent 56c09351764cc9b26246a294ba1eb97515675a2a to bottom..
[DEBUG   ] __init__:1072 Append torrent 56c09351764cc9b26246a294ba1eb97515675a2a to queue..
[DEBUG   ] __init__:1072 Saving fastresume file: /home/oshiri/.config/deluge/torrent/tmpO58RrF.fastresume
[DEBUG   ] __init__:1072 on_alert_tracker_announce
[DEBUG   ] __init__:1072 tracker_reply_alert: Got response from tracker: http://vip.tracker.thepiratebay.org/announce
[DEBUG   ] __init__:1072 on_alert_tracker_reply
[DEBUG   ] __init__:1072 Saving torrent state file.
5. minor error for Webui. File deluge_webserver.py.

Code: Select all

Compiling /var/lib/python-support/python2.4/deluge/ui/webui/deluge_webserver.py ...
Sorry: IndentationError: ('unindent does not match any outer indentation level', ('/var/lib/python-support/python2.4/deluge/ui/webui/deluge_webserver.py', 87, 46, '   pagemanager = component.get("PageManager")\n'))
Easily fix. Caused by error tab on line 87.

Thanks.
1. The deluge-shell client was written by Sadrul and hasn't been updated in some time. I'll try to take a look at it at somepoint to make it work, but perhaps someone out there would like to step-up and maintain it?

2. That's strange. There have been a few revisions that killed torrents.state compatibility, but that hasn't happened for some time. When you do get that exception, try checking above for a different exception.. It might give us some clues as to why this is happening.

4. Yes, the debug messages we'll need to be removed or printed to a log file. I will likely be adding switches in to enable debug prints in the release version, but for now they stay during our development phase.
oshiri
Member
Member
Posts: 40
Joined: Thu Nov 29, 2007 10:34 am

Re: 0.6 Development Report

Post by oshiri »

2. That's strange. There have been a few revisions that killed torrents.state compatibility, but that hasn't happened for some time. When you do get that exception, try checking above for a different exception.. It might give us some clues as to why this is happening.
I will try reproduce Debug error when new svn comming out.


For the deluge shell, I got add torrent working. Delete torrent not yet.
This is what i change, base on the earlier code : http://www.pidgin.im/~sadrul/pp/deluge-shell.py

Code: Select all

class NullUI:
	def __init__(self, args):
		print "Welcome to deluge-shell. Type 'help' to see a list of available commands."

		readline.read_init_file()

		while True:
			inp = raw_input("> ")
			if len(inp) == 0:	break
			inp = inp.strip().split(" ")

			print ""
			cmd = inp[0]
			found = False
			if cmd not in commands:
				print "Invalid command!"
				commands['help'].execute([])
			else:
				command = commands[cmd]
				try:
					command.execute(inp)
					client.force_call()
				except deluge.error.NoCoreError, e:
					print "*** Operation failed. You are not connected to a deluge daemon."
					print "    Perhaps you want to 'connect' first."
					print ""
				#except deluge.error.InvalidTorrent, e:
				#	print "*** Operation failed. You tried to perform an operation on a non-existent torrent."
				#	print "    Use the 'info' command for the list of torrents."
				#	print ""

		print "Thanks."
oshiri
Member
Member
Posts: 40
Joined: Thu Nov 29, 2007 10:34 am

Re: 0.6 Development Report

Post by oshiri »

Forget about the fix I just posted.
There's nothing wrong with deluge shell add torrent. It is working.
The thing is, add torrent does not take " " even though there is space in the torrent name.

Ex: what will not work
add -p /home/xxx/torrent; "/home/xxx/torrent name something .torrent";
add -p /home/xxx/torrent; "torrent name something.torrent";

Ex: what will work
add -p /home/xxx/torrent; /home/xxx/torrent name something .torrent;
add -p /home/xxx/torrent; torrent name something.torrent;


Sorry, my mistake.

del/rm torrent still not working and will crash shell.

Code: Select all

> del 5339335e501b6053bce6875c0cf6eb46dd4c6138

Traceback (most recent call last):
  File "/usr/bin/deluge", line 7, in ?
    sys.exit(
  File "/var/lib/python-support/python2.4/deluge/main.py", line 68, in start_ui
    UI(options, args)
  File "/var/lib/python-support/python2.4/deluge/ui/ui.py", line 65, in __init__
    ui = NullUI(args)
  File "/var/lib/python-support/python2.4/deluge/ui/null/deluge_shell.py", line 341, in __init__
    client.force_call()
  File "/var/lib/python-support/python2.4/deluge/ui/client.py", line 303, in force_call
    self.core.do_multicall(block=block)
  File "/var/lib/python-support/python2.4/deluge/ui/client.py", line 89, in do_multicall
    for i, ret in enumerate(self._multi()):
  File "/var/lib/python-support/python2.4/deluge/xmlrpclib.py", line 949, in __getitem__
    raise Fault(item['faultCode'], item['faultString'])
deluge.xmlrpclib.Fault: <Fault 1: 'exceptions.TypeError:export_remove_torrent() takes exactly 4 arguments (2 given)'>
oshiri
Member
Member
Posts: 40
Joined: Thu Nov 29, 2007 10:34 am

Re: 0.6 Development Report

Post by oshiri »

I think deluge.desktop should default to deluge -u web.
Else, if you run deluge with different ui from command line, it will screwed if you want to run from menu, as ui.conf has been change. Config defaults: {'selected_ui': 'gtk'} does not help.

deluge.dektop

Code: Select all

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Deluge BitTorrent Client
Comment=Bittorrent client written in PyGTK
Exec=deluge -u gtk
Icon=deluge.png
Terminal=false
Type=Application
Categories=Application;Network
StartupNotify=true
MimeType=application/x-bittorrent;
p/s : typo: I think deluge.desktop should default to deluge -u gtk
Last edited by oshiri on Fri Apr 04, 2008 3:24 am, edited 2 times in total.
andar
Top Bloke
Top Bloke
Posts: 1050
Joined: Fri Jun 08, 2007 8:38 pm
Location: Victoria, BC
Contact:

Re: 0.6 Development Report

Post by andar »

oshiri wrote:I think deluge.desktop should default to deluge -u web.
Else, if you run deluge with different ui from command line, it will screwed if you want to run from menu, as ui.conf has been change. Config defaults: {'selected_ui': 'gtk'} does not help.

deluge.dektop

Code: Select all

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Deluge BitTorrent Client
Comment=Bittorrent client written in PyGTK
Exec=deluge -u gtk
Icon=deluge.png
Terminal=false
Type=Application
Categories=Application;Network
StartupNotify=true
MimeType=application/x-bittorrent;
Yea, eventually I'll change the settings to have a 'default_ui' instead, so when you run 'deluge' it will run the default, unless you use the --ui switch to select a different one. But you're right, the desktop file should always use the gtkui irregardless of default.
Post Reply