Esempio n. 1
0
def search_command():
    list1.delete(0, END)
    for row in backend.search(title_text.get(), author_text.get(),
                              year_text.get(), isbn_text.get()):
        list1.insert(END, row)
def search_command():
    list1.delete(0, END)
    for row in backend.search(name_text.get(), id_text.get(), book_name.get(),
                              book_id.get()):
        list1.insert(END, row)
def search_command():
    list1.delete(0, END)
    for row in backend.search(fn.get(), ln.get(), term.get(), gpa.get()):
        list1.insert(END, row)
Esempio n. 4
0
def search_command():
    list1.delete(0, END)
    for row in backend.search(title_text.get(), Author_text.get(),
                              Year_text.get(), ISBN_text.get()):
        list1.insert(END, row)
Esempio n. 5
0
            input(
                '1. Make a new entry.\n2. View all entries\n3. delete an entry\n4. Exit\nEnter your choice: '
            ))
        print("*******************************\n")
        if choice == 1:
            web = input('Enter the service name: ')
            rows = backend.view()
            services = []
            for row in rows:
                services.append(row[0])
            if web in services:
                response = input(
                    '\nThe services already exists in database. Do you want to see the password instead? (y/n): '
                )
                if response == 'y':
                    print('The password is: ' + backend.search(web)[0][0])
                    time.sleep(3)
                    continue
                else:
                    continue
            else:
                passw = hashed_pass()
                backend.insert(web, passw)
                print('The new password is ' + passw + "\n\n")
                continue

        elif choice == 2:
            rows = backend.view()
            if len(rows) > 0:
                print("\n")
                for row in rows:
Esempio n. 6
0
def view_command():
	"""
	This will show up all the data Present in the table.
	"""
    list1.delete(0,END) #clear the list box
    for row in backend.view():
        list1.insert(END,row)

def search_command(): 
	"""
	This will show up the data searched by the user.
	
	"""
    list1.delete(0,END)
    for row in backend.search(title_text.get(),Author_text.get(),Year_text.get(),isbn_text.get()):
        list1.insert(END,row) #insert the row in the listBox
def add_command():
	"""
	
	This add the data entered by the user to the database.
	
	"""
    backend.insert(title_text.get(),Author_text.get(),Year_text.get(),isbn_text.get()) #add the the data to the database
    list1.delete(0,END)
    list1.insert(END,(title_text.get(),Author_text.get(),Year_text.get(),isbn_text.get()))

def delete_command(): 
	"""
	This will delete the user selected row.
	"""
Esempio n. 7
0
def search():
    t.configure(text='')
    list.delete(0, END)
    rows = backend.search(n.get(), rn.get(), m.get(), at.get())
    for row in rows:
        list.insert(END, row)
def boy_command():
    list1.delete(0,END)
    for row in backend.search(gender="Boy"):
        list1.insert(END,row)
def girl_command():
    list1.delete(0,END)
    for row in backend.search(gender="Girl"):
        list1.insert(END,row)
Esempio n. 10
0
def pto(input_name):
    input_name = input_name.lower()
    for row in backend.search(name=input_name):
        return row
def search_command():
    list1.delete(0,END)
    for row in backend.search(name_text.get(),gender_text.get(),submit_text.get()):
        list1.insert(END,row[1])
Esempio n. 12
0
def search_command():
    """Search entry via button."""
    listing.delete(0, END)
    for row in backend.search(title_text.get(), author_text.get(),
                              year_text.get(), isbn_text.get()):
        listing.insert(END, row)
def search_command():
    listbox.delete(0, END)
    for row in backend.search(title.get(), author.get(), year.get(),
                              country.get(), borrowed.get()):
        listbox.insert(END, row)
Esempio n. 14
0
def search_command():
    list1.delete(0, END)
    for row in backend.search(order_date.get(), Customer_name.get(),
                              customer_details.get(), order_name.get(),
                              payment_method.get(), payment_status.get()):
        list1.insert(END, row)
def search_command():
    list1.delete(0,END)
    for row in backend.search(title_text.get(),author_text.get(),year_text.get(),isbn_text.get()):
        list1.insert(END,row)
Esempio n. 16
0
def search_command():
    lb1.delete(0,END)
    for row in backend.search(title_value.get(),author_value.get(),year_value.get(),isbn_value.get()):
        lb1.insert(END,row)
Esempio n. 17
0
 def entry_search():
     j=backend.search(self.Entry3.get())
     print(j)
     return j
Esempio n. 18
0
def search_command():
    list_box.delete(0, END)
    for row in backend.search(date_text.get(), Programming_text.get(),
                              Reading_text.get(), Exercise_text.get(),
                              Studying_text.get(), Earnings_text.get()):
        list_box.insert(END, row)
Esempio n. 19
0
def search_command():
    list.delete(0, END)
    for row in backend.search(date_text.get(), earning_text.get(),
                              exercise_text.get(), study_text.get(),
                              diet_text.get(), python_text.get()):
        list.insert(END, row)
Esempio n. 20
0
def search_command():
    list.delete(0, END)
    for row in backend.search(date_text.get(), work1_text.get(),
                              work2_text.get(), work3_text.get()):
        list.insert(END, row)
Esempio n. 21
0
def search_command():
    for i in list1.tree.get_children():
        list1.tree.delete(i)
    # list1._build_tree(c_header, pddf(columns=c_header))
    c_list=pddf(backend.search(name_text.get(),surname_text.get(),year_text.get(),gen_text.get()), columns=c_header)
    list1._build_tree(c_header, c_list)        
Esempio n. 22
0
def search_command():
    list1.delete(0,END)
    for row in backend.search(title_text.get(),author_text.get(),year_text.get(),isbn_text.get(), des_text.get(), certi_text.get(), logo_link.get(), orgname_text.get(), orgadd_text.get(), start_text.get(), min_text.get(), max_text.get()):
        list1.insert(END,row)
Esempio n. 23
0
def search_button():
    lb1.delete(0, END)
    for row in backend.search(e1_value.get(), e2_value.get(), e3_value.get(),
                              e4_value.get()):
        lb1.insert(END, row)
Esempio n. 24
0
def search_command():
    books.delete(0, END)
    for row in backend.search(title_strVar.get(), author_strVar.get(),
                              year_strVar.get(), ISBN_strVar.get()):
        books.insert(END, row)
Esempio n. 25
0
 def search_command(self):
     self.listbox.delete(0,END)
     for row in backend.search(self.title_text.get(),self.author_text.get(),self.year_text.get(),self.isbn_text.get()):
         self.listbox.insert(END,row)
Esempio n. 26
0
def search_command():
    listbox.delete(0, END)
    for row in backend.search(et_title_text.get(), et_author_text.get(),
                              et_year_text.get(), et_isbn_text.get()):
        listbox.insert(END, row)
Esempio n. 27
0
def search_command():
    list1.delete(0, END)
    for row in backend.search(name_text.get(), relation_text.get(),
                              code_text.get(), number_text.get()):
        list1.insert(END, row)
Esempio n. 28
0
def search_command():
    lb.delete(0, END)
    for i in backend.search(UID_text.get(), title_text.get(),
                            author_text.get(), publication_text.get()):
        lb.insert(END, i)
Esempio n. 29
0
def search_command():
    l1.delete(0, END)
    for row in backend.search(title.get(), author.get(), year.get(),
                              isbn.get()):
        l1.insert(END, row)
Esempio n. 30
0
def search_command():
    list1.delete(0, END)
    for row in backend.search(Row_Current_Ind.get(), Row_Deleted_Ind.get(),
                              CPT_Codes.get(), Valid_From.get(),
                              Valid_To.get(), Key_Value.get()):
        list1.insert(End, row)
Esempio n. 31
0
def search_command():
    list1.delete(0, END)
    for row in backend.search(name_text.get(), surname_text.get(),
                              birthyear_text.get(), pesel_text.get()):
        list1.insert(END, row)
Esempio n. 32
0
    def post(self):
        """
        Handle a POST request to the API.
        
        Take a list of actions from a POST request, and do the appropriate
        action. See the documentation for this module for more information.
        
        @raise common.InputError: If no search targets are given in the target
        POST variable or if an invalid action is given.
        """
        cpu_start = quota.get_request_cpu_usage()
        
        action = self.request.get("action")
        target = self.request.get("target", "public")
        spectra = self.request.get_all("spectrum") #Some of these will be in session data
        limit = self.request.get("limit", 10)
        offset = self.request.get("offset", 0)
        algorithm = self.request.get("algorithm", "bove")
        guess = self.request.get("guess")
        spectrum_type = self.request.get("type")
        raw = self.request.get("raw", False)
        session = appengine_utilities.sessions.Session()
        user = users.get_current_user()
        response = []
        
        # First check if the user has gone over quota.
        if session.get("cpu_usage") > self.CPU_LIMIT:
            raise common.ServerError("User has gone over quota.")
        
        spectra = [open('jcamp-test.jdx').read()] # Just for testing

        # If not operating on the main project, try getting the private one.
        # But abort if target is not supposed to be a project.
        if target and target != "public":
            target = backend.Project.get(target)
            if target is None:
                raise common.InputError(targets, "Invalid project ID.")
        # Start doing the request
        if action == "compare" and target == "public":
            # Search the database for something.
            for spectrum in spectra:
                # User wants to commit a new search with a file upload.
                result = backend.search(spectrum)
                # Extract relevant information and add to the response.
                response = [(str(i.key()), i.chemical_name, i.error, i.graph_data) for i in result]
        elif action == "compare":
            # Compare multiple spectra uploaded in this session.
            response.append(backend.compare(spectra, algorithm))
        elif action == "browse":
            # Get a list of spectra from the database for browsing
            backend.auth(user, target, "view")
            # Return the database key, name, and chemical type.
            results = [(str(spectrum.key()), spectrum.chemical_name, spectrum.chemical_type)
                       for spectrum in backend.browse(target, limit, offset, guess, spectrum_type)]
            response.extend(results)
        elif action == "add":
            # Add a new spectrum to the database. Supports multiple spectra.
            backend.auth(user, target, "spectrum")
            for spectrum_data in spectra:
                backend.add(spectrum_data, target, False)
        elif action == "bulkadd":
            # Add a new spectrum to the database. Supports multiple spectra.
            if session.key().name() != "uploader":
                raise common.AuthError(user, "Only the uploader can bulkadd.")
            for spectrum_data in spectra:
                backend.add(spectrum_data, target, True)
        elif action == "delete":
            # Delete a spectrum from the database.
            backend.auth(user, target, "spectrum")
            for spectrum_data in spectra:
                backend.delete(spectrum_data, target)
        elif action == "update":
            backend.auth(user, "public", "spectrum")
            backend.update()
        elif action == "projects":
            query = "WHERE :1 IN owners OR :1 IN collaborators OR :1 in viewers"
            response.extend([(proj.key(), proj.name) for proj in Project.gql(query, user)])
        else:
            # Invalid action. Raise an error.
            raise common.InputError(action, "Invalid API action.")
        # Pass it on to self.output for processing.
        self.output(response)