mirror of
https://github.com/Findus23/invoices.git
synced 2024-09-19 15:13:47 +02:00
set useful defaults for all interactive questions
This commit is contained in:
parent
00e2a77d58
commit
e7149ad443
1 changed files with 6 additions and 6 deletions
12
main.py
12
main.py
|
@ -22,19 +22,19 @@ def create_invoice():
|
||||||
config["last_id"] = current_id
|
config["last_id"] = current_id
|
||||||
invoice.locale = ask("locale", "set", set=["de", "en"], default="de")
|
invoice.locale = ask("locale", "set", set=["de", "en"], default="de")
|
||||||
invoice.id = ask("id", "int", default=current_id)
|
invoice.id = ask("id", "int", default=current_id)
|
||||||
invoice.title = ask("title")
|
invoice.title = ask("title", default=config["title"])
|
||||||
invoice.recipient = ask("recipient", "set", set=get_possible_recipents(), default=config["default_recipient"])
|
invoice.recipient = ask("recipient", "set", set=get_possible_recipents(), default=config["default_recipient"])
|
||||||
invoice.date = ask("date", "date", default="today")
|
invoice.date = ask("date", "date", default="today")
|
||||||
invoice.description = ask("description")
|
invoice.description = ask("description", default=config["description"])
|
||||||
invoice.range = ask("range")
|
invoice.range = ask("range", default=config["range"])
|
||||||
|
|
||||||
if invoice.mode == "single":
|
if invoice.mode == "single":
|
||||||
invoice.price = ask("price", "money")
|
invoice.price = ask("price", "money")
|
||||||
|
|
||||||
elif invoice.mode == "hourly":
|
elif invoice.mode == "hourly":
|
||||||
invoice.hours = ask("hours", "int")
|
invoice.hours = ask("hours", "int", default=config["hours"])
|
||||||
invoice.minutes = ask("minutes", "int")
|
invoice.minutes = ask("minutes", "int", default="0")
|
||||||
invoice.per_hour = ask("per hour", "money", default=config["default_hourly_rate"])
|
invoice.per_hour = ask("rate per hour", "money", default=config["default_hourly_rate"])
|
||||||
directory = invoice_dir + "/" + str(invoice.id)
|
directory = invoice_dir + "/" + str(invoice.id)
|
||||||
if os.path.exists(directory):
|
if os.path.exists(directory):
|
||||||
if not ask("overwrite", "boolean"):
|
if not ask("overwrite", "boolean"):
|
||||||
|
|
Loading…
Reference in a new issue