Commit Graph

8084 Commits

Author SHA1 Message Date
bendikro f96b9c8a23 [Lint] Enable pylint warning super-init-not-called 2016-11-03 10:45:00 +00:00
Calum Lind d8242b4ef0 [Lint] Replace R with actual symbols in Pylint rcfile 2016-11-03 10:45:00 +00:00
Calum Lind f664fcb7a6 [Lint] Update pylint rcfile
* Merge in pylint 1.6.4 rcfile changes.
 * Add future_builtins to redefined-builtins-modules ignore list. (should be pylint default!)
	- Removed pylint disable comments from files.
 * Rearrange disable section, comments must be at start of line but can be
   interspersed to highlight categories.
 * Conventions enabled:
	wrong-import-position
	wrong-import-order
2016-11-03 10:45:00 +00:00
Calum Lind 5c7a4549f7 [Tests] Add pillow dep so pylint parses Win32IconImagePlugin 2016-11-03 10:45:00 +00:00
bendikro a04718ebe5 [#2797][Lint] Enable no-init pylint warning 2016-11-03 10:44:48 +00:00
bendikro 59d8fc9a14 [Lint] Fix pylint warnings 2016-11-03 10:31:38 +00:00
Calum Lind a438f13647 Rename classic to standalone 2016-11-02 23:14:05 +00:00
Calum Lind 23ba57313a [Core] Support new libtorrent 1.1 alert and status attributes
* Keep deprecated lt attribute support for the interim.
2016-11-02 22:08:28 +00:00
Calum Lind 7f24a1a42d [Core] Add support for new lt settings_pack 2016-11-02 22:08:21 +00:00
Calum Lind 05566894ad [Core] [UI] Remove deprecated lt extensions
* These extensions have been deprecated in 1.1 so simply remove usage.
2016-11-02 21:55:53 +00:00
Calum Lind 4dc59b5255 [Core] Remove compact allocation references
* This has been removed from lt 1.1 so no longer relevant.
2016-11-02 21:55:24 +00:00
Calum Lind 08192033fb [GTKUI] Refactor piecesbar code 2016-11-01 14:27:50 +00:00
bendikro 2f4cb0156c [Tests] Fix for isort config package handling
* Force gtk modules to be third_party for tox/travis testing.
2016-11-01 14:04:14 +00:00
bendikro e26a3dc0e7 [Tests] Move test torrents into data subdir 2016-11-01 12:28:08 +00:00
bendikro e827420569 [Tests] Increase file descriptor limit
Increase the file descriptor limit to avoid 'Too many files open'
error when running tests.
2016-11-01 12:28:08 +00:00
bendikro e379e035c7 [#2849] Fix WebUI error without translation MO file 2016-11-01 12:05:36 +00:00
bendikro 6de2813c3d [#2784] Fix typo in bugfix 5f92810f 2016-11-01 11:57:11 +00:00
bendikro 20bae1bf90 [Console] Rewrite of the console code
This commit is a rewrite of larger parts of the console code. The
motivation behind the rewrite is to cleanup the code and reduce code
duplication to make it easier to understand and modify, and allow any
form of code reuse. Most changes are to the interactive console, but
also to how the different modes (BaseMode subclasses) are used and set
up.

* Address [#2097] - Improve match_torrent search match:
  Instead of matching e.g. torrent name with name.startswith(pattern)
  now check for asterix at beginning and end of pattern and search
  with startswith, endswith or __contains__ according to the pattern.

Various smaller fixes:
* Add errback handler to connection failed
* Fix cmd line console mixing str and unicode input
* Fix handling delete backwards with ALT+Backspace
* Fix handling resizing of message popups
* Fix docs generation warnings
* Lets not stop the reactor on exception in basemode..
* Markup for translation arg help strings

* Main functionality improvements:
 - Add support for indentation in formatting code in popup messages (like help)
 - Add filter sidebar
 - Add ComboBox and UI language selection
 - Add columnsview to allow rearranging the torrentlist columns
   and changing column widths.
 - Removed Columns pane in preferences as columnsview.py is sufficient
 - Remove torrent info panel (short cut 'i') as the torrent detail view
   is sufficient

* Cleanups and code restructuring
  - Made BaseModes subclass of Component
  - Rewrite of most of basic window/panel to allow easier code reuse
  - Implemented better handling of multple popups by stacking popups. This
    makes it easier to return to previous popup when opening multiple popups.

* Refactured console code:
  - modes/ for the different modes
    - Renamed Legacy mode to CmdLine
    - Renamed alltorrent.py to torrentlist.py and split the code into
      - torrentlist/columnsview.py
      - torrentlist/torrentsview.py
      - torrentlist/search_mode.py (minor mode)
      - torrentlist/queue_mode.py (minor mode)
  - cmdline/ for cmd line commands
  - utils/ for utility files
  - widgets/ for reusable GUI widgets
    - fields.py: Base widgets like TextInput, SelectInput, ComboInput
    - popup.py: Popup windows
    - inputpane.py: The BaseInputPane used to manage multiple base widgets in a panel
	- window.py: The BaseWindow used by all panels needing a curses screen
    - sidebar.py: The Sidebar panel
    - statusbars.py: The statusbars
  - Moved option parsing code from main.py to parser.py
2016-10-30 12:45:04 +00:00
bendikro 2f8b4732b4 [#2838] [Console] Fix formatting on 'Moving' color 2016-10-30 12:45:03 +00:00
bendikro 79c59a2b1e [#2099] [Console] Fix: console does not support monochrome terminals
When a terminal does not support colors we invert the
default color pair white,black to indicate selection with
white background and black foreground
2016-10-30 12:45:03 +00:00
bendikro 51c44a7c5a [Console] Remove the delay after pressing ESC key
The env variable ESCDELAY specifies the time in ms which ncurses waits
for a character sequence. With a default value of 1000, it produces a
1 second delay when pressing the ESC key to close dialogs.

Set this variable to 0 to get instant respons when pressing ESC.
2016-10-30 12:45:03 +00:00
bendikro 64da09675e [#1119] [Console] ignore logging when no file specified
Add wrapper around the stream passed to the loggers streamhandler
when no log file is specified. Console in interactive mode now
ignores the log output with no logfile specified.
2016-10-30 12:45:02 +00:00
bendikro 82fd5e6e8a [UI] Fix sorting in ui/util/lang.py.get_languages() 2016-10-30 12:45:02 +00:00
bendikro 1e183a3258 [UI] Add gettext.ngettext to __builtin__.__dict__
Handle plurality with getttext using ngettext. Added to
__builtin__.__dict__ as _n
2016-10-30 12:45:02 +00:00
bendikro 891209d925 [Common] Add overrides function decorator 2016-10-30 12:45:02 +00:00
bendikro 4d3cf756e4 [#2914] Fix: Specifying file version for default config 2016-10-30 12:45:02 +00:00
Calum Lind 27c87d56bb [Config] Sort the json keys in conf files 2016-10-29 13:26:56 +01:00
Calum Lind 72c588ad33 [WebUI] Modify UI to display single incoming port 2016-10-28 16:01:18 +01:00
bendikro 41fed16d08 [#2900] Fix Error loading torrent: invalid bencoded value
* Testing the torrent with other bencode libs doesn't raise exceptions
   so just revert the 'small fix' applied in b193d87499.
 * Add BTFailure exception so bdecode issue can be caught in deluge code.
2016-10-28 14:43:06 +01:00
Calum Lind 5607bb3d61 [GTKUI] Move Tab data funcs to new common file 2016-10-27 23:10:27 +01:00
Calum Lind fab0af1b40 [Oops] Remove introduced dead code by prev commit 2016-10-27 22:33:17 +01:00
Calum Lind b5afe90764 [GTKUI] Rearrange items in the UI tabs
* Move Private label to Trackers Tab.
 * Move Owner to Options Tab with a future plan for a dropdown box
   to change ownership.
 * Put the torrent status message into the progress bar.
 * Remove duplicate Shared label in Details Tab.
 * Details Tab allow more horizontal room for long folder paths
   and fix horizontal scrolling.
2016-10-27 22:19:00 +01:00
Calum Lind fef160e7a7 [Common] Use log.warning instead of error for download failure 2016-10-27 22:17:29 +01:00
Calum Lind e408dc14cc [#2417] [GTKUI] Add Last Active and modify layout of Status & Details Tabs 2016-10-27 13:11:50 +01:00
Calum Lind 257c31c05f [#2846] Fix splitting IPv6 from external IP alert message 2016-10-26 23:26:01 +01:00
Calum Lind 3f72905b3f Revert "[Py2to3] Clean-up the use of keys() on dictionary objects."
This reverts commit 8b50f3cdbd.
2016-10-26 19:14:10 +01:00
Giorgos Retsinas c4282f29ab [GtkUI] Refactor out duplicate code in piecesbar draw pieces 2016-10-26 10:50:22 +01:00
Calum Lind 642913b0f8 Revert "[Py2to3] Replace iteritems and itervalues"
This reverts commit 7ad8a3cbb5.
2016-10-26 10:49:41 +01:00
Calum Lind 2c3887ece9 [Py2to3] Use open() instead of file() 2016-10-26 09:58:44 +01:00
Calum Lind 9fab98a6ce [Py2to3] Passes libfuturize.fixes.fix_division_safe 2016-10-26 09:58:44 +01:00
Calum Lind 81334389a9 [Tests] Fix tests to run on Twisted < 13
* Also includes pylint fixes for W0233(non-parent-init-called)
 * Remove failing openbittorent icon test
2016-10-26 09:58:43 +01:00
Andrew Resch d579efa041 [Lint] Fix various pylint warnings and fixup code
* Use print function
 * Fix except as statements
 * Remove old twisted 8 code
 * Remove empty docstring
 * Refactor try statement to only contain the relevant import and
   disable pylint import msgs.
 * Use flake8 noqa and pylint comment and drop pyflakes workarounds.
2016-10-26 09:58:43 +01:00
Andrew Resch da4b2b4849 [Py2to3] Make VersionSplit Python 3 compatible.
The builtin cmp() and the __cmp__() special method is no longer used in Python 3, instead we use functools.total_ordering decorator and the __lt__/__eq__ special methods to get the same effect.
2016-10-26 09:58:43 +01:00
Andrew Resch da51e3a3d5 [Py2to3] A group of small compatiblity code changes
* Replace the uses of long with int.
 * Replace im_func with __func__ as it has been provided for Python 3 forward-compatibility.
 * Fix next/__next__ for Python 3 compatibility.
 * Remove the long number literal
 * Ensure freespace() returns int
2016-10-26 09:58:43 +01:00
Andrew Resch 837dae242c [Py2to3] Use future_builtins zip instead of izip for Py3 compat 2016-10-26 09:57:18 +01:00
Andrew Resch 7ad8a3cbb5 [Py2to3] Replace iteritems and itervalues
* Replace the use of iteritems() and itervalues() on dictionary objects
   with items() and values() respectively for Python 3 compatibility.
2016-10-26 09:53:32 +01:00
Andrew Resch 8b50f3cdbd [Py2to3] Clean-up the use of keys() on dictionary objects.
To make the code more Python 3 compatible, I've made a few changes to how we handle keys() or iterkeys() calls on dictionaries. All functionality should remain the same.

 * Remove the use of .keys() or .iterkeys() when iterating through a dictionary.
 * Remove the use of .keys() when checking if key exists in dictionary.
 * Replace dict.keys() with list(dict) to obtain a list of dictionary keys. In Python 3 dict.keys() returns a dict_keys object, not a list.
2016-10-26 09:53:32 +01:00
Calum Lind 16da4d851e [#2850] Fix duplicate ui log entries 2016-10-25 23:22:06 +01:00
Calum Lind a5bc73f0b3 [GTKUI] Use less verbose units to improve look and gain physical space
* Use markup in gtkui to reduce font size of displayed units.
 * Reduced statusbar item sizes using markup and <small> tag. Provides an
   interim solution to #1326 and has reduced width from 930px to ~600px.
 * Integer value for Progress bar value in Peers and Files Tabs.
 * Remove trailing zeros for Pieces size in Details Tab.
 * Change position of Share Ratio in Status Tab.
 * Increase minimum width of column from 10px to 20px for listview.
 * Use shortform units e.g. Columns, Title speed, Status tab, Status bar.
 * Use less precision displaying values in columns.
2016-10-25 23:22:06 +01:00
Calum Lind 258ad95b7a [Common] Enable use of precision and shortform units in unit funcs
* Also fixes #2562; add TiB unit.
2016-10-25 23:21:18 +01:00