def get(self):
        logging.debug("GET")
        self.response.headers['Content-Type'] = 'text/html'
        my_user = utilities.userKey()
        value = self.request.get('name')
        query = Twitter.query()
        data = query.fetch()

        query1 = UserInfo.query()
        data1 = query1.fetch()

        if utilities.userLoggedIn():
            if my_user is None or my_user == '':
                if not utilities.userExist():
                    utilities.newUser(utilities.currentUser())

                renderpage.register(self, utilities.logoutUrl(self), my_user)
            else:
                if not utilities.userExist():
                    utilities.newUser(utilities.currentUser())

                renderpage.user(self, utilities.logoutUrl(self), my_user, data, data1, value)

        else:
            renderpage.login(self, utilities.loginUrl(self))
    def get(self):
        logging.debug("GET")
        self.response.headers['Content-Type'] = 'text/html'
        my_user = utilities.userKey()

        query = Twitter.query()
        tweets = query.fetch()

        query1 = UserInfo.query()
        userinfo = query1.fetch()

        if utilities.userLoggedIn():
            if my_user is None or my_user == '':
                if not utilities.userExist():
                    utilities.newUser(utilities.currentUser())

                renderpage.register(self, utilities.logoutUrl(self), my_user)
            else:
                if not utilities.userExist():
                    utilities.newUser(utilities.currentUser())

                renderpage.profile(self, utilities.logoutUrl(self), my_user,
                                   tweets, userinfo)

        else:
            renderpage.login(self, utilities.loginUrl(self))
def register(self, url, my_user):
    template_values = {
        'url': url,
        'user': utilities.currentUser(),
        'my_user': my_user,
    }

    template = JINJA_ENVIRONMENT.get_template('registerpage.html')
    self.response.write(template.render(template_values))
Example #4
0
    def get(self):
        logging.debug("GET")
        self.response.headers['Content-Type'] = 'text/html'
        my_user = utilities.userKey()

        if utilities.userLoggedIn():
            if my_user is None or my_user == '':
                if not utilities.userExist():
                    utilities.newUser(utilities.currentUser())

                renderpage.register(self, utilities.logoutUrl(self), my_user)
            else:
                if not utilities.userExist():
                    utilities.newUser(utilities.currentUser())

                renderpage.register(self, utilities.logoutUrl(self), my_user)

        else:
            renderpage.login(self, utilities.loginUrl(self))
def edit(self, url, my_user, data):
    template_values = {
        'url': url,
        'user': utilities.currentUser(),
        'my_user': my_user,
        'data': data,
    }

    template = JINJA_ENVIRONMENT.get_template('edituserinfo.html')
    self.response.write(template.render(template_values))
def add(self, url, my_user, data, url1):
    template_values = {
        'url': url,
        'user': utilities.currentUser(),
        'my_user': my_user,
        'tweets': data,
        'url1': url1,
    }

    template = JINJA_ENVIRONMENT.get_template('addnewtweet.html')
    self.response.write(template.render(template_values))
def profile(self, url, my_user, tweets, userinfo):
    template_values = {
        'url': url,
        'user': utilities.currentUser(),
        'my_user': my_user,
        'tweets': tweets,
        'userinfo': userinfo,
    }

    template = JINJA_ENVIRONMENT.get_template('profilepage.html')
    self.response.write(template.render(template_values))
def user(self, url, my_user, data, data1, value):
    template_values = {
        'url': url,
        'user': utilities.currentUser(),
        'my_user': my_user,
        'tweets': data,
        'userinfo': data1,
        'value': value,
    }

    template = JINJA_ENVIRONMENT.get_template('searchusers.html')
    self.response.write(template.render(template_values))
def main(self, url, my_user, user, data, tweets):
    template_values = {
        'url': url,
        'user': utilities.currentUser(),
        'my_user': my_user,
        'user': user,
        'data': data,
        'tweets': tweets,
    }

    template = JINJA_ENVIRONMENT.get_template('mainpage.html')
    self.response.write(template.render(template_values))
Example #10
0
    def get(self):
        logging.debug("GET")
        self.response.headers['Content-Type'] = 'text/html'
        my_user = utilities.userKey()
        query = Twitter.query()
        data = query.fetch()
        url1 = blobstore.create_upload_url('/uploadhandler')
        if utilities.userLoggedIn():
            if my_user is None or my_user == '':
                if not utilities.userExist():
                    utilities.newUser(utilities.currentUser())

                renderpage.register(self, utilities.logoutUrl(self), my_user)
            else:
                if not utilities.userExist():
                    utilities.newUser(utilities.currentUser())

                renderpage.add(self, utilities.logoutUrl(self), my_user, data,
                               url1)

        else:
            renderpage.login(self, utilities.loginUrl(self))