Skip to content

Commit

Permalink
Move default values to arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Oct 17, 2023
1 parent dab4ced commit 434be29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 0 additions & 4 deletions isimip_publisher/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ class Settings(BaseSettings):
def setup(self, args):
super().setup(args)

self.MOCK = self.MOCK.lower() in ['true', 't', '1']
self.RESTRICTED = self.RESTRICTED.lower() in ['true', 't', '1']
self.DATACITE_TEST_MODE = self.DATACITE_TEST_MODE.lower() in ['true', 't', '1']

if self.ISIMIP_DATA_URL is not None:
self.ISIMIP_DATA_URL = self.ISIMIP_DATA_URL.rstrip('/')

Expand Down
9 changes: 3 additions & 6 deletions isimip_publisher/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ def get_parser(add_path=False, add_subparsers=False):
help='Archive directory')
parser.add_argument('--database', dest='database',
help='Database connection string, e.g. postgresql+psycopg2://username:password@host:port/dbname')
parser.add_argument('--mock', dest='mock',
default='false',
parser.add_argument('--mock', dest='mock', action='store_true', default=False,
help='If set to True, no files are actually copied. Empty mock files are used instead')
parser.add_argument('--restricted', dest='restricted',
default='false',
parser.add_argument('--restricted', dest='restricted', action='store_true', default=False,
help='If set to True, the files are flaged as restricted in the database.')
parser.add_argument('--protocol-location', dest='protocol_locations',
default='https://protocol.isimip.org https://protocol2.isimip.org',
Expand All @@ -78,8 +76,7 @@ def get_parser(add_path=False, add_subparsers=False):
parser.add_argument('--datacite-prefix', dest='datacite_prefix',
default='10.48364',
help='Prefix for DataCite')
parser.add_argument('--datacite-test-mode', dest='datacite_test_mode',
default='false',
parser.add_argument('--datacite-test-mode', dest='datacite_test_mode', action='store_true', default=False,
help='If set to True, the test version of DataCite is used')
parser.add_argument('--isimip-data-url', dest='isimip_data_url',
default='https://data.isimip.org/',
Expand Down

0 comments on commit 434be29

Please sign in to comment.