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

Don't error out on missing config entry #74

Open
xeruf opened this issue Sep 1, 2022 · 2 comments
Open

Don't error out on missing config entry #74

xeruf opened this issue Sep 1, 2022 · 2 comments

Comments

@xeruf
Copy link
Contributor

xeruf commented Sep 1, 2022

I commented out a config option I do not need right now, promptly causing an error:

Traceback (most recent call last):
  File "/home/janek/data/1-projects/1-personal/lazyblorg/./lazyblorg.py", line 606, in <module>
    statistics_list = lazyblorg.generate_output(generate, marked_for_feed, increment_version)
  File "/home/janek/data/1-projects/1-personal/lazyblorg/./lazyblorg.py", line 180, in generate_output
    return htmlizer.run()  # FIXXME: return value?
  File "/home/janek/data/1-projects/1-personal/lazyblorg/lib/htmlizer.py", line 214, in run
    stats_generated_persistent, stats_generated_tags = self._generate_pages_for_tags_persistent_temporal(tags)
  File "/home/janek/data/1-projects/1-personal/lazyblorg/lib/htmlizer.py", line 378, in _generate_pages_for_tags_persistent_temporal
    htmlfilename, orgfilename, htmlcontent = self._generate_page(config.TEMPORAL, entry)
  File "/home/janek/data/1-projects/1-personal/lazyblorg/lib/htmlizer.py", line 467, in _generate_page
    htmlcontent = self.sanitize_internal_links(self._replace_general_article_placeholders(entry, htmlcontent))
  File "/home/janek/data/1-projects/1-personal/lazyblorg/lib/htmlizer.py", line 2131, in _replace_general_article_placeholders
    content = self._replace_general_blog_placeholders(template)
  File "/home/janek/data/1-projects/1-personal/lazyblorg/lib/htmlizer.py", line 2091, in _replace_general_blog_placeholders
    content = content.replace('#TOP-TAG-LIST#', self._generate_top_tag_list())  # FIXXME: generate only once for performance reasons?
  File "/home/janek/data/1-projects/1-personal/lazyblorg/lib/htmlizer.py", line 2181, in _generate_top_tag_list
    if tag not in config.IGNORE_FOR_TOP_TAGS and \
AttributeError: module 'config' has no attribute 'IGNORE_FOR_TOP_TAGS'

Would be nice if lazyblorg would gracefully use an empty default.

@xeruf
Copy link
Contributor Author

xeruf commented Sep 1, 2022

For example, omitting my DISQUS_NAME should disable the commenting feature.

@novoid
Copy link
Owner

novoid commented Sep 8, 2022

Of course, you're right (again).

Feel free to adapt and hand in a pull request. It's not part of my set of requirements so I won't invest any time for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants