コード例 #1
0
class UserManager:
    def __init__(self):
        self.users = UserStore()

    # 로그인
    def login(self, email, password):
        user = self.users.find(email, password)
        return user

    # 회원가입
    def register(self, email, password, name):
        if self.users.emailCheck(email) != False:
            return False
        newUser = User(email, password, name)
        self.users.add(newUser)
        self.currentUser = newUser
        return newUser

    # 비밀번호 수정
    def edit(self, password):
        self.users.updatePassword(password)

    # 로그아웃
    def logout(self):
        self.currentUser = None

    def getUserInfo(self, email):
        return self.users.returnUserInfo(email)

    def getProcessInfo(self, email):
        return self.users.returnProcessingInfo(email)

    def getFrontProcessInfo(self, email):
        return self.users.returnFrontProcessingInfo(email)
コード例 #2
0
class UserManager:
	def __init__(self):
		self.users = UserStore()
		self.currentUser = None

	# 로그인
	def login(self, email, pw):
		user = self.users.find(email, pw)
		if user:
			self.currentUser = user
		return user

	
	# 회원가입
	def register(self, email, pw, name, age):
		newUser = User(email, pw, name, age)
		self.users.add(newUser)
		self.currentUser = newUser

	# 로그아웃	
	def logout(self):
		self.currentUser = None
コード例 #3
0
	def __init__(self):
		self.users = UserStore()
		self.currentUser = None
コード例 #4
0
ファイル: main.py プロジェクト: xuhongfeng/weibo-saturn
#!/usr/bin/env python

from store import Queue, UserStore, FriendsStore, NameQueue
from weibo import WeiboClient, ApiException
from data import User
import time
import const
import string

queue = Queue()
userStore = UserStore()
friendsStore = FriendsStore()
nameQueue = NameQueue()
client = WeiboClient()

def main():
    initUid = const.initUid
    access_token = const.accessToken

    if queue.count()==0:
        queue.enqueue(initUid)

    while True:
        print '*******check name queue********'
        print 'step1: dequeue name'
        name = nameQueue.dequeue()
        if name is not None:
            print 'step2: get user by name : %s' % name
            try:
                user = client.getUserByName(name, access_token)
                if user is not None:
コード例 #5
0
#!/usr/bin/env python

from store import TeacherQueue, UserStore, FriendsStore, NameQueue, FlagSet, TeacherStore, TeacherSort
from weibo import WeiboClient, ApiException
from data import User
import time
import const
import string
import sys

queue = TeacherQueue()
userStore = UserStore()
teacherStore = TeacherStore()
teacherSort = TeacherSort()
friendsStore = FriendsStore()
nameQueue = NameQueue()
client = WeiboClient()
flagSet = FlagSet()


def main():
    initUid = const.initUid
    access_token = const.accessToken
    try:
        print 'INIT : search teacher'
        uids = client.searchTeacher(access_token)
        print 'INIT : teacher uids', uids
        print 'INIT : enqueue teacher uid'
        for uid in uids:
            queue.putFront(uid)
    except ApiException, e:
コード例 #6
0
#!/usr/bin/env python

from store import Queue, UserStore, FriendsStore, NameQueue
from weibo import WeiboClient, ApiException
from data import User
import time
import const
import string

queue = Queue()
userStore = UserStore()
friendsStore = FriendsStore()
nameQueue = NameQueue()
client = WeiboClient()


def main():
    initUid = const.initUid
    access_token = const.accessToken

    if queue.count() == 0:
        queue.enqueue(initUid)

    while True:
        print '*******check name queue********'
        print 'step1: dequeue name'
        name = nameQueue.dequeue()
        if name is not None:
            print 'step2: get user by name : %s' % name
            try:
                user = client.getUserByName(name, access_token)
コード例 #7
0
 def __init__(self):
     self.users = UserStore()