コード例 #1
0
 def get(self):
     self.response.headers['Content-Type'] = 'text/html'
     if utilities.user_loggedin():
         if not utilities.existing_user():
             utilities.add_new_user(utilities.get_user())
         result, wordCount, totalCount = utilities.getanagrams_from_user(
             utilities.getuser())
         renderer.render_main(self, utilities.getlogouturl(self), result,
                              wordCount, totalCount)
     # If user is not logged in create login url
     else:
         renderer.render_login(self, utilities.getloginurl(self))
コード例 #2
0
ファイル: main.py プロジェクト: yuvadeepvuyyuru/Assignment_2
    def get(self):
        self.response.headers['Content-Type'] = 'text/html'

        if utilities.user_is_logged_in():

            if not utilities.user_exists():
                utilities.add_new_user(utilities.get_user())
            result, wordCount, totalCount = utilities.get_anagrams_of_user(
                utilities.get_my_user())
            renderer.render_main(self, utilities.get_logout_url(self), result,
                                 wordCount, totalCount)

        else:
            renderer.render_login(self, utilities.get_login_url(self))
コード例 #3
0
 def get(self):
     self.response.headers['Content-Type'] = 'text/html'
     # Check whether user is logged in
     if utilities.user_loggedin():
         # if myuser object is None --> No user with key found --> new user --> make new user in datastore
         if not utilities.existing_user():
             utilities.addnewuser(utilities.get_user())
         result, wordCount, totalCount = utilities.getanagrams_from_user(
             utilities.getuser())
         renderer.render_main(self, utilities.getlogouturl(self), result,
                              wordCount, totalCount)
     # If no user is logged in create login url
     else:
         renderer.render_login(self, utilities.getloginurl(self))
コード例 #4
0
    def get(self):
        logging.debug("GET")
        self.response.headers['Content-Type'] = 'text/html'

        if utilities.user_is_logged_in():
            if not utilities.user_exists():
                utilities.add_new_user(utilities.get_user())

            renderer.render_main(
                self, utilities.get_logout_url(self),
                utilities.get_anagrams_of_user(utilities.get_my_user()))

        else:
            renderer.render_login(self, utilities.get_login_url(self))
コード例 #5
0
ファイル: main.py プロジェクト: kim-marcel/anagram_engine
    def get(self):
        logging.debug("GET")
        self.response.headers['Content-Type'] = 'text/html'

        # check whether user is logged in
        if utilities.user_is_logged_in():
            # if myuser object is None --> No user with key found --> new user --> make new user in datastore
            if not utilities.user_exists():
                utilities.add_new_user(utilities.get_user())

            renderer.render_main(
                self, utilities.get_logout_url(self),
                utilities.get_anagrams_of_user(utilities.get_my_user()))

        # if no user is logged in create login url
        else:
            renderer.render_login(self, utilities.get_login_url(self))
コード例 #6
0
ファイル: main.py プロジェクト: kim-marcel/dropbox
    def get(self):
        logging.debug('GET')
        self.response.headers['Content-Type'] = 'text/html'

        # check whether user is logged in
        if utilities.is_user_logged_in():
            # if myuser object is None --> No user with key found --> new user --> make new user in datastore
            if not utilities.user_exists():
                utilities.add_new_user(utilities.get_user())

            self.navigate()

            # get all directories and files in the current path
            directories_in_current_path = utilities.get_directories_in_current_path()
            files_in_current_path = utilities.get_files_in_current_path()

            # sort all directories and files alphabetically
            directories_in_current_path = utilities.sort_list(directories_in_current_path)
            files_in_current_path = utilities.sort_list(files_in_current_path)

            # extract file and directory names from the key list
            # so that only the names have to be send to the gui and not the whole object
            directories_in_current_path = utilities.get_names_from_list(directories_in_current_path)
            files_in_current_path = utilities.get_names_from_list(files_in_current_path)

            renderer.render_main(self,
                                 utilities.get_logout_url(self),
                                 directories_in_current_path,
                                 files_in_current_path,
                                 utilities.get_current_directory_object().path,
                                 utilities.is_in_root_directory(),
                                 blobstore.create_upload_url('/upload'))

        # if no user is logged in create login url
        else:
            renderer.render_login(self, utilities.get_login_url(self))