From: Steinar Bang <sb@dod.no>
To: emacs-orgmode@gnu.org
Subject: Re: Minimal overhead Org-mode blogging system
Date: Sun, 15 Jan 2012 19:08:54 +0100 [thread overview]
Message-ID: <87pqek6dop.fsf@dod.no> (raw)
In-Reply-To: CALnw1fQUf8Bv1Jc4KjCjDRba8MgzAdijp4m_=SxPUrcdBWYtcQ@mail.gmail.com
>>>>> Puneeth Chaganti <punchagan@gmail.com>:
[snip!]
>>>>> https://github.com/punchagan/blog-files
> I've added a short README that tries to include the things that you
> are looking for. But, it's something I wrote up quickly. Feel free
> to ask any specific questions.
I've been trying to use it, but I keep running into issues with
reprise.pay.
The latest one, is:
Traceback (most recent call last):
File "reprise.py", line 258, in <module>
env.get_template('cloud.html'))
File "reprise.py", line 140, in generate_tag_cloud
maxFreq = max(t['freq'] for t in tag_freq)
ValueError: max() arg is an empty sequence
The code for this, is:
def generate_tag_cloud(entries, template):
tags = sum([e['tags'] for e in entries], [])
tag_freq = [{'tag': tag, 'freq': tags.count(tag)} for tag in set(tags)
if tags.count(tag) > 3]
maxFreq = max(t['freq'] for t in tag_freq)
...
I've debugged this with pdb (`M-x pdb'), and tag_freq is empty.
If I'm interpreting the python code correctly (I don't know python...)
only those tags that have more than 3 occurrences will be in the
tag_freq collection...?
My problem is that I have only one article, my first, so obviously the
tag_freq collection will stay emtpy, and reprise.py will crash...
I tried removing the test, ie.
def generate_tag_cloud(entries, template):
tags = sum([e['tags'] for e in entries], [])
tag_freq = [{'tag': tag, 'freq': tags.count(tag)} for tag in set(tags)]
maxFreq = max(t['freq'] for t in tag_freq)
...
but that just gave me a different error (division by zero):
File "reprise.py", line 257, in <module>
env.get_template('cloud.html'))
File "reprise.py", line 147, in generate_tag_cloud
'freq': t['freq']} for t in tag_freq]
File "reprise.py", line 144, in normalize
return min_r + (val - min_f) * (max_r - min_r) / float (max_f - min_f)
Any ideas of how to proceed?
Thanks!
- Steinar
next prev parent reply other threads:[~2012-01-15 18:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-04 16:51 Minimal overhead Org-mode blogging system Karl Voit
2011-12-07 16:30 ` Steinar Bang
2011-12-07 17:20 ` Puneeth Chaganti
2011-12-07 20:11 ` Eric Schulte
2011-12-11 13:20 ` Bastien
2011-12-08 0:31 ` Karl Voit
2011-12-08 4:29 ` Puneeth Chaganti
2011-12-08 14:19 ` Karl Voit
2011-12-08 16:45 ` Puneeth Chaganti
2011-12-08 22:02 ` Karl Voit
2012-01-15 18:08 ` Steinar Bang [this message]
2012-01-16 22:54 ` Puneeth Chaganti
2012-01-19 22:15 ` Steinar Bang
2012-01-20 18:19 ` Chris Gray
2012-01-21 5:15 ` Scott Randby
2012-01-21 5:53 ` Nick Dokos
2012-01-21 6:26 ` Chris Gray
2012-01-17 18:50 ` tychoish
2012-01-18 3:06 ` Eric Schulte
2012-01-20 16:10 ` Bastien
2012-02-11 13:47 ` François Pinard
2011-12-11 4:33 ` Nathan Neff
2012-05-13 14:54 ` Neil Smithline
2012-05-15 2:24 ` Jude DaShiell
2012-05-16 0:48 ` Neil Smithline
2012-05-16 9:51 ` Jude DaShiell
2012-05-20 21:48 ` Neil Smithline
2012-06-17 8:09 ` Karl Voit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pqek6dop.fsf@dod.no \
--to=sb@dod.no \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).