[Pcsclite-git-commit] [website] 03/06: create_driver_version.py: factorise code

Ludovic Rousseau rousseau at moszumanska.debian.org
Thu Dec 3 18:48:54 UTC 2015


This is an automated email from the git hooks/post-receive script.

rousseau pushed a commit to branch master
in repository website.

commit 4342f4638b69fe4975ac4060671f6756a2d23740
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Wed Nov 18 20:50:44 2015 +0100

    create_driver_version.py: factorise code
    
    Use a filename variable to avoid code duplication.
---
 create_driver_version.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/create_driver_version.py b/create_driver_version.py
index d90cdd2..292497b 100755
--- a/create_driver_version.py
+++ b/create_driver_version.py
@@ -89,14 +89,15 @@ def main():
     for reader in real_list:
 
         # cache mechanism
+        filename = "../../website/.cache/" + reader
         try:
-            with open("../../website/.cache/" + reader) as f:
+            with open(filename) as f:
                 res = f.read()
         except:
             sys.stderr.write(reader + "\n")
             res = subprocess.check_output(['git', '--no-pager', 'log',
                                        '--pretty=format:%at', reader])
-            with open("../../website/.cache/" + reader, "a") as f:
+            with open(filename, "a") as f:
                 f.write(res)
 
         # get a list of commit time stamps

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/website.git



More information about the Pcsclite-cvs-commit mailing list