posativ / acrylamid

(unmaintained) static blog generator in python with incremental rendering ⛺
http://posativ.org/acrylamid/
Other
277 stars 40 forks source link

Set OUTPUT='./' causes error #160

Closed ghost closed 11 years ago

ghost commented 11 years ago

If in conf.py I put OUTPUT_DIR = './' then I receive the following error:

xan@gerret:/home/xan/proves/github/xavimat@github.com/piblog$ acrylamid gen create [0.02s] articles/index.html create [0.02s] 2013/nou-lloc-de-feina/index.html Traceback (most recent call last): File "/home/xan//.local/bin/acrylamid", line 9, in load_entry_point('acrylamid==0.7.4', 'console_scripts', 'acrylamid')() File "/home/xan/.local/lib/python2.7/site-packages/acrylamid/init.py", line 179, in Acryl commands.compile(conf, env) File "/home/xan/.local/lib/python2.7/site-packages/acrylamid/commands.py", line 222, in compile force=env.options.force, dryrun=env.options.dryrun) File "/home/xan/.local/lib/python2.7/site-packages/acrylamid/helpers.py", line 114, in mkfile os.makedirs(dirname(path)) File "/usr/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 2] El fitxer o directori no existeix: ''

(in english: the file or directory does not exist)

Thanks,

posativ commented 11 years ago

Hopefully fixed, but I do not recommend to do it that way. Anyways, you can update your current version with easy_install -U https://github.com/posativ/acrylamid/archive/legacy/0.7.zip or wait a few days when I upload a new version to PyPi.

ghost commented 11 years ago

I updated acrylamid package via pip:

pip install --upgrade --user https://github.com/posativ/acrylamid/archive/legacy/0.7.zip

but it does not work:

xan@gerret:/home/xan/proves/github/xavimat@github.com/piblog$ acrylamid --version Acrylamid 0.7.5.dev0 xan@gerret:/home/xan/proves/github/xavimat@github.com/piblog$ acrylamid co Traceback (most recent call last): File "/home/xan//.local/bin/acrylamid", line 9, in load_entry_point('acrylamid==0.7.5.dev0', 'console_scripts', 'acrylamid')() File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/init.py", line 179, in Acryl commands.compile(conf, env) File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/commands.py", line 219, in compile for buf, path in v.generate(conf, env, data): File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/views/archive.py", line 165, in generate num_entries=len(group), route=route, archive=key)) File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/templates/mako.py", line 125, in render self.template.render_context(ctx) File "/usr/lib/python3.3/site-packages/mako/template.py", line 466, in render_context _kwargs) File "/usr/lib/python3.3/site-packages/mako/runtime.py", line 815, in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) File "/usr/lib/python3.3/site-packages/mako/runtime.py", line 841, in _exectemplate callable(context, args, *_kwargs) File "/home/xan/proves/github/xavimat@github.com/piblog/.cache/cache_base.html.py", line 34, in render_body __M_writer(unicode( entry.lang if entry else conf.lang )) NameError: global name 'unicode' is not defined xan@gerret:/home/xan/proves/github/xavimat@github.com/piblog$

So, please reopen it.

posativ commented 11 years ago

Hi,

it seems that you are mixing two different versions of Python: 2.7 (first traceback) and now 3.3. You can not do this, because Mako caches to python code that is not compatible between 2.7 and 3.3. Try acrylamid co -f or remove the .cache directory manually.

ghost commented 11 years ago

Yes, sorry. I install acrylamid with pip2 (python 2) and I upgraded with pip3 (python 3). Now I uninstall acrylamid and all packages and I reinstall with pip3:

pip install --upgrade --user https://github.com/posativ/acrylamid/archive/legacy/0.7.zip

but it does not work:

xan@gerret:/home/xan$ rm .cache/ -r xan@gerret:/home/xan$ cd proves/github/xavimat\@github.com/piblog/ xan@gerret:/home/xan/proves/github/xavimat@github.com/piblog$ acrylamid co Traceback (most recent call last): File "/home/xan//.local/bin/acrylamid", line 9, in load_entry_point('acrylamid==0.7.5.dev0', 'console_scripts', 'acrylamid')() File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/init.py", line 179, in Acryl commands.compile(conf, env) File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/commands.py", line 219, in compile for buf, path in v.generate(conf, env, data): File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/views/archive.py", line 165, in generate num_entries=len(group), route=route, archive=key)) File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/templates/mako.py", line 125, in render self.template.render_context(ctx) File "/usr/lib/python3.3/site-packages/mako/template.py", line 466, in render_context _kwargs) File "/usr/lib/python3.3/site-packages/mako/runtime.py", line 815, in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) File "/usr/lib/python3.3/site-packages/mako/runtime.py", line 841, in _exectemplate callable(context, args, _kwargs) File "/home/xan/proves/github/xavimat@github.com/piblog/.cache/cache_base.html.py", line 34, in render_body M_writer(unicode( entry.lang if entry else conf.lang )) NameError: global name 'unicode' is not defined xan@gerret:/home/xan/proves/github/xavimat@github.com/piblog$ acrylamid co -f Traceback (most recent call last): File "/home/xan//.local/bin/acrylamid", line 9, in load_entry_point('acrylamid==0.7.5.dev0', 'console_scripts', 'acrylamid')() File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/__init.py", line 179, in Acryl commands.compile(conf, env) File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/commands.py", line 219, in compile for buf, path in v.generate(conf, env, data): File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/views/archive.py", line 165, in generate num_entries=len(group), route=route, archive=key)) File "/home/xan/.local/lib/python3.3/site-packages/acrylamid/templates/mako.py", line 125, in render self.template.render_context(ctx) File "/usr/lib/python3.3/site-packages/mako/template.py", line 466, in render_context _kwargs) File "/usr/lib/python3.3/site-packages/mako/runtime.py", line 815, in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) File "/usr/lib/python3.3/site-packages/mako/runtime.py", line 841, in _exectemplate callable(context, args, _kwargs) File "/home/xan/proves/github/xavimat@github.com/piblog/.cache/cache_base.html.py", line 34, in render_body __M_writer(unicode( entry.lang if entry else conf.lang )) NameError: global name 'unicode' is not defined

ghost commented 11 years ago

I think it's some error with python 3 branch of acrylamid

posativ commented 11 years ago

Did you really removed proves/github/xavimat\@github.com/piblog/.cache?

ghost commented 11 years ago

No, I removed /home/xan/.cache . Sorry ;-) Now with this removed, all is fine.

Just a question: how can I fix "no hyph-definition for 'ca'"? How can I add hyph-def for that lang?

Thanks for all, Xan.

posativ commented 11 years ago

You can download additional hyph definitions to your site-package folder: http://posativ.org/acrylamid/filters.html#hyphenate (not the nicest way currently, though).