    How to write a (G)UI that uses twyt
  ---------------------------------------

o Firstly, I haven't tried writing a GUI for twyt yet so I can't be sure these
  instructions are all that helpful. I've tried to write twyt in such a way
  that extending it in various ways would be easy (for example, the methods in
  the Command class all return result sets, where applicable). Anyway, here
  goes.

o The way I see it there are two ways of extending twyt. The first way involves
  importing the twitter module and writing all of the UI and command parsing
  things yourself. This way allows you more freedom to do what you want than
  the second option but it involves a little more work. The second method is to
  import the commmands module and just call the commands specified in its
  cmd_map dictionary. That way you get all the user profile, parsing etc. and a
  lot of error handling stuff for free but it does tie you down to that
  functionality and (as of version 0.8) your twitter messages will say "from
  Twyt" by default. I will briefly describe these two methods here.

1 The Twitter API functions are encapsulated in the twitter.Twitter class. This
  is really all you need to start using the basics of twyt but other modules
  and classes are provided to allow you to make sense of the data returned from
  Twitter. Here we briefly describe how to post a status message, delete it and
  then list the public timeline:

    from twyt import twitter, data

    t = twitter.Twitter()
    t.set_auth("username", "password")

    return_val = t.status_update("Testing 123")

  The above snippet instantiates a Twitter object and then tells it the user's
  Twitter user name and password. It then calls the Twitter object's
  status_update() method to send the new status message - in this example
  "Testing 123" - to Twitter. That's how simple it is to update your Twitter
  status with twyt! We continue...

    s = data.Status()
    s.load_json(return_val)

    print s

    t.status_destroy(s.id)

  This snippet shows how to use a data.Status() object to make sense of the
  data that Twitter returns when we post our new status message. Once the
  returned data (return_val) is loaded into the Status object s, the Status
  object represents the status message returned. `print s' prints a string
  representation of the status message (see docs for the format). We then
  decide our status message was boring and call status_destroy() on its ID to
  tell Twitter to delete the status message. That's about all you need to get
  started. See the pydocs in twitter.py (import twyt.twitter; help(twitter)")
  to see the rest of the Twitter API functions you can call.

2 Once the commands module is imported you can instantiate a Command object.
  The important parts of the Command object will be the docommand() method and
  the cmd_map dictionary. cmd_map gives the list of commands that can be called
  as its keys and the docommand() method allows the functions to be called by
  their names as a string. For example, to get the last twenty messages in the
  public timeline you would do something like:

    import commands

    cmd = commands.Command()
    results = cmd.docommand('publictl')

  The above snippet ends with the results variable being assigned a StatusList
  object which is basically a list of Status objects which contain the data of a
  twitter status message plus some wrapper code. So now you can do something
  like:

    for result in results:
        aContainerWidget.add(aLabel(result.text))

  This pseudocode would in theory set the text of a new graphical label which
  then gets added to a widget that contains a list of labels. Or something.

o That's about as simple as it gets. The world is now your oyster. Have fun!
