~ubuntu-branches/ubuntu/precise/ubuntuone-client/precise-201112142106

« back to all changes in this revision

Viewing changes to contrib/login_email_password.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2011-08-09 12:47:56 UTC
  • mfrom: (1.1.53 upstream)
  • Revision ID: james.westby@ubuntu.com-20110809124756-7nzilp3oix0a1yl9
Tags: 1.7.1-0ubuntu1
* New upstream release.
* debian/*:
  - Removed obsolete pycompat file
  - Removed ubuntuone-client-gnome deps and binary packaging, as it was
    moved out to separate project upstream.
  - Updated copyright to remove obsolete file reference
* debian/patches:
  - Removed patches which have been included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
# Author: Roberto Alsina <roberto.alsina@canonical.com>
 
3
#
 
4
# Copyright 2011 Canonical Ltd.
 
5
#
 
6
# This program is free software: you can redistribute it and/or modify it
 
7
# under the terms of the GNU General Public License version 3, as published
 
8
# by the Free Software Foundation.
 
9
#
 
10
# This program is distributed in the hope that it will be useful, but
 
11
# WITHOUT ANY WARRANTY; without even the implied warranties of
 
12
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
13
# PURPOSE.  See the GNU General Public License for more details.
 
14
#
 
15
# You should have received a copy of the GNU General Public License along
 
16
# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
"""Script that shows the qt gui."""
 
18
 
 
19
# pylint: disable=F0401, E1101
 
20
from twisted.internet import reactor
 
21
from twisted.internet.defer import inlineCallbacks
 
22
from ubuntuone.platform.credentials import CredentialsManagementTool
 
23
 
 
24
 
 
25
@inlineCallbacks
 
26
def main():
 
27
    """Perform a client request to be logged in."""
 
28
    credtool = CredentialsManagementTool()
 
29
 
 
30
    creds = yield credtool.login_email_password(
 
31
          email='whomever@canonical.com',
 
32
          password='whatever',
 
33
    )
 
34
    print "creds found", creds
 
35
    reactor.stop()
 
36
 
 
37
 
 
38
if __name__ == '__main__':
 
39
    main()
 
40
    reactor.run()