colinta / StrangeCase

It's yet another static site generator. Have you seen jekyll? hyde? Yup. Like those.
http://colinta.com/projects/StrangeCase.html
Other
49 stars 7 forks source link

generate() takes exactly 2 arguments (1 given) in __init__.py #38

Closed edbrannin closed 12 years ago

edbrannin commented 12 years ago

Attempting to run the Github version of scase (because of #37), I'm getting this error about a "site" argument not getting passed to node.generate.

C:\tmp\scase2>scase
Traceback (most recent call last):
  File "C:\Python27\Scripts\scase-script.py", line 9, in <module>
    load_entry_point('StrangeCase==v4.5.16', 'console_scripts', 'scase')()
  File "c:\users\redacted\documents\github\strangecase\strange_case\__main__.py", line 185, in run
    strange_case(CONFIG)
  File "c:\users\redacted\documents\github\strangecase\strange_case\__init__.py", line 155, in strange_case
    root_node.generate()
TypeError: generate() takes exactly 2 arguments (1 given)

Site generation kinda works if I change it to root_node.generate(None), except output files wind up in public/site/ instead of just public/ (and none of my templates are using site.x.y.z variables).

colinta commented 12 years ago

hmm, something very odd going on there. root_node should be an instance of RootFolderNode, but apparently it is something else.

colinta commented 12 years ago

it comes down to these lines in file_types.py


@provides('type')
def file_types(source_file, config):
    if os.path.isdir(source_file):
        if source_file == config['site_path']:
            config['type'] = config['default_root_type']

That check is False, and so the wrong node gets created. If you can, please let me know what source_file and config['site_path'] are at that point. It might be as simple as using os.path.abspath()

edbrannin commented 12 years ago

I'll have a look there tomorrow and let you know. I wouldn't be surprised if it's a slash-direction issue.

edbrannin commented 12 years ago

Whoops! This was actually broken because my pull request #37 was overzealous and I forgot to roll it back. I have a more localized version working, and will commit/pull-request it after cleanup.