Pietrob5 / Password-Manager

A simple password manager that uses encription with python
1 stars 3 forks source link

Add files via upload #2

Closed kun4LGit closed 2 months ago

kun4LGit commented 2 months ago
Pietrob5 commented 2 months ago

@kun4LGit thank you for all your work. I tested your code and I really like how GUI looks. However I found some big problems:

Is there a way to implement a GUI without changing the base functions I wrote (or making as little changhes as possible)? This would be the best way to ensure security and the proper functioning of the program. What I mean is that, for example, functions like add_password or get_password are the same and take as input what I write in the input boxes (like if it's a form in html). The result, isntead of being printed in the console, should be printed in the GUI (as you already implemented). As a first version, we can avoid adding the various checks for empty input, etc and focus on making it work wiht "perfect" inputs. Thank you again for your effort, really appreciated. Tell me if you have some doubts.

kun4LGit commented 2 months ago

@kun4LGit thank you for all your work. I tested your code and I really like how GUI looks. However I found some big problems:

  • Queries don't work (add and view are somehow broken)
  • I like that in add when you inster master password it shows only ***, and I'd like it everywhere I have to input the MasterPassword
  • pm.py CLI version has the same problem with queries as GUI

Is there a way to implement a GUI without changing the base functions I wrote (or making as little changhes as possible)?

I already fixed the empty value problem so you dont have to but just in slight different manner explained in 3rd point. Then I uploaded and did pull request just few mins before you made changes to the main pm.py, I think thats why the code broke as GUI was relayed on the changes i made. Can you please check the code with the edit i made in pm.py on my forked version profile. Everything is running smooth on my end.

Even i dont like making change to core functions the few changes i did to printall only cause i found the empty value crash and mainly to get / fetch the data returned from function as dictionary {} which solved many problems.

  1. We get every value but we choose what we have to print be it single or in combination like email password note, So 1 function works for fetching any kind of data
  2. Even for CLI you could print

(f"Service: '{resList_Return.get('Service')}', Email: '{resList_Return.get('Email')}', Password: '{resList_Return.get('Password')}', Note: {resList_Return.get('Note')}") OR f"Single Value Example Email : {resList_Return.get('Email')}"

  1. Since the Exception Handling was not working upon empty value which led to crash and was problem for both CLI and GUI I just added the 'if else' inside except block and we pass it without crashing. It just adds an existing empty / default value dictionary to our main result dictionary from printall function and we break the except block safely for print #193 > #201 > #209.
    #193
    except:            
                if resList == {}:                                    
                    pass
                else:
                    resList_Return.clear()
                    resList_Return.update(resList)                                
                    break         

If all works well from my fork then if possible can we revert back to printall function ? As the whole gui fetching data is dependent on it, I just have to arrange make it look organised in the pop up result upon submit (you can see it working in my fork version) Or i will have re dig and solve a lot of stuff again.. You can change the way stuff prints for CLI #204 But i will let you decide :) Untitled

Pietrob5 commented 2 months ago

@kun4LGit actually to test it I copied and pasted the 2 files you committed into new .py files on my PC and run with python pm_gui,py and it doesn't work. I made some modifications to them and it seems to work, but not 100% sure, still working on it. If you want add me on discord: Пьетро (pietro09886)

Pietrob5 commented 2 months ago

@kun4LGit take a look at the new pm.py and pm_gui.py I just uploaded. As you can see in pm_gui.py I use functions declared in pm.py by importing it. At the moment only 3 service work (add, view all database and all service linked to one email) but shouldn't be too difficult to implement all the other since the "backend" is already made. Did you understand what I mean by using the functions altready declared in pm.py? I had to modify them to make them return a list with the results, but now the 3 serveces work both in CLI and GUI versions

kun4LGit commented 2 months ago

@kun4LGit take a look at the new pm.py and pm_gui.py I just uploaded. As you can see in pm_gui.py I use functions declared in pm.py by importing it. At the moment only 3 service work (add, view all database and all service linked to one email) but shouldn't be too difficult to implement all the other since the "backend" is already made. Did you understand what I mean by using the functions altready declared in pm.py? I had to modify them to make them return a list with the results, but now the 3 serveces work both in CLI and GUI versions

Yes i got it thats what i try to do in old function too. But no problem i think you got the idea what i was trying to say :D The list trick will also work. I will check out the new changes and go through them soon.. 👍