[skeleton] Properly format debian/changelog using current datetime and author information
authorDenis Laxalde <denis.laxalde@logilab.fr>
Wed, 05 Oct 2016 10:12:23 +0200
changeset 11716 c7de052ee288
parent 11715 760d5c0ae08f
child 11723 d8072617af3b
[skeleton] Properly format debian/changelog using current datetime and author information Reformat "context" dict to have it PEP8 compliant along the way (only white space changes).
cubicweb/devtools/devctl.py
cubicweb/skeleton/debian/changelog.tmpl
--- a/cubicweb/devtools/devctl.py	Wed Oct 12 11:07:10 2016 +0200
+++ b/cubicweb/devtools/devctl.py	Wed Oct 05 10:12:23 2016 +0200
@@ -30,6 +30,7 @@
 from os import mkdir, chdir, path as osp
 from warnings import warn
 
+from pytz import UTC
 from six.moves import input
 
 from logilab.common import STD_BLACKLIST
@@ -651,19 +652,21 @@
         }
         if verbose:
             dependencies.update(self._ask_for_dependencies())
-        context = {'cubename' : cubename,
-                   'distname' : distname,
-                   'shortdesc' : shortdesc,
-                   'longdesc' : longdesc or shortdesc,
-                   'dependencies' : dependencies,
-                   'version'  : cubicwebversion,
-                   'year'  : str(date.today().year),
-                   'author': self['author'],
-                   'author-email': self['author-email'],
-                   'author-web-site': self['author-web-site'],
-                   'license': self['license'],
-                   'long-license': self.LICENSES[self['license']],
-                   }
+        context = {
+            'cubename': cubename,
+            'distname': distname,
+            'shortdesc': shortdesc,
+            'longdesc': longdesc or shortdesc,
+            'dependencies': dependencies,
+            'version': cubicwebversion,
+            'year': str(date.today().year),
+            'author': self['author'],
+            'author-email': self['author-email'],
+            'rfc2822-date': datetime.now(tz=UTC).strftime('%a, %d %b %Y %T %z'),
+            'author-web-site': self['author-web-site'],
+            'license': self['license'],
+            'long-license': self.LICENSES[self['license']],
+        }
         exclude = SKEL_EXCLUDE
         if self['layout'] == 'simple':
             exclude += ('sobjects.py*', 'precreate.py*', 'realdb_test*',
--- a/cubicweb/skeleton/debian/changelog.tmpl	Wed Oct 12 11:07:10 2016 +0200
+++ b/cubicweb/skeleton/debian/changelog.tmpl	Wed Oct 05 10:12:23 2016 +0200
@@ -2,5 +2,5 @@
 
   * initial release
 
- -- 
+ -- %(author)s <%(author-email)s>  %(rfc2822-date)s