-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DD-1637 Add age option to deposit-createreport script #66
DD-1637 Add age option to deposit-createreport script #66
Conversation
@@ -56,6 +62,9 @@ def main(): | |||
parser.add_argument('--bcc-email-to', dest='bcc_email_to', help='will be sent only if email-to is defined') | |||
args = parser.parse_args() | |||
|
|||
if args.age is not None and str(args.age).isnumeric(): # Note: args is a Namespace object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just tell argparse it should be in an int at line 54.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -56,6 +62,9 @@ def main(): | |||
parser.add_argument('--bcc-email-to', dest='bcc_email_to', help='will be sent only if email-to is defined') | |||
args = parser.parse_args() | |||
|
|||
if args.age is not None and str(args.age).isnumeric(): # Note: args is a Namespace object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes DD-1637 age optie voor deposit-create-report
Description of changes
added to
~/git/dans-core-systems/modules/dans-datastation-tools/src/datastation/deposit_create_report.py
add_argument('-a', '--age', dest='age', help='the number of days before today ')
When it is given in the command line, it will set the startdate argument to asked date, if it is an integer,
How to test
For example, in vagrant ssh:
python3 /vagrant/modules/dans-datastation-tools/src/datastation/deposit_create_report.py --help
Related PRs
(Add links)
Notify
@DANS-KNAW/core-systems