librelist archives

« back to archive

blohg failed when the author directive is missing

blohg failed when the author directive is missing

From:
刘一新
Date:
2012-04-27 @ 11:36
hi all,

I've just initialize a blohg repo and serve it with blohg runsever
--repo-path my_blohg.
blohg failed to serve when I visit the page. Here is the diagonostic info:

    File "/usr/lib/python2.7/site-packages/flask/app.py", line 1518, in
__call__

    return self.wsgi_app(environ, start_response)

    File "/usr/lib/python2.7/site-packages/flask/app.py", line 1506, in
wsgi_app

    response = self.make_response(self.handle_exception(e))

    File "/usr/lib/python2.7/site-packages/flask/app.py", line 1504, in
wsgi_app

    response = self.full_dispatch_request()

    File "/usr/lib/python2.7/site-packages/flask/app.py", line 1264, in
full_dispatch_request

    rv = self.handle_user_exception(e)

    File "/usr/lib/python2.7/site-packages/flask/app.py", line 1262, in
full_dispatch_request

    rv = self.dispatch_request()

    File "/usr/lib/python2.7/site-packages/flask/app.py", line 1248, in
dispatch_request

    return self.view_functions[rule.endpoint](**req.view_args)

    File "/usr/lib/python2.7/site-packages/blohg/views.py", line 77, in
content

    images=page.images))

    File "/usr/lib/python2.7/site-packages/flask/templating.py", line 123,
in render_template

    context, ctx.app)

    File "/usr/lib/python2.7/site-packages/flask/templating.py", line 107,
in _render

    rv = template.render(context)

    File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line
894, in render

    return self.environment.handle_exception(exc_info, True)

    File "/usr/lib/python2.7/site-packages/blohg/templates/_posts.html",
line 1, in top-level template code

    {%- extends 'posts.html' %}

    File "templates/posts.html", line 1, in top-level template code

    File "templates/base.html", line 38, in top-level template code

    File "templates/posts.html", line 38, in block "body"

    File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line
372, in getattr

    return getattr(obj, attribute)

    File "/usr/lib/python2.7/site-packages/flask/helpers.py", line 555, in
__get__

    value = self.func(obj)

    File "/usr/lib/python2.7/site-packages/blohg/hgapi/models.py", line
136, in author_email

    return self.parsed_author['email']

KeyError: 'email'

When I add .. author: name <email> to each post and about.rst, thing goes
fine.

I think there is a bug in parse author email when parsing templates.


-- 
*Yi-Xin Liu, PHD*
*Department of Macromolecular Science*
*Fudan University*
*Room 415, Yuejing Building *
*Handan Rd. 220, **Shanghai, China*
*Tel +86-021-65642863*
*Mobile +86-13916819745*
http://www.mendeley.com/profiles/yi-xin-liu/

Re: [blohg] blohg failed when the author directive is missing

From:
Rafael Martins
Date:
2012-04-27 @ 14:08
Hi,

On Fri, Apr 27, 2012 at 8:36 AM, 刘一新 <liuyxpp@gmail.com> wrote:
> hi all,
>
> I've just initialize a blohg repo and serve it with blohg runsever
> --repo-path my_blohg.
> blohg failed to serve when I visit the page. Here is the diagonostic info:
>
>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1518, in
> __call__
>
>     return self.wsgi_app(environ, start_response)
>
>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1506, in
> wsgi_app
>
>     response = self.make_response(self.handle_exception(e))
>
>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1504, in
> wsgi_app
>
>     response = self.full_dispatch_request()
>
>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1264, in
> full_dispatch_request
>
>     rv = self.handle_user_exception(e)
>
>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1262, in
> full_dispatch_request
>
>     rv = self.dispatch_request()
>
>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1248, in
> dispatch_request
>
>     return self.view_functions[rule.endpoint](**req.view_args)
>
>     File "/usr/lib/python2.7/site-packages/blohg/views.py", line 77, in
> content
>
>     images=page.images))
>
>     File "/usr/lib/python2.7/site-packages/flask/templating.py", line 123,
> in render_template
>
>     context, ctx.app)
>
>     File "/usr/lib/python2.7/site-packages/flask/templating.py", line 107,
> in _render
>
>     rv = template.render(context)
>
>     File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 894,
> in render
>
>     return self.environment.handle_exception(exc_info, True)
>
>     File "/usr/lib/python2.7/site-packages/blohg/templates/_posts.html",
> line 1, in top-level template code
>
>     {%- extends 'posts.html' %}
>
>     File "templates/posts.html", line 1, in top-level template code
>
>     File "templates/base.html", line 38, in top-level template code
>
>     File "templates/posts.html", line 38, in block "body"
>
>     File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 372,
> in getattr
>
>     return getattr(obj, attribute)
>
>     File "/usr/lib/python2.7/site-packages/flask/helpers.py", line 555, in
> __get__
>
>     value = self.func(obj)
>
>     File "/usr/lib/python2.7/site-packages/blohg/hgapi/models.py", line 136,
> in author_email
>
>     return self.parsed_author['email']
>
> KeyError: 'email'
>
> When I add .. author: name <email> to each post and about.rst, thing goes
> fine.
>
> I think there is a bug in parse author email when parsing templates.
>
>
> --
> Yi-Xin Liu, PHD
> Department of Macromolecular Science
> Fudan University
> Room 415, Yuejing Building
> Handan Rd. 220, Shanghai, China
> Tel +86-021-65642863
> Mobile +86-13916819745
> http://www.mendeley.com/profiles/yi-xin-liu/

It is a bug, indeed. A easier way to fix it is add the author data to
your '~/.hgrc' file:

  [ui]
  username = Name <email@example.org>

I'll fix it in the repository, but will not rush with a release for
now, because this bug is easy to fix from the user's side, and doesn't
affect a log of people, apparently.

Thanks for reporting!

-- 
Rafael Goncalves Martins
http://rafaelmartins.eng.br/

Re: [blohg] blohg failed when the author directive is missing

From:
Rafael Martins
Date:
2012-04-28 @ 02:26
On Fri, Apr 27, 2012 at 11:08 AM, Rafael Martins
<rafael@rafaelmartins.eng.br> wrote:
> Hi,
>
> On Fri, Apr 27, 2012 at 8:36 AM, 刘一新 <liuyxpp@gmail.com> wrote:
>> hi all,
>>
>> I've just initialize a blohg repo and serve it with blohg runsever
>> --repo-path my_blohg.
>> blohg failed to serve when I visit the page. Here is the diagonostic info:
>>
>>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1518, in
>> __call__
>>
>>     return self.wsgi_app(environ, start_response)
>>
>>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1506, in
>> wsgi_app
>>
>>     response = self.make_response(self.handle_exception(e))
>>
>>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1504, in
>> wsgi_app
>>
>>     response = self.full_dispatch_request()
>>
>>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1264, in
>> full_dispatch_request
>>
>>     rv = self.handle_user_exception(e)
>>
>>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1262, in
>> full_dispatch_request
>>
>>     rv = self.dispatch_request()
>>
>>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1248, in
>> dispatch_request
>>
>>     return self.view_functions[rule.endpoint](**req.view_args)
>>
>>     File "/usr/lib/python2.7/site-packages/blohg/views.py", line 77, in
>> content
>>
>>     images=page.images))
>>
>>     File "/usr/lib/python2.7/site-packages/flask/templating.py", line 123,
>> in render_template
>>
>>     context, ctx.app)
>>
>>     File "/usr/lib/python2.7/site-packages/flask/templating.py", line 107,
>> in _render
>>
>>     rv = template.render(context)
>>
>>     File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 894,
>> in render
>>
>>     return self.environment.handle_exception(exc_info, True)
>>
>>     File "/usr/lib/python2.7/site-packages/blohg/templates/_posts.html",
>> line 1, in top-level template code
>>
>>     {%- extends 'posts.html' %}
>>
>>     File "templates/posts.html", line 1, in top-level template code
>>
>>     File "templates/base.html", line 38, in top-level template code
>>
>>     File "templates/posts.html", line 38, in block "body"
>>
>>     File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 372,
>> in getattr
>>
>>     return getattr(obj, attribute)
>>
>>     File "/usr/lib/python2.7/site-packages/flask/helpers.py", line 555, in
>> __get__
>>
>>     value = self.func(obj)
>>
>>     File "/usr/lib/python2.7/site-packages/blohg/hgapi/models.py", line 136,
>> in author_email
>>
>>     return self.parsed_author['email']
>>
>> KeyError: 'email'
>>
>> When I add .. author: name <email> to each post and about.rst, thing goes
>> fine.
>>
>> I think there is a bug in parse author email when parsing templates.
>>
>>
>> --
>> Yi-Xin Liu, PHD
>> Department of Macromolecular Science
>> Fudan University
>> Room 415, Yuejing Building
>> Handan Rd. 220, Shanghai, China
>> Tel +86-021-65642863
>> Mobile +86-13916819745
>> http://www.mendeley.com/profiles/yi-xin-liu/
>
> It is a bug, indeed. A easier way to fix it is add the author data to
> your '~/.hgrc' file:
>
>  [ui]
>  username = Name <email@example.org>
>
> I'll fix it in the repository, but will not rush with a release for
> now, because this bug is easy to fix from the user's side, and doesn't
> affect a log of people, apparently.
>
> Thanks for reporting!
>

This patch should fix the issue:
https://hg.rafaelmartins.eng.br/blohg/rev/489413e33b13

Will be available on the next release

Thanks

-- 
Rafael Goncalves Martins
http://rafaelmartins.eng.br/

Re: [blohg] blohg failed when the author directive is missing

From:
刘一新
Date:
2012-04-28 @ 02:32
great!

2012/4/28 Rafael Martins <rafael@rafaelmartins.eng.br>

> On Fri, Apr 27, 2012 at 11:08 AM, Rafael Martins
> <rafael@rafaelmartins.eng.br> wrote:
> > Hi,
> >
> > On Fri, Apr 27, 2012 at 8:36 AM, 刘一新 <liuyxpp@gmail.com> wrote:
> >> hi all,
> >>
> >> I've just initialize a blohg repo and serve it with blohg runsever
> >> --repo-path my_blohg.
> >> blohg failed to serve when I visit the page. Here is the diagonostic
> info:
> >>
> >>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1518, in
> >> __call__
> >>
> >>     return self.wsgi_app(environ, start_response)
> >>
> >>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1506, in
> >> wsgi_app
> >>
> >>     response = self.make_response(self.handle_exception(e))
> >>
> >>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1504, in
> >> wsgi_app
> >>
> >>     response = self.full_dispatch_request()
> >>
> >>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1264, in
> >> full_dispatch_request
> >>
> >>     rv = self.handle_user_exception(e)
> >>
> >>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1262, in
> >> full_dispatch_request
> >>
> >>     rv = self.dispatch_request()
> >>
> >>     File "/usr/lib/python2.7/site-packages/flask/app.py", line 1248, in
> >> dispatch_request
> >>
> >>     return self.view_functions[rule.endpoint](**req.view_args)
> >>
> >>     File "/usr/lib/python2.7/site-packages/blohg/views.py", line 77, in
> >> content
> >>
> >>     images=page.images))
> >>
> >>     File "/usr/lib/python2.7/site-packages/flask/templating.py", line
> 123,
> >> in render_template
> >>
> >>     context, ctx.app)
> >>
> >>     File "/usr/lib/python2.7/site-packages/flask/templating.py", line
> 107,
> >> in _render
> >>
> >>     rv = template.render(context)
> >>
> >>     File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line
> 894,
> >> in render
> >>
> >>     return self.environment.handle_exception(exc_info, True)
> >>
> >>     File "/usr/lib/python2.7/site-packages/blohg/templates/_posts.html",
> >> line 1, in top-level template code
> >>
> >>     {%- extends 'posts.html' %}
> >>
> >>     File "templates/posts.html", line 1, in top-level template code
> >>
> >>     File "templates/base.html", line 38, in top-level template code
> >>
> >>     File "templates/posts.html", line 38, in block "body"
> >>
> >>     File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line
> 372,
> >> in getattr
> >>
> >>     return getattr(obj, attribute)
> >>
> >>     File "/usr/lib/python2.7/site-packages/flask/helpers.py", line 555,
> in
> >> __get__
> >>
> >>     value = self.func(obj)
> >>
> >>     File "/usr/lib/python2.7/site-packages/blohg/hgapi/models.py", line
> 136,
> >> in author_email
> >>
> >>     return self.parsed_author['email']
> >>
> >> KeyError: 'email'
> >>
> >> When I add .. author: name <email> to each post and about.rst, thing
> goes
> >> fine.
> >>
> >> I think there is a bug in parse author email when parsing templates.
> >>
> >>
> >> --
> >> Yi-Xin Liu, PHD
> >> Department of Macromolecular Science
> >> Fudan University
> >> Room 415, Yuejing Building
> >> Handan Rd. 220, Shanghai, China
> >> Tel +86-021-65642863
> >> Mobile +86-13916819745
> >> http://www.mendeley.com/profiles/yi-xin-liu/
> >
> > It is a bug, indeed. A easier way to fix it is add the author data to
> > your '~/.hgrc' file:
> >
> >  [ui]
> >  username = Name <email@example.org>
> >
> > I'll fix it in the repository, but will not rush with a release for
> > now, because this bug is easy to fix from the user's side, and doesn't
> > affect a log of people, apparently.
> >
> > Thanks for reporting!
> >
>
> This patch should fix the issue:
> https://hg.rafaelmartins.eng.br/blohg/rev/489413e33b13
>
> Will be available on the next release
>
> Thanks
>
> --
> Rafael Goncalves Martins
> http://rafaelmartins.eng.br/
>



-- 
*Yi-Xin Liu, PHD*
*Department of Macromolecular Science*
*Fudan University*
*Room 415, Yuejing Building *
*Handan Rd. 220, **Shanghai, China*
*Tel +86-021-65642863*
*Mobile +86-13916819745*
http://www.mendeley.com/profiles/yi-xin-liu/