Skip to content
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

Conversation

aliassheikh
Copy link
Contributor

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

@aliassheikh aliassheikh requested a review from a team as a code owner September 10, 2024 13:28
@@ -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
Copy link
Contributor

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.

Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janvanmansum janvanmansum merged commit 9f9c283 into DANS-KNAW:master Sep 24, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants