Custom Query (2449 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (682 - 684 of 2449)

Ticket Resolution Summary Owner Reporter
#1117 Fixed [PATCH] can't press '3' key in deluge-console cdep_illabout
Description

deluge-console will not print a '3' when the '3' key is pressed.

It is due to this code block in trunk/deluge/ui/console/screen.py:

# Delete a character in the input string based on cursor position
if c == curses.KEY_BACKSPACE or c == 127:
    if self.input and self.input_cursor > 0:
        self.input = self.input[:self.input_cursor - 1] + self.input[self.input_cursor:]
        self.input_cursor -= 1

elif c == curses.KEY_DC or c == 51:
    if self.input and self.input_cursor < len(self.input):
        self.input = self.input[:self.input_cursor] + self.input[self.input_cursor + 1:]

The line 'elif c == curses.KEY_DC or c == 51:' should probably be just 'elif c == curses.KEY_DC:'

I'm not sure why the check for 'c == 51' was initially added, because 51 is the decimal ascii code for the number three, not the ascii code for Delete (which is 127, according to ​http://www.asciitable.com/).

The var c is originally obtained in a called to stdscr.getch(). I did some testing with getch() to see what values were returned for the Delete key, the Backspace key, and Ctrl-H.

On my box, the Delete key returns the value 330. The Backspace key returns the value 127. Ctrl-H returns the value 263. Maybe these values vary by terminal type?

I checked python's documentation for these different values (​http://docs.python.org/library/curses.html#constants), and it looks like KEY_DC is pretty safe to use. KEY_BACKSPACE has a warning that it is unreliable, but KEY_DC has no such warning. So KEY_DC is probably safe to use and relatively portable? Hopefully.

#1119 Fixed logging doesn't work with deluge-console because of ncurses nick cdep_illabout
Description

Deluge uses the Python "logging" module for warnings, errors, and debugging statements. By default, the logging module outputs everything to stderr (or stdout?). But this does not work with deluge-console, because it is using ncurses. Anything written to stdout or stderr will not print out correctly when using a program written in ncurses.

(All the debugging statements do work correctly when using deluge-console and logging to a file instead of the terminal.)

I've come up with a couple different solutions to this.

  1. Error out when the user tries to run deluge-console with a log level above "none" and does not specify a logfile.
  1. Buffer all the logging output and print it to the console right before deluge-console closes. (After stdscr.endwin() is called.)
  1. Write a wrapper around the LOG object (from deluge.log) that creates an event every time something is output to the log. Then deluge-console can catch this event and print the log message just like its own output (within its own terminal). The only downside of this is that there could be no use of log.error() or log.debug() or similar functions within the functions that print to the terminal in deluge-console. This includes ConsoleUI.write() and Screen.addline().

I would be willing to work on implementing any of these, but I don't want to start work on something that definitely won't be accepted.

#1143 Fixed [PATCH] deluge-console crashs when autocompleting non-existing dir cdep_illabout
Description

deluge-console's add command will cause a crash when tab-completing a directory that does not exist.

For instance, entering this into deluge-console will cause a crash:

add non-existing-dir/some-file[TAB]

add's tab-complete method will try to list the files in "non-existing-dir/", but throw an error because the directory does not exist.

I have attached a (very small) patch to fix the issue.

Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.