First release of curses interface

Discussion of Transmission that doesn't fit in the other categories
fagga
Posts: 37
Joined: Thu Oct 23, 2008 1:42 pm

First release of curses interface

Post by fagga »

I'm releasing a first version of my curses interface for the daemon. It displays basic information about torrents and you can do basic things like adjusting upload/download limits and pausing/removing/verifying torrents. If your daemon doesn't listen on localhost:9091, you have to provide this information as a command line argument, for example: transmission-remote-cli.py remotehost:1234
Authentication isn't implemented yet.

It's written in Python, so you need a working Python installation. I'm not quite sure about what version is needed. I'm using 2.5.2.

As mentioned before, I'm planning to implement a detailed view for single torrents, where the user can get as much information as possible. Any further feature requests, bugreports and suggestions are very welcome.

I would like to add the script as an attachment to this post, but it always says that the extension isn't allowed. I tried py, gz, txt and nothing. What extensions are allowed? I don't have any webspace, so I'm stuck here.
pea
Posts: 381
Joined: Tue Apr 17, 2007 11:02 pm
Location: estonia, earth

Re: First release of curses interface

Post by pea »

hi fagga,

if that isn't too long,
just try Code tags
fagga
Posts: 37
Joined: Thu Oct 23, 2008 1:42 pm

Re: First release of curses interface

Post by fagga »

It's 806 lines, 28KB long. Posting this as code would be pretty inconvenient.

Anyhow: Why is everyone calling me lucky charms? Is this some conspiracy thing in this forum? Not hat I'm having trouble with it, I'm just curious.
mezz
Posts: 142
Joined: Mon Apr 30, 2007 6:53 pm

Re: First release of curses interface

Post by mezz »

There are very many free hosting out there. ;-) You can use sourceforge.net or some free git/hg hosting like this:

http://repo.or.cz/
http://gitorious.org/
http://github.com/
http://www.selenic.com/mercurial/wiki/i ... ialHosting

Or you can create a new ticket and attach your Python script.

http://trac.transmissionbt.com/timeline
pea
Posts: 381
Joined: Tue Apr 17, 2007 11:02 pm
Location: estonia, earth

Re: First release of curses interface

Post by pea »

fagga wrote:Why is everyone calling me lucky charms? Is this some conspiracy thing in this forum?
yea, sure..
it's a conspiracy thing here..

we just came to an agreement (all forum members, you see) that we are calling you as Lucky Charms :wink:
fagga
Posts: 37
Joined: Thu Oct 23, 2008 1:42 pm

Re: First release of curses interface

Post by fagga »

Phew. I finally got the script off my PC into the internet!
Actually, I don't think that such a small script needs a version system like git, so I chose the ticket solution: http://trac.transmissionbt.com/ticket/1412

If you guys like my script, maybe it could get a single page in the wiki, just some explaining words, maybe a screenshot and a download link?

pea wrote:we just came to an agreement (all forum members, you see) that we are calling you as Lucky Charms :wink:
Well, if that's the whole initiation rite, I can sure live with that. (:
fagga
Posts: 37
Joined: Thu Oct 23, 2008 1:42 pm

Re: First release of curses interface

Post by fagga »

Jordan wrote:Looks like perhaps there's problem handling utf-8 encodings. any ideas?
Yes, you where right. To manage all this encoding and decoding stuff is always the hardest part for me when doing terminal applications.
I think I found the problem and it worked for me with a test torrent file which contains non-ascii characters. But: single non-ascii characters are still counted as two (maybe more) characters which messes up the table slightly. But it should be usable anyhow if there are not too much special chars.
Jordan wrote:Also, there probably needs to be a copyright notice at the top of the file...
My second weakness. (:
fagga
Posts: 37
Joined: Thu Oct 23, 2008 1:42 pm

Re: First release of curses interface

Post by fagga »

I just attached a new version to the ticket: http://trac.transmissionbt.com/attachme ... ote-cli.py

It uses locales, so there should be no problems with wide characters anymore.
Besides, I did some structural rewrites and it should be more responsive and less cpu hungry.
Jordan
Transmission Developer
Posts: 2311
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: First release of curses interface

Post by Jordan »

It's now crashing at a different point in the file. This is probably a Good Thing, since it's progress :)

Code: Select all

Traceback (most recent call last):
  File "./transmission-remote-cli.py", line 866, in <module>
    ui = Interface(HOST, PORT)
  File "./transmission-remote-cli.py", line 339, in __init__
    curses.wrapper(self.run)
  File "/usr/lib64/python2.5/curses/wrapper.py", line 44, in wrapper
    return func(stdscr, *args, **kwds)
  File "./transmission-remote-cli.py", line 416, in run
    self.draw_torrentlist()
  File "./transmission-remote-cli.py", line 524, in draw_torrentlist
    self.draw_torrentitem(self.torrents[i], (i == self.focus), ypos, 0)
  File "./transmission-remote-cli.py", line 546, in draw_torrentitem
    self.draw_torrent_status(info, focused, y)
  File "./transmission-remote-cli.py", line 617, in draw_torrent_status
    line = status
UnboundLocalError: local variable 'status' referenced before assignment
I'm looking forward to seeing this in action. :)
fagga
Posts: 37
Joined: Thu Oct 23, 2008 1:42 pm

Re: First release of curses interface

Post by fagga »

You must have some torrent in a state that isn't documented. Strange. But this shouldn't happen again now.
I'm curious if it will ever run on any computer which is not mine... :)
Jordan
Transmission Developer
Posts: 2311
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: First release of curses interface

Post by Jordan »

Hey, it's working! This looks like a great initial cut, too!
fagga
Posts: 37
Joined: Thu Oct 23, 2008 1:42 pm

Re: First release of curses interface

Post by fagga »

I'm glad you like it.
The resizing problem is a known bug, it happens only when shrinking the window.
fagga
Posts: 37
Joined: Thu Oct 23, 2008 1:42 pm

Re: First release of curses interface

Post by fagga »

Just did another release which fixed the crash on shrinking bug.
And I think I'm gonna put it on one of those hosting services after all. This is getting too stupid.
theCrank
Posts: 249
Joined: Sat Jun 28, 2008 8:01 am
Location: Karlsruhe, Germany

Re: First release of curses interface

Post by theCrank »

I've got some unused webspace lying around. You can upload your interface if you like to.
Jordan
Transmission Developer
Posts: 2311
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: First release of curses interface

Post by Jordan »

fagga wrote:Just did another release which fixed the crash on shrinking bug.
And I think I'm gonna put it on one of those hosting services after all.
I think that's a good idea. It's to early to put this in the Transmission tarball, but it's looking good, and the bugfixes are coming fast & furious, so I'd like to be able to link to it from the Transmission homepage... :)
Post Reply