~gary-lasker/software-center/fix-lp602610

« back to all changes in this revision

Viewing changes to softwarecenter/backend/login.py

  • Committer: Michael Vogt
  • Date: 2010-07-01 11:49:51 UTC
  • mfrom: (862.1.11 lazr)
  • Revision ID: michael.vogt@ubuntu.com-20100701114951-0tlc3icfbm464zej
merged lp:~mvo/software-center/lazr to support gobject
based wrapper around lazr.restfulclient apps

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- coding: utf-8 -*-
 
3
 
 
4
# Copyright (C) 2010 Canonical
 
5
#
 
6
# Authors:
 
7
#  Michael Vogt
 
8
#
 
9
# This program is free software; you can redistribute it and/or modify it under
 
10
# the terms of the GNU General Public License as published by the Free Software
 
11
# Foundation; version 3.
 
12
#
 
13
# This program is distributed in the hope that it will be useful, but WITHOUT
 
14
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
15
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
16
# details.
 
17
#
 
18
# You should have received a copy of the GNU General Public License along with
 
19
# this program; if not, write to the Free Software Foundation, Inc.,
 
20
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
21
 
 
22
import gobject
 
23
 
 
24
class LoginBackend(gobject.GObject):
 
25
 
 
26
    NEW_ACCOUNT_URL = None
 
27
    FORGOT_PASSWORD_URL = None
 
28
 
 
29
    __gsignals__ = {
 
30
        "login-successful" : (gobject.SIGNAL_RUN_LAST,
 
31
                             gobject.TYPE_NONE, 
 
32
                             (gobject.TYPE_PYOBJECT,),
 
33
                            ),
 
34
        "login-failed" : (gobject.SIGNAL_RUN_LAST,
 
35
                          gobject.TYPE_NONE, 
 
36
                          (),
 
37
                         ),
 
38
        "need-username-password" : (gobject.SIGNAL_RUN_LAST,
 
39
                                    gobject.TYPE_NONE, 
 
40
                                    (),
 
41
                                   ),
 
42
        }
 
43
 
 
44
    def login(self, username=None, password=None):
 
45
        raise NotImplemented
 
46
    def cancel_login(self):
 
47
        pass
 
48
    @property
 
49
    def new_account_url(self):
 
50
        return self.NEW_ACCOUNT_URL
 
51
    @property
 
52
    def forgoten_password_url(self):
 
53
        return self.FORGOT_PASSWORD_URL
 
54