diff --git a/mylib/email.py b/mylib/email.py index e90f1d7..9370de2 100644 --- a/mylib/email.py +++ b/mylib/email.py @@ -143,6 +143,7 @@ class EmailClient( section.add_option( StringOption, "templates_path", + default=self._defaults["templates_path"], comment="Path to templates directory", ) diff --git a/mylib/scripts/email_test_with_config.py b/mylib/scripts/email_test_with_config.py index b20b336..2533eac 100644 --- a/mylib/scripts/email_test_with_config.py +++ b/mylib/scripts/email_test_with_config.py @@ -18,12 +18,11 @@ def main(argv=None): # pylint: disable=too-many-locals,too-many-statements config = Config(__doc__, __name__.replace(".", "_")) email_client = EmailClient(config=config) - email_client.configure() - config.set_default( - "email", + email_client.set_default( "templates_path", os.path.join(os.path.dirname(os.path.realpath(__file__)), "email_templates"), ) + email_client.configure() # Options parser parser = config.get_arguments_parser(description=__doc__)