Commits

Yu-Jie Lin committed 45d389c

Fix month=December cause incorrect list slicing and removed labels from exported file

  • Participants
  • Parent commits 3299811
  • Tags v0.0.4.2

Comments (0)

Files changed (2)

 
 ## Development
 
+## Version 0.0.4.2 (2012-12-03T02:49:21Z)
+
+ * Fix month=December cause incorrect list slicing
+ * Fix removed labels from exported file
+
 ## Version 0.0.4.1 (2012-04-25T23:31:04Z)
 
  * Fix wrong section heading level
 __author__ = 'Yu-Jie Lin'
 __copyright__ = 'Copyright 2012, Yu Jie Lin'
 __license__ = 'MIT'
-__version__ = '0.0.4.1'
+__version__ = '0.0.4.2'
 
 
 CACHE_VERSION = 1
   keys = tuple('%d-%02d' % (year, month) \
                for year in range(min_year, max_year + 1) \
                for month in range(1, 12 + 1))
-  keys = keys[min_month - 1:-(12 - max_month)]
+  keys = keys[min_month - 1:-(12 - max_month) or None]
   s_two_columns_chart(m_pc, keys, ('YYYY-MM', 'Posts', 'Comments'))
 
   section('By Year', level=2)
       import pprint
       pprint.pprint(f, json_file)
 
+  # generate list of labels, if not preset. Sometime between 12/03/2012 and
+  # 07/01/2012, labels are removed from exported file.
+  if 'label' not in f:
+    f['label'] = list(set(itertools.chain.from_iterable(p.get('label', []) for p in f['post'])))
+
   section('{} {}'.format(__program__, __version__), 0)
   print(' ', f['title'], 'by', f['author']['name'])
   print(' ', ddd(list(filter(lambda s: 'BLOG_DESCRIPTION' in s['id'], f['settings']))[0]['content'], 76))