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

AttributeError: 'MkdocsWithConfluence' object has no attribute 'dryrun' #20

Open
theD1360 opened this issue Apr 5, 2023 · 3 comments
Open

Comments

@theD1360
Copy link

theD1360 commented Apr 5, 2023

First off, thank you for writing this plugin. This is going to help me greatly.

Unfortunately when trying to get this plugin running I am encountering the following error:

ERROR    -  Error reading page 'index.md': 'MkdocsWithConfluence' object has no attribute 'dryrun'
Traceback (most recent call last):
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/lib/python3.9/site-packages/mkdocs/__main__.py", line 250, in build_command
    build.build(cfg, dirty=not clean)
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/lib/python3.9/site-packages/mkdocs/commands/build.py", line 308, in build
    _populate_page(file.page, config, files, dirty)
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/lib/python3.9/site-packages/mkdocs/commands/build.py", line 177, in _populate_page
    page.markdown = config.plugins.run_event(
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/lib/python3.9/site-packages/mkdocs/plugins.py", line 520, in run_event
    result = method(item, **kwargs)
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/lib/python3.9/site-packages/mkdocs_with_confluence/plugin.py", line 274, in on_page_markdown
    self.update_page(page.title, confluence_body)
  File "/Users/theD1360/Library/Caches/pypoetry/virtualenvs/docs-project-A5zrhKJ8-py3.9/lib/python3.9/site-packages/mkdocs_with_confluence/plugin.py", line 571, in update_page
    if not self.dryrun:
AttributeError: 'MkdocsWithConfluence' object has no attribute 'dryrun'

Environment:

Software Version
python 3.9
poetry 1.4.0
mkdocs ^1.4.2
mkdocs-material ^9.1.5
mkdocs-with-confluence ^0.2.7

mkdocs.yaml

plugins:
  - mkdocs-with-confluence:
      host_url: https://<confluence domain>/wiki/rest/api/content
      space: ""
      parent_page_name: Qualification Engine (Qual-E)
      username: [email protected]
      password: mypassword
      dryrun: true
      verbose: true
      debug: true

One interesting thing to note is that the error seems to be limited to just that config key.
All other config items seem to be loaded properly. It seems the self.dryrun property is not getting set properly in
plugin.py.

plugin.py Line 141

 if self.config["dryrun"]:
            print("WARNING -  Mkdocs With Confluence - DRYRUN MODE turned ON")
            self.dryrun = True
        else:
            self.dryrun = False
@pawelsikora
Copy link
Owner

@theD1360 First of all: I am happy that my plugin is helpful for you!

Yep, thanks for pointing this out! It will be fixed soon🙂

@jrwpatterson
Copy link

Any update on this?

@voodooGQ
Copy link

Any update on this? Running into the same problem.

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

No branches or pull requests

4 participants