Commits

Erik Svensson committed fd04789

Updated documentation to use new methods in examples.
Updated CHANGELOG.
Fixed helical list string.
Updated copyright year.

Comments (0)

Files changed (16)

 Transmissionrpc 0.9
 -------------------
 
+Fixed message handling in TransmissionError. Issue #35. Thanks Adam Rothman.
+Made Client.start_all honour queue order. Thanks stephenharrell.
+Changed interface for Client.
+Added mutators to Torrent and Session.
+
 Transmissionrpc 0.8
 -------------------
 
-Copyright (c) 2008-2011 Erik Svensson
+Copyright (c) 2008-2013 Erik Svensson
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 Getting started
 ===============
 
-transmissionrpc 0.9 is compatible with Transmission 1.31 - 2.41.
+transmissionrpc 0.9 is compatible with Transmission 1.31 - 2.76.
 
 Requirements
 ------------
 
 transmissionrpc is hosted by bitbucket at http://www.bitbucket.org/blueluna/transmissionrpc/.
 
-Copyright (c) 2008-2011 Erik Svensson.
+Copyright (c) 2008-2013 Erik Svensson.

contrib/helical.py

                 print(self._torrent_brief(torrent))
 
     def _torrent_brief_header(self):
-        return u' Id  Done   ETA           Status       Download    Upload      Ratio  Name'
+        return u' Id   Done   ETA           Status       Download     Upload       Ratio  Name'
 
     def _torrent_brief(self, torrent):
         s = u'% 3d: ' % (torrent.id)
         except:
             pass
         try:
-            if torrent.fields['eta'] > 0:
-                s += u' %- 13s' % torrent.format_eta()
-            else:
-                s += u' -            '
+            s += u' %- 13s' % torrent.format_eta()
         except:
-            pass
+            s += u' -            '
         try:
             s += u' %- 12s' % torrent.status
         except:
             s += u' -status     '
             pass
         try:
-            s += u' %5.1f %- 5s' % format_speed(torrent.rateDownload)
-            s += u' %5.1f %- 5s' % format_speed(torrent.rateUpload)
+            s += u' %6.1f %- 5s' % format_speed(torrent.rateDownload)
+            s += u' %6.1f %- 5s' % format_speed(torrent.rateUpload)
         except:
-            s += u' -rate     '
-            s += u' -rate     '
+            s += u' -rate      '
+            s += u' -rate      '
             pass
         try:
-            s += u' %6.2f' % torrent.ratio
+            s += u' %4.2f  ' % torrent.ratio
         except:
             s += u' -ratio'
             pass
 # -*- coding: utf-8 -*-
-# Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
+# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
 # Licensed under the MIT license.
 #
 # Vxl documentation build configuration file, created by
 
 # General substitutions.
 project = 'Transmission RPC'
-copyright = '2008-2011, Erik Svensson'
+copyright = '2008-2013, Erik Svensson'
 
 # The default replacements for |version| and |release|, also used in various
 # other places throughout the built documents.
 ..
-    Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
+    Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
     Licensed under the MIT license.
 
 Transmission RPC
 
 This is **transmissionrpc**. This module helps using Python to connect
 to a Transmission_ JSON-RPC service. transmissionrpc is compatible with
-Transmission 1.3 and later.
+Transmission 1.31 and later.
 
 transmissionrpc is licensed under the MIT license.
 
 
     >>> import transmissionrpc
     >>> tc = transmissionrpc.Client('localhost', port=9091)
-    >>> tc.list()
+    >>> tc.get_torrents()
 
 List will return a dictionary of Torrent object indexed by their id. You might
 not have any torrents yet. This can be remedied by adding an torrent.
 ::
 
-    >>> tc.add_url('http://releases.ubuntu.com/8.10/ubuntu-8.10-desktop-i386.iso.torrent')
+    >>> tc.add_torrent('http://releases.ubuntu.com/8.10/ubuntu-8.10-desktop-i386.iso.torrent')
     {1: <Torrent 1 "ubuntu-8.10-desktop-i386.iso">}
-    >>> tc.info(1)
+    >>> tc.get_torrent(1)
     {1: <Torrent 1 "ubuntu-8.10-desktop-i386.iso">}
 
 As you saw, the add_url and info calls also returns a dictionary with
 found in the Torrent object.
 ::
 
-    >>> torrent = tc.info(1)[1]
+    >>> torrent = tc.get_torrent(1)[1]
     >>> torrent.name
     'ubuntu-8.10-desktop-i386.iso'
     >>> torrent.hashString
 
 ::
 
-    >>> tc.stop(1)
-    >>> tc.remove('33820db6dd5e5928d23bc811bbac2f4ae94cb882')
+    >>> tc.stop_torrent(1)
+    >>> tc.remove_torrent('33820db6dd5e5928d23bc811bbac2f4ae94cb882')
 
 See what we did there? most methods in transmissionrpc can take both torrent id
 and torrent hash when referring to a torrent. lists and sequences are also
 supported.
 
-    >>> tc.info([2, 'caff87b88f50f46bc22da3a2712a6a4e9a98d91e'])
+    >>> tc.get_torrents([2, 'caff87b88f50f46bc22da3a2712a6a4e9a98d91e'])
     {2: <Torrent 2 "ubuntu-8.10-server-amd64.iso">, 3: <Torrent 3 "ubuntu-8.10-alternate-amd64.iso">}
-    >>> tc.info('1:3')
+    >>> tc.get_torrents('1:3')
     {2: <Torrent 2 "ubuntu-8.10-server-amd64.iso">, 3: <Torrent 3 "ubuntu-8.10-alternate-amd64.iso">}
 
 Continue to explore and have fun! For more in depth information read the module

doc/reference/transmissionrpc.rst

 ..
-	Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
+	Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
 	Licensed under the MIT license.
 
 
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
-# Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
+# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
 # Licensed under the MIT license.
 
 from setuptools import setup

transmissionrpc/__init__.py

 # -*- coding: utf-8 -*-
-# Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
+# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
 # Licensed under the MIT license.
 
 from transmissionrpc.constants import DEFAULT_PORT, DEFAULT_TIMEOUT, PRIORITY, RATIO_LIMIT, LOGGER
 
 __author__    = u'Erik Svensson <erik.public@gmail.com>'
 __version__   = u'0.9'
-__copyright__ = u'Copyright (c) 2008-2011 Erik Svensson'
+__copyright__ = u'Copyright (c) 2008-2013 Erik Svensson'
 __license__   = u'MIT'

transmissionrpc/client.py

 # -*- coding: utf-8 -*-
-# Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
+# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
 # Licensed under the MIT license.
 
 import re, time, operator, warnings

transmissionrpc/constants.py

 # -*- coding: utf-8 -*-
-# Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
+# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
 # Licensed under the MIT license.
 
 import logging

transmissionrpc/error.py

 # -*- coding: utf-8 -*-
-# Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
+# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
 # Licensed under the MIT license.
 
 class TransmissionError(Exception):

transmissionrpc/httphandler.py

 # -*- coding: utf-8 -*-
-# Copyright (c) 2011 Erik Svensson <erik.public@gmail.com>
+# Copyright (c) 2011-2013 Erik Svensson <erik.public@gmail.com>
 # Licensed under the MIT license.
 
 import sys, httplib, urllib2

transmissionrpc/session.py

 # -*- coding: utf-8 -*-
-# Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
+# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
 # Licensed under the MIT license.
 
 from transmissionrpc.utils import Field

transmissionrpc/torrent.py

 # -*- coding: utf-8 -*-
-# Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
+# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
 # Licensed under the MIT license.
 
 import sys, datetime

transmissionrpc/utils.py

 # -*- coding: utf-8 -*-
-# Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
+# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
 # Licensed under the MIT license.
 
 import socket, datetime, logging
         loghandler.setLevel(loglevel)
     trpc_logger.addHandler(loghandler)
 
-Field = namedtuple('Field', ['value', 'dirty'])
+Field = namedtuple('Field', ['value', 'dirty'])