[Reproducible-commits] [misc] 01/02: Replace multiple calls to os.path.dirname with a dirname_n utiliy.

Chris Lamb chris at chris-lamb.co.uk
Sun Aug 14 16:37:04 UTC 2016


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

lamby pushed a commit to branch master
in repository misc.

commit e165a3a559ec2f53178e8c978fe510eb6ee0d343
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Aug 14 17:36:34 2016 +0100

    Replace multiple calls to os.path.dirname with a dirname_n utiliy.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 reports/bin/generate-draft | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/reports/bin/generate-draft b/reports/bin/generate-draft
index 48eebc1..586fae9 100755
--- a/reports/bin/generate-draft
+++ b/reports/bin/generate-draft
@@ -195,10 +195,15 @@ def get_issues_yml(week_start, week_end):
 def get_packages_yml(week_start, week_end):
     return commits(week_start, week_end, 'notes', 'packages.yml')
 
+def dirname_n(filename, n):
+    for _ in range(n):
+        filename = os.path.dirname(filename)
+    return filename
+
 def commits(week_start, week_end, project, path='.'):
     # Assume its in the parent dir
     git_dir = os.path.join(
-        os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
+        dirname_n(os.path.abspath(__file__), 3),
         project,
         '.git',
     )

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



More information about the Reproducible-commits mailing list