Closed greymd closed 10 months ago
Thanks for putting this together, i'm experiencing this in #181, however from a quick test i'm still running into the exact same error. Happy to help debug this PR if you need more information, or I can keep the discussion on the issue.
➜ slack-export-viewer git:(greymd/master) gh pr checkout 182 && git reset --hard
➜ slack-export-viewer git:(greymd/master) slack-export-viewer -z export.zip -p 5001 --debug --html-only
WARNING: DEBUG MODE IS ENABLED!
/var/folders/2h/rxc9f0qd5tg0qy595fzcc9zm0000gp/T/_slackviewer/9de4c73f97cfab33209489aa3663ad2fe558f973 already exists
Traceback (most recent call last):
File "/usr/local/bin/slack-export-viewer", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/slackviewer/main.py", line 95, in main
freezer.freeze()
File "/usr/local/lib/python3.11/site-packages/flask_frozen/__init__.py", line 179, in freeze
return set(page.url for page in self.freeze_yield())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask_frozen/__init__.py", line 179, in <genexpr>
return set(page.url for page in self.freeze_yield())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask_frozen/__init__.py", line 150, in freeze_yield
self.root.mkdir(parents=True, exist_ok=True)
^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'mkdir'
@nathang21
I apologize if I'm mistaken, but it seems like you may not be using the slack-export-viewer
with the changes I've made.
How about trying the following steps?
$ gh pr checkout 182 && git reset --hard
$ pip3 install -r requirements.txt
$ pip3 install -e .
$ slack-export-viewer -z export.zip -p 5001 --debug --html-only
@greymd Oops, pip3 install -e .
was the piece I was missing, not as familiar with pip as I should be. Thanks for the reply!
How soon before this PR is likely to make it into a release? It seems that it would fix an issue I reported, #181 , about being unable to output static HTML, which is important for me.
This commit addresses an AttributeError encountered when using flask_frozen v1.0.1 with CustomFreezer class. Previously, the CustomFreezer's root property was returning a string representation of the cf_output_dir, which caused compatibility issues with the latest version of flask_frozen.
This update resolves the AttributeError ('str' object has no attribute 'mkdir') and ensures our CustomFreezer class works seamlessly with flask_frozen v1.0.1.
The error resolved by this change: