Skip to content

Commit

Permalink
Added creation_date,portal_url and email_id in savepass
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurilahane committed Jan 13, 2020
1 parent dba29cf commit f2c86a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions genpass/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import sqlite3 # library for database


class DatabaseConnection(object):
class DatabaseConnection():
""" Class of database entries for user's information."""

def __init__(self):
Expand All @@ -44,10 +44,10 @@ def create_table(self):
def insert_data(self, portal_name, password, creation_date, email, portal_url):
"""Adding values into database"""
try:
self.portal_name = portal_name
self.password = password
self.creation_date = creation_date
self.email = email
self.portal_name = portal_name
self.portal_url = portal_url
self.cursor_obj.execute(
"""INSERT INTO passwords
Expand Down
5 changes: 4 additions & 1 deletion genpass/password.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ def savepass():
"""Used to take portal name and password from user"""
portal_name = click.prompt("Enter portal name", default="None")
pwd = click.prompt("Enter your password", default="None", hide_input=True)
creation_date = date.today()
email = click.prompt("Enter email id", default="None")
portal_url = click.prompt("Enter portal url", default="None")
db_obj.create_table()
db_obj.insert_data(portal_name=portal_name, password=pwd)
db_obj.insert_data(portal_name=portal_name, password=pwd, creation_date=creation_date, email=email, portal_url=portal_url)


@click.command(help="Create new password")
Expand Down

0 comments on commit f2c86a8

Please sign in to comment.