Commits

Anonymous committed 43fc595

Better documentation. Parse tvrss feeds.

  • Participants
  • Parent commits 2f1e93a
  • Tags release-0.1

Comments (0)

Files changed (7)

 # -*- coding: utf-8 -*-
 #
-# Växel documentation build configuration file, created by
+# Vxl documentation build configuration file, created by
 # sphinx-quickstart on Tue Jul 15 14:28:42 2008.
 #
 # This file is execfile()d with the current directory set to its containing dir.
 master_doc = 'index'
 
 # General substitutions.
-project = 'Vxl'
+project = 'Transmission'
 copyright = '2008, Erik Svensson'
 
 # The default replacements for |version| and |release|, also used in various
 #html_file_suffix = ''
 
 # Output file base name for HTML help builder.
-htmlhelp_basename = 'Vxldoc'
+htmlhelp_basename = 'trdoc'
 
 
 # Options for LaTeX output
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, document class [howto/manual]).
 latex_documents = [
-  ('index', 'Vxl.tex', 'Vxl Documentation', 'Erik Svensson', 'manual'),
+  ('index', 'Transmission.tex', 'Transmission Documentation', 'Erik Svensson', 'manual'),
 ]
 
 # The name of an image file (relative to this directory) to place at the top of

File doc/index.rst

 
     $ python setup.py install
 
-This will install the transmission module and vxl cli.
+This will install the transmission module.
 
 Dependecies
 -----------
 
  * simplejson 1.7.1 or later
 
+Developers
+==========
+
+Transmission is hosted at bitbucket_ using mercurial_. To pull a working copy, run
+
+::
+
+   $ hg pull http://www.bitbucket.org/blueluna/transmission/
+
+Then install the module using
+
+::
+
+    $ python setup.py install
+
+Explore and have fun!
+
+.. _bitbucket: http://www.bitbucket.org/blueluna/transmission/
+.. _mercurial: http://www.selenic.com/mercurial
+
 Module reference
 ================
 

File doc/reference/transmission.rst

 .. autoclass:: Torrent
    :members:
    :undoc-members:
+.. autoclass:: Session
+   :members:
+   :undoc-members:
 .. autoclass:: Client
    :members:
    :undoc-members:
 # -*- coding: utf-8 -*-
 # 2008-10, Erik Svensson <erik.public@gmail.com>
 
+import re, datetime
 import feedparser
+import transmission
+
+tvrss_field_parse = re.compile('\s*([^:]+)\s*:\s*(.+)\s*')
+quality_identifiers = ['DSR', 'DSRIP', 'PDTV', 'HDTV', 'WS', '720P']
+
+def tvrss_parser(entries):
+    items = []
+    for entry in entries:
+        #print(entry)
+        item = {}
+        if 'title' in entry:
+            start = entry.title.rfind('[')
+            end = entry.title.rfind(']')
+            if start and end >= 0:
+                fields = entry.title[start+1:end].split('-')
+                if len(fields) == 0:
+                    print(fields)
+                else:
+                    item['Group'] = fields[-1].strip()
+                    item['Quality'] = [field.strip() for field in fields[:-1]]
+                    for field in item['Quality']:
+                        if field not in quality_identifiers:
+                            print('Unknown quality: ' + field)
+            #item['Title'] = entry.title
+        if 'summary' and 'link' in entry:
+            fields = entry.summary.split(';')
+            item['Link'] = entry.link
+            for field in fields:
+                match = tvrss_field_parse.match(field)
+                if match:
+                    (key, value) = match.groups()
+                    if key == 'Episode Date':
+                        item[key] = datetime.datetime.strptime(value, '%Y-%m-%d')
+                    elif value != 'n/a':
+                        item[key] = value
+                else:
+                    print('no match: %s' % (field))
+            items.append(item)
+    return items
 
 # http://feedparser.org/docs/
 
 # feeds:
 # http://www.mininova.org/rss.xml?user=EZTV
 # http://tvrss.net/
-# http://www.torrentleech.org/ <- invite only
 
-#feed = feedparser.parse('http://tvrss.net/search/index.php?show_name=NCIS&show_name_exact=true&mode=rss')
-feed = feedparser.parse('http://www.mininova.org/rss.xml?user=EZTV')
+feed = feedparser.parse('http://tvrss.net/feed/unique/')
 
 print(feed.feed.title)
 print(feed.feed.subtitle)
+print('')
 
-for entry in feed.entries:
-    for k, v in entry.iteritems():
-        print('% 16s: %s' % (k, v))
+items = tvrss_parser(feed.entries)
+
+tr_client = transmission.Client()
+
+for item in items:
+    show = ''
+    if 'Show Name' and 'Show Title' in item:
+        show = item['Show Name'] + ' - ' + item['Show Title']
+    elif 'Show Name' in item:
+        show = item['Show Name']
+    elif 'Show Title' in item:
+        show = item['Show Title']
+    show += ' : '
+    if 'Season' and 'Episode' in item:
+        show += item['Season'] + ' - ' + item['Episode']
+    elif 'Episode Date' in item:
+        show += item['Episode Date'].strftime('%Y-%m-%d')
+    if 'Quality' in item:
+        show += ' : ' + '|'.join(item['Quality'])
+    if 'Group' in item:
+        show += ' : ' + item['Group']
+    print(show)
+    
+    
+    if 'Show Name' and 'Link' in item:
+        if item['Show Name'] == 'Pushing Daisies':
+            tr_client.add_url(item['Link'])
         self.intro = u'Helical %s' % (__version__)
         self.verbose = False
         self.set_daemon()
+        self.doc_leader = u'''
+Helical is a command line interface that communicates with Transmission
+bittorent client through json-rpc. To run helical in interactive mode
+start without a command.
+'''
     
     def set_daemon(self, address=None):
         if address:
         return self._complete_torrent(item, endidx - begidx)
     
     def help_quit(self):
-        print(u'Terminate.\n')
-        print(u'(quit|exit)\n')
+        print(u'quit|exit\n')
+        print(u'Exit to shell.\n')
     
     def do_quit(self, line):
         sys.exit('')
     do_EOF = do_quit
     
     def help_add(self):
+        print(u'add <torrent file or url> [<target dir> paused=(yes|no) peer-limit=#]\n')
         print(u'Add a torrent to the transfer list.\n')
-        print(u'add <torrent file or url> [<target dir> paused=yes|no peer-limit=#]\n')
 
     def do_add(self, line):
         args = self.arg_tokenize(line)
         return self._complete_torrent_command(text, line, begidx, endidx)
     
     def help_remove(self):
+        print(u'remove <torrent id> [,<torrent id>, ...]\n')
         print(u'Remove one or more torrents from the transfer list.\n')
-        print(u'remove <torrent id>(, <torrent id>)\n')
     
     def do_remove(self, line):
         args = self.arg_tokenize(line)
         return self._complete_torrent_command(text, line, begidx, endidx)
     
     def help_start(self):
+        print(u'start <torrent id> [,<torrent id>, ...]\n')
         print(u'Start one or more queued torrent transfers.\n')
-        print(u'start <torrent id>(, <torrent id>)\n')
     
     def do_start(self, line):
         args = self.arg_tokenize(line)
         return self._complete_torrent_command(text, line, begidx, endidx)
     
     def help_stop(self):
+        print(u'stop <torrent id> [,<torrent id>, ...]\n')
         print(u'Stop one or more active torrent transfers.\n')
-        print(u'stop <torrent id>(, <torrent id>)\n')
     
     def do_stop(self, line):
         args = self.arg_tokenize(line)
         return self._complete_torrent_command(text, line, begidx, endidx)
     
     def help_verify(self):
+        print(u'verify <torrent id> [,<torrent id>, ...]\n')
         print(u'Verify one or more torrent transfers.\n')
-        print(u'verify <torrent id>(, <torrent id>)\n')
     
     def do_verify(self, line):
         args = self.arg_tokenize(line)
         return self._complete_torrent_command(text, line, begidx, endidx)
     
     def help_info(self):
+        print(u'info [<torrent id>, ...]\n')
         print(u'Get details for a torrent. If no torrent id is provided, all torrents are displayed.\n')
-        print(u'info (<torrent id>, <torrent id>)\n')
     
     def do_info(self, line):
         args = self.arg_tokenize(line)
             print(self._torrent_detail(torrent))
     
     def help_list(self):
+        print(u'list\n')
         print(u'List all torrent transfers.\n')
-        print(u'list\n')
     
     def do_list(self, line):
         args = self.arg_tokenize(line)
         self._list_torrents(result)
     
     def help_files(self):
+        print(u'files [<torrent id>, ...]\n')
         print(u'Get the file list for one or more torrents\n')
-        print(u'files (<torrent id>, <torrent id>)\n')
     
     def do_files(self, line):
         args = self.arg_tokenize(line)
         return self.word_complete(text, [u'get', u'set', u'stats'])
     
     def help_session(self):
+        print(u'session (get|stats)\n')
         print(u'Get session parameters or session statistics.\n')
-        print(u'session (get|stats)\n')
     
     def do_session(self, line):
         args = self.arg_tokenize(line)
-        if args[0] == u'get':
+        if len(args[0]) == 0 or args[0] == u'get':
             self.tc.get_session()
             print(self.tc.session)
         elif args[0] == u'stats':
             print(self.tc.session_stats())
-        else:
-            raise NotImplementedError(line)
     
     def do_request(self, line):
         (method, sep, args) = line.partition(' ')

File transmission.wpr

                         'watch_for_changes': True}]
 proj.file-type = 'normal'
 [user attributes]
-debug.breakpoints = {loc('transmission/transmission.py'): {271: (0,
-        None,
-        1,
-        0)},
-                     loc('../../../../usr/lib/python2.5/urllib2.py'): {786: (0,
+debug.breakpoints = {loc('../../../../usr/lib/python2.5/urllib2.py'): {786: (0,
         None,
         1,
         0),
               1,
               0)}}
 debug.err-values = {loc('supervisor.py'): {}}
+debug.exceptions-ignored = {loc('x-wingide-zip:///usr/local/lib/python2.5/site-packages/feedparser-4.1-py2.5.egg//feedparser.py'): {233: True}}
 debug.run-args = {loc('supervisor.py'): '-v --user=palle --password=kuling',
                   loc('vxl.py'): 'add http://se.releases.ubuntu.com/8.10/ubu'\
                                  'ntu-8.10-beta-desktop-i386.iso.torrent'}
 guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
                             'windows': [{'name': 'qPguEXNTYer8PIvrydBBB1WsWh'\
         'XxT728',
-        'size-state': 'maximized',
+        'size-state': '',
         'type': 'dock',
         'view': {'area': 'tall',
                  'current_pages': [2],
                                {'tree-state': {'file-sort-method': 'by name',
         'list-files-first': 0,
         'tree-states': {'deep': {'column-widths': [1.0],
-                                 'expanded-nodes': [(3,)],
-                                 'selected-nodes': [(3,
-        2)],
+                                 'expanded-nodes': [],
+                                 'selected-nodes': [],
                                  'top-node': (0,)}},
         'tree-style': 'deep'}})],
                  'primary_view_state': {'area': 'wide',
                       'wide',
                       1,
                       {'attrib-starts': [],
-                       'first-line': 0,
+                       'first-line': 79,
                        'folded-linenos': [],
                        'history': {},
-                       'sel-line': 1,
-                       'sel-line-start': 69,
-                       'selection_end': 69,
-                       'selection_start': 69}),
+                       'sel-line': 84,
+                       'sel-line-start': 1161,
+                       'selection_end': 1176,
+                       'selection_start': 1161}),
                      ('debug-exceptions',
                       'wide',
                       0,
                       'wide',
                       0,
                       {})],
-        'primary_view_state': {'editor_states': {'bookmarks': ([(loc('vxl.py'),
-        {'attrib-starts': [('Vxl',
-                            18),
-                           ('Vxl._torrent_detail',
-                            261)],
-         'first-line': 265,
+        'primary_view_state': {'editor_states': {'bookmarks': ([(loc('x-wingide-zip:///usr/local/lib/python2.5/site-packages/feedparser-4.1-py2.5.egg//feedparser.py'),
+        {'attrib-starts': [('FeedParserDict',
+                            171),
+                           ('FeedParserDict.__getattr__',
+                            226)],
+         'first-line': 213,
          'folded-linenos': [],
-         'sel-line': 294,
-         'sel-line-start': 10279,
-         'selection_end': 10348,
-         'selection_start': 10332},
-        1223493018.1912191),
-        (loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl._torrent_detail',
-                             261)],
-          'first-line': 276,
+         'sel-line': 232,
+         'sel-line-start': 8854,
+         'selection_end': 8854,
+         'selection_start': 8854},
+        1223590431.28145),
+        (loc('x-wingide-zip:///usr/local/lib/python2.5/site-packages/feedparser-4.1-py2.5.egg//feedparser.py'),
+         {'attrib-starts': [('FeedParserDict',
+                             171),
+                            ('FeedParserDict.__getattr__',
+                             226)],
+          'first-line': 213,
           'folded-linenos': [],
-          'sel-line': 295,
-          'sel-line-start': 10371,
-          'selection_end': 10440,
-          'selection_start': 10424},
-         1223493018.352623),
-        (loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl._torrent_detail',
-                             261)],
-          'first-line': 276,
+          'sel-line': 232,
+          'sel-line-start': 8854,
+          'selection_end': 8854,
+          'selection_start': 8854},
+         1223590432.2803099),
+        (loc('x-wingide-zip:///usr/local/lib/python2.5/site-packages/feedparser-4.1-py2.5.egg//feedparser.py'),
+         {'attrib-starts': [('FeedParserDict',
+                             171),
+                            ('FeedParserDict.__getattr__',
+                             226)],
+          'first-line': 213,
           'folded-linenos': [],
-          'sel-line': 296,
-          'sel-line-start': 10460,
-          'selection_end': 10529,
-          'selection_start': 10513},
-         1223493019.4164419),
-        (loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl._torrent_detail',
-                             261)],
-          'first-line': 276,
+          'sel-line': 232,
+          'sel-line-start': 8854,
+          'selection_end': 8854,
+          'selection_start': 8854},
+         1223590433.2781329),
+        (loc('x-wingide-zip:///usr/local/lib/python2.5/site-packages/feedparser-4.1-py2.5.egg//feedparser.py'),
+         {'attrib-starts': [('FeedParserDict',
+                             171),
+                            ('FeedParserDict.__getattr__',
+                             226)],
+          'first-line': 213,
           'folded-linenos': [],
-          'sel-line': 297,
-          'sel-line-start': 10549,
-          'selection_end': 10618,
-          'selection_start': 10602},
-         1223493019.968529),
-        (loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl._torrent_detail',
-                             261)],
-          'first-line': 276,
+          'sel-line': 232,
+          'sel-line-start': 8854,
+          'selection_end': 8854,
+          'selection_start': 8854},
+         1223590434.2795899),
+        (loc('x-wingide-zip:///usr/local/lib/python2.5/site-packages/feedparser-4.1-py2.5.egg//feedparser.py'),
+         {'attrib-starts': [('FeedParserDict',
+                             171),
+                            ('FeedParserDict.__getattr__',
+                             226)],
+          'first-line': 213,
           'folded-linenos': [],
-          'sel-line': 294,
-          'sel-line-start': 10279,
-          'selection_end': 10348,
-          'selection_start': 10332},
-         1223493020.9660959),
-        (loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl._torrent_detail',
-                             261)],
-          'first-line': 276,
+          'sel-line': 232,
+          'sel-line-start': 8854,
+          'selection_end': 8854,
+          'selection_start': 8854},
+         1223590435.2786701),
+        (loc('../../../../var/lib/python-support/python2.5/drv_libxml2.py'),
+         {'attrib-starts': [('LibXml2Reader',
+                             93),
+                            ('LibXml2Reader.parse',
+                             132)],
+          'first-line': 211,
           'folded-linenos': [],
-          'sel-line': 295,
-          'sel-line-start': 10371,
-          'selection_end': 10440,
-          'selection_start': 10424},
-         1223493021.5204799),
-        (loc('transmission/utils.py'),
-         {'attrib-starts': [('inet_address',
-                             35)],
-          'first-line': 15,
+          'sel-line': 230,
+          'sel-line-start': 9129,
+          'selection_end': 9129,
+          'selection_start': 9129},
+         1223590437.6848171),
+        (loc('feed.py'),
+         {'attrib-starts': [],
+          'first-line': 16,
           'folded-linenos': [],
-          'sel-line': 35,
-          'sel-line-start': 845,
-          'selection_end': 861,
-          'selection_start': 849},
-         1223493022.695699),
-        (loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl._torrent_detail',
-                             261)],
-          'first-line': 276,
+          'sel-line': 15,
+          'sel-line-start': 326,
+          'selection_end': 326,
+          'selection_start': 326},
+         1223590446.1755109),
+        [loc('x-wingide-zip:///usr/local/lib/python2.5/site-packages/feedparser-4.1-py2.5.egg//feedparser.py'),
+         {'attrib-starts': [('FeedParserDict',
+                             171),
+                            ('FeedParserDict.__getattr__',
+                             226)],
+          'first-line': 213,
           'folded-linenos': [],
-          'sel-line': 295,
-          'sel-line-start': 10371,
-          'selection_end': 10440,
-          'selection_start': 10424},
-         1223493026.437319),
-        (loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl.__init__',
-                             19)],
-          'first-line': 22,
+          'sel-line': 232,
+          'sel-line-start': 8854,
+          'selection_end': 8854,
+          'selection_start': 8854},
+         1223591307.8710239],
+        (loc('feed.py'),
+         {'attrib-starts': [('tvrss_parser',
+                             10)],
+          'first-line': 0,
           'folded-linenos': [],
-          'sel-line': 24,
-          'sel-line-start': 561,
-          'selection_end': 565,
-          'selection_start': 565},
-         1223493028.7812541),
-        (loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl.set_daemon',
-                             25)],
-          'first-line': 22,
+          'sel-line': 68,
+          'sel-line-start': 2192,
+          'selection_end': 2230,
+          'selection_start': 2230},
+         1223591332.7331159),
+        (loc('setup.py'),
+         {'attrib-starts': [],
+          'first-line': 0,
           'folded-linenos': [],
-          'sel-line': 27,
-          'sel-line-start': 626,
-          'selection_end': 678,
-          'selection_start': 666},
-         1223493038.10042),
-        (loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl.set_daemon',
-                             25)],
-          'first-line': 22,
+          'sel-line': 15,
+          'sel-line-start': 391,
+          'selection_end': 403,
+          'selection_start': 403},
+         1223595624.183285),
+        (loc('supervisor.py'),
+         {'attrib-starts': [('main',
+                             92)],
+          'first-line': 0,
           'folded-linenos': [],
-          'sel-line': 27,
-          'sel-line-start': 626,
-          'selection_end': 678,
-          'selection_start': 666},
-         1223493039.088963),
-        (loc('transmission/utils.py'),
-         {'attrib-starts': [('rpc_bool',
-                             56)],
-          'first-line': 29,
+          'sel-line': 116,
+          'sel-line-start': 5254,
+          'selection_end': 5273,
+          'selection_start': 5273},
+         1223595625.4830811),
+        (loc('system.py'),
+         {'attrib-starts': [('execute',
+                             6)],
+          'first-line': 0,
           'folded-linenos': [],
-          'sel-line': 56,
-          'sel-line-start': 1481,
-          'selection_end': 1493,
-          'selection_start': 1485},
-         1223493040.9254169),
-        (loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl.__init__',
-                             19)],
-          'first-line': 22,
+          'sel-line': 16,
+          'sel-line-start': 422,
+          'selection_end': 441,
+          'selection_start': 441},
+         1223595626.4677429),
+        (loc('feed.py'),
+         {'attrib-starts': [('tvrss_parser',
+                             10)],
+          'first-line': 0,
           'folded-linenos': [],
-          'sel-line': 22,
-          'sel-line-start': 506,
-          'selection_end': 534,
-          'selection_start': 534},
-         1223493044.670069),
-        (loc('transmission/utils.py'),
-         {'attrib-starts': [('rpc_bool',
-                             56)],
-          'first-line': 29,
-          'folded-linenos': [],
-          'sel-line': 56,
-          'sel-line-start': 1481,
-          'selection_end': 1493,
-          'selection_start': 1485},
-         1223493054.5342779),
-        (loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl.word_complete',
-                             38)],
-          'first-line': 22,
-          'folded-linenos': [],
-          'sel-line': 38,
-          'sel-line-start': 1128,
-          'selection_end': 1169,
-          'selection_start': 1169},
-         1223493055.430325),
-        (loc('transmission/transmission.py'),
-         {'attrib-starts': [('Client',
-                             202),
-                            ('Client.get_files',
-                             389)],
-          'first-line': 411,
-          'folded-linenos': [],
-          'sel-line': 420,
-          'sel-line-start': 14716,
-          'selection_end': 14724,
-          'selection_start': 14724},
-         1223493161.2449241),
+          'sel-line': 68,
+          'sel-line-start': 2192,
+          'selection_end': 2230,
+          'selection_start': 2230},
+         1223595695.993962),
         (loc('transmission/transmission.py'),
          {'attrib-starts': [('Client',
                              202),
                             ('Client._request',
                              220)],
-          'first-line': 254,
-          'folded-linenos': [],
-          'sel-line': 269,
-          'sel-line-start': 9242,
-          'selection_end': 9279,
-          'selection_start': 9279},
-         1223493165.890883),
-        (loc('transmission/transmission.py'),
-         {'attrib-starts': [('Torrent',
-                             19),
-                            ('Torrent.__init__',
-                             26)],
-          'first-line': 11,
-          'folded-linenos': [],
-          'sel-line': 28,
-          'sel-line-start': 808,
-          'selection_end': 808,
-          'selection_start': 808},
-         1223493203.0987401),
-        (loc('transmission/transmission.py'),
-         {'attrib-starts': [('Client',
-                             202),
-                            ('Client._request',
-                             220)],
-          'first-line': 252,
+          'first-line': 117,
           'folded-linenos': [],
           'sel-line': 270,
           'sel-line-start': 9280,
-          'selection_end': 9335,
-          'selection_start': 9335},
-         1223493216.739378),
-        [loc('vxl.py'),
-         {'attrib-starts': [('Vxl',
-                             18),
-                            ('Vxl.word_complete',
-                             38)],
-          'first-line': 22,
+          'selection_end': 9319,
+          'selection_start': 9319},
+         1223595700.300565),
+        (loc('supervisor.py'),
+         {'attrib-starts': [('main',
+                             92)],
+          'first-line': 117,
           'folded-linenos': [],
-          'sel-line': 38,
-          'sel-line-start': 1128,
-          'selection_end': 1169,
-          'selection_start': 1169},
-         1223493236.977339]],
+          'sel-line': 125,
+          'sel-line-start': 5545,
+          'selection_end': 5578,
+          'selection_start': 5573},
+         1223595739.3868599),
+        (loc('system.py'),
+         {'attrib-starts': [('execute',
+                             6)],
+          'first-line': 0,
+          'folded-linenos': [],
+          'sel-line': 16,
+          'sel-line-start': 422,
+          'selection_end': 441,
+          'selection_start': 441},
+         1223595756.6996789),
+        (loc('supervisor.py'),
+         {'attrib-starts': [('main',
+                             92)],
+          'first-line': 117,
+          'folded-linenos': [],
+          'sel-line': 130,
+          'sel-line-start': 5738,
+          'selection_end': 5753,
+          'selection_start': 5753},
+         1223595759.08373),
+        (loc('system.py'),
+         {'attrib-starts': [('execute',
+                             6)],
+          'first-line': 0,
+          'folded-linenos': [],
+          'sel-line': 16,
+          'sel-line-start': 422,
+          'selection_end': 441,
+          'selection_start': 441},
+         1223595811.3440499),
+        (loc('supervisor.py'),
+         {'attrib-starts': [('main',
+                             92)],
+          'first-line': 117,
+          'folded-linenos': [],
+          'sel-line': 129,
+          'sel-line-start': 5700,
+          'selection_end': 5737,
+          'selection_start': 5737},
+         1223595816.287189),
+        [loc('feed.py'),
+         {'attrib-starts': [('tvrss_parser',
+                             10)],
+          'first-line': 0,
+          'folded-linenos': [],
+          'sel-line': 68,
+          'sel-line-start': 2192,
+          'selection_end': 2230,
+          'selection_start': 2230},
+         1223595981.7140279]],
         19),
-        'current-loc': loc('vxl.py'),
-        'editor-states': {loc('feed.py'): {'attrib-starts': [],
-        'first-line': 0,
+        'current-loc': loc('feed.py'),
+        'editor-states': {loc('feed.py'): {'attrib-starts': [('tvrss_parser',
+        11)],
+        'first-line': 61,
         'folded-linenos': [],
-        'sel-line': 22,
-        'sel-line-start': 591,
-        'selection_end': 591,
-        'selection_start': 591},
+        'sel-line': 85,
+        'sel-line-start': 2732,
+        'selection_end': 2732,
+        'selection_start': 2732},
                           loc('setup.py'): {'attrib-starts': [],
         'first-line': 0,
         'folded-linenos': [],
-        'sel-line': 17,
-        'sel-line-start': 403,
+        'sel-line': 15,
+        'sel-line-start': 391,
         'selection_end': 403,
         'selection_start': 403},
                           loc('supervisor.py'): {'attrib-starts': [('main',
         92)],
-        'first-line': 0,
+        'first-line': 117,
         'folded-linenos': [],
-        'sel-line': 116,
-        'sel-line-start': 5254,
-        'selection_end': 5273,
-        'selection_start': 5273},
+        'sel-line': 129,
+        'sel-line-start': 5700,
+        'selection_end': 5737,
+        'selection_start': 5737},
                           loc('system.py'): {'attrib-starts': [('execute',
         6)],
         'first-line': 0,
         'folded-linenos': [],
-        'sel-line': 13,
-        'sel-line-start': 366,
-        'selection_end': 380,
-        'selection_start': 380},
+        'sel-line': 16,
+        'sel-line-start': 422,
+        'selection_end': 441,
+        'selection_start': 441},
                           loc('transmission/transmission.py'): {'attrib-star'\
         'ts': [('Client',
                 202),
                ('Client._request',
                 220)],
-        'first-line': 252,
+        'first-line': 117,
         'folded-linenos': [],
         'sel-line': 270,
         'sel-line-start': 9280,
-        'selection_end': 9335,
-        'selection_start': 9335},
+        'selection_end': 9319,
+        'selection_start': 9319},
                           loc('transmission/utils.py'): {'attrib-starts': [(''\
         'rpc_bool',
         56)],
         'sel-line': 56,
         'sel-line-start': 1481,
         'selection_end': 1493,
-        'selection_start': 1485},
-                          loc('vxl.py'): {'attrib-starts': [('Vxl',
-        18),
-        ('Vxl.word_complete',
-         38)],
-        'first-line': 22,
-        'folded-linenos': [],
-        'sel-line': 38,
-        'sel-line-start': 1128,
-        'selection_end': 1169,
-        'selection_start': 1169}},
-        'has-focus': False},
-                               'open_files': [u'feed.py',
+        'selection_start': 1485}},
+        'has-focus': True},
+                               'open_files': [u'transmission/utils.py',
         u'setup.py',
+        u'transmission/transmission.py',
+        u'system.py',
         u'supervisor.py',
-        u'system.py',
-        u'transmission/utils.py',
-        u'transmission/transmission.py',
-        u'vxl.py']},
+        u'feed.py']},
         'split_percents': {0: 0.5},
         'splits': 1,
         'tab_location': 'top',
                  'splits': 1,
                  'tab_location': 'left',
                  'user_data': {}},
-        'window-alloc': (0,
-                         49,
-                         1600,
-                         1125)}]}
-guimgr.recent-documents = [loc('vxl.py'),
+        'window-alloc': (353,
+                         192,
+                         1469,
+                         877)}]}
+guimgr.recent-documents = [loc('feed.py'),
+                           loc('supervisor.py'),
+                           loc('system.py'),
                            loc('transmission/transmission.py'),
-                           loc('transmission/utils.py'),
-                           loc('system.py'),
-                           loc('supervisor.py'),
-                           loc('setup.py'),
-                           loc('feed.py')]
+                           loc('setup.py')]
 guimgr.visual-state = {loc('../../.wingpersonal3/pi-cache/2.5/usr/lib/python2.5/lib-dynload/_socket.pi'): {''\
         'attrib-starts': [],
         'first-line': 410,
         'sel-line-start': 0,
         'selection_end': 26,
         'selection_start': 26},
+                       loc('../python/binbot/field.py'): {'attrib-starts': [],
+        'first-line': 50,
+        'folded-linenos': [],
+        'sel-line': 0,
+        'sel-line-start': 0,
+        'selection_end': 0,
+        'selection_start': 0},
+                       loc('../python/filename.py'): {'attrib-starts': [],
+        'first-line': 0,
+        'folded-linenos': [],
+        'sel-line': 4,
+        'sel-line-start': 92,
+        'selection_end': 105,
+        'selection_start': 105},
                        loc('assasin.py'): {'attrib-starts': [],
         'first-line': 0,
         'folded-linenos': [],
         'sel-line-start': 150,
         'selection_end': 169,
         'selection_start': 169},
-                       loc('../python/binbot/field.py'): {'attrib-starts': [],
-        'first-line': 50,
-        'folded-linenos': [],
-        'sel-line': 0,
-        'sel-line-start': 0,
-        'selection_end': 0,
-        'selection_start': 0},
-                       loc('../python/filename.py'): {'attrib-starts': [],
-        'first-line': 0,
-        'folded-linenos': [],
-        'sel-line': 4,
-        'sel-line-start': 92,
-        'selection_end': 105,
-        'selection_start': 105},
                        loc('../../downloads/enumprocess-0.1/src/enumprocess/processinfo.py'): {''\
         'attrib-starts': [('PsParser',
                            149),
         'sel-line-start': 28269,
         'selection_end': 28269,
         'selection_start': 28269},
+                       loc('../../../../var/lib/python-support/python2.5/drv_libxml2.py'): {''\
+        'attrib-starts': [('LibXml2Reader',
+                           93),
+                          ('LibXml2Reader.parse',
+                           132)],
+        'first-line': 211,
+        'folded-linenos': [],
+        'sel-line': 230,
+        'sel-line-start': 9129,
+        'selection_end': 9129,
+        'selection_start': 9129},
                        loc('../../../../var/lib/python-support/python2.5/simplejson/__init__.py'): {''\
         'attrib-starts': [('loads',
                            242)],
         'sel-line-start': 9937,
         'selection_end': 10000,
         'selection_start': 10000},
-                       loc('unknown:<untitled> #3'): {'attrib-starts': [],
+                       loc('unknown:<untitled> #8'): {'attrib-starts': [],
+        'first-line': 0,
+        'folded-linenos': [],
+        'sel-line': 0,
+        'sel-line-start': 0,
+        'selection_end': 0,
+        'selection_start': 0},
+                       loc('unknown:<untitled> #7'): {'attrib-starts': [],
         'first-line': 0,
         'folded-linenos': [],
         'history': {},
         'sel-line-start': 24,
         'selection_end': 24,
         'selection_start': 24},
-                       loc('unknown:<untitled> #2'): {'attrib-starts': [],
-        'first-line': 0,
+                       loc('x-wingide-zip:///usr/local/lib/python2.5/site-packages/feedparser-4.1-py2.5.egg//feedparser.py'): {''\
+        'attrib-starts': [('FeedParserDict',
+                           171),
+                          ('FeedParserDict.setdefault',
+                           215)],
+        'first-line': 213,
         'folded-linenos': [],
-        'sel-line': 0,
-        'sel-line-start': 0,
-        'selection_end': 0,
-        'selection_start': 0}}
-proj.env-vars = {loc('supervisor.py'): ('project',
+        'sel-line': 219,
+        'sel-line-start': 8532,
+        'selection_end': 8540,
+        'selection_start': 8540}}
+proj.env-vars = {loc('feed.py'): ('project',
+                                  ['']),
+                 loc('supervisor.py'): ('project',
         ['']),
                  loc('transmission/transmission.py'): ('project',
         ['']),

File transmission/transmission.py

 class Session(object):
     """
     Session is a class holding the session data for a Transmission daemon.
+    
+    Access the session field can be done through attributes.
+    The attributes available are the same as the session arguments in the
+    Transmission RPC specification, but with underscore instead of hypen.
+    ``download-dir`` -> ``download_dir``.
     """
     
     def __init__(self, fields={}):
             self.fields[key] = v
     
     def update(self, other):
-        """Update the session data from a Session arguments dictinary"""
+        """Update the session data from a session arguments dictinary"""
         
         fields = None
         if isinstance(other, dict):