Пример #1
0
    def post(self):
        query = self.get_argument('input', None)
        if query:

            user_id = zsite_by_query(query)
            if user_id:
                url = '/zsite/%s' % user_id
                return self.redirect(url)
            else:
                self.render(input=query)
        else:
            self.get()
Пример #2
0
    def post(self):
        user_list = self.get_argument('user_list','')
        user_list = filter(bool, map(str.strip, user_list.splitlines()))

#        print tag_id_list

        user_list_exist = []
        user_list_not_exist = []

        for i in user_list:
            zsite_id = zsite_by_query(i)
            if zsite_id:
                user_list_exist.append(zsite_id)
            else:
                user_list_not_exist.append(i)
            
             

        user_list_not_exist = unique(user_list_not_exist)
        user_list_exist = unique(user_list_exist)



        tag_id_list = tag_id_list_by_str_list(
            filter(
                bool, map(
                    str.strip, 
                    self.get_argument('tag','').split()
                )
            )
        )

        for i in user_list_exist:
            tag2idlist_po_user.append_id_tag_id_list(i, tag_id_list) 

        self.render(
            user_list_exist=Zsite.mc_get_list(user_list_exist),
            user_list_not_exist=user_list_not_exist,
        )
Пример #3
0
count = 0
with open('ucd.csv') as ucd:
    for line in ucd:
        line = line.decode('gb18030')
        t = line.split(',')
        if len(t) != 6:
            print line
        else:
            uid = t[0].split(' ', 1)[0]
            u = PoMetaUser.mc_get(uid)
            link = t[4]

            zsite = None

            if link:
                id = zsite_by_query(link)
                zsite = Zsite.mc_get(id)
            else:
                email = t[5].strip()
                if email:
                    zsite = user_by_mail(email)

            if zsite:
                user_id = zsite.id
                if not pic_url(user_id):
                    #                    print count , zsite.id
                    print zsite.name, 'http:' + zsite.link
                    print u.name, u.link
                    #                    print t[-3]
                    #                    count += 1
                    print ''
Пример #4
0
    exist = loadpw()
    for i in vps_list_by_hostname():
        username = USERNAME%i.id_in_group
        if username not in exist:
            vps_new(i)

if __name__ == '__main__':
#    vps_open_all()
#    vps_new_by_user_id(10000000, group=GID)
    
    
    url_list = [  "  [email protected] "]
    for url in url_list:
        url = url.strip()
        from model.zsite import zsite_by_query
        id = zsite_by_query(url)
        print id
        vps_new_by_user_id(id)

#    vps_open_all()

#def main():
#
#    count = 0
#    user_id_list = event_joiner_user_id_list(10236239)
#    print len(user_id_list)
#    for i in user_id_list:
#
#        count += 1
#
#
Пример #5
0
    exist = loadpw()
    for i in vps_list_by_hostname():
        username = USERNAME % i.id_in_group
        if username not in exist:
            vps_new(i)


if __name__ == '__main__':
    #    vps_open_all()
    #    vps_new_by_user_id(10000000, group=GID)

    url_list = ["  [email protected] "]
    for url in url_list:
        url = url.strip()
        from model.zsite import zsite_by_query
        id = zsite_by_query(url)
        print id
        vps_new_by_user_id(id)

#    vps_open_all()

#def main():
#
#    count = 0
#    user_id_list = event_joiner_user_id_list(10236239)
#    print len(user_id_list)
#    for i in user_id_list:
#
#        count += 1
#
#
Пример #6
0
count = 0
with open('ucd.csv') as ucd:
    for line in ucd:
        line = line.decode('gb18030')
        t = line.split(',')
        if len(t) != 6:
            print line
        else:
            uid = t[0].split(' ', 1)[0]
            u = PoMetaUser.mc_get(uid)
            link = t[4]

            zsite = None

            if link:
                id = zsite_by_query(link)
                zsite = Zsite.mc_get(id)
            else:
                email = t[5].strip()
                if email:
                    zsite = user_by_mail(email)


            if zsite:
                user_id = zsite.id
                if not pic_url(user_id):
#                    print count , zsite.id
                    print zsite.name, 'http:'+zsite.link
                    print u.name , u.link
#                    print t[-3]
#                    count += 1