[projects/git-slug: 98/170] Some whitespace cosmetics
glen
glen at pld-linux.org
Mon Sep 21 21:47:03 CEST 2015
commit 36a0ffce7b63919c890109999a92bcceb17849b0
Author: Kacper Kornet <draenog at pld-linux.org>
Date: Wed Mar 21 03:48:56 2012 +0000
Some whitespace cosmetics
git_slug/gitconst.py | 4 ++--
git_slug/refsdata.py | 8 ++++----
slug.py | 20 ++++++++++----------
slug_watch | 2 +-
4 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/git_slug/gitconst.py b/git_slug/gitconst.py
index a0becdb..4a702ce 100644
--- a/git_slug/gitconst.py
+++ b/git_slug/gitconst.py
@@ -1,8 +1,8 @@
from os.path import join
-EMPTYSHA1='0000000000000000000000000000000000000000'
+EMPTYSHA1 = '0000000000000000000000000000000000000000'
REMOTE_NAME = 'origin'
-REMOTEREFS=join('refs/remotes/',REMOTE_NAME)
+REMOTEREFS = join('refs/remotes/', REMOTE_NAME)
GITLOGIN = 'draenog@'
GITSERVER = 'carme.pld-linux.org'
diff --git a/git_slug/refsdata.py b/git_slug/refsdata.py
index fd812a8..97ce448 100644
--- a/git_slug/refsdata.py
+++ b/git_slug/refsdata.py
@@ -14,7 +14,7 @@ class RemoteRefsData:
def __init__(self, stream, pattern, dirpattern=('*',)):
self.heads = collections.defaultdict(lambda: collections.defaultdict(lambda: EMPTYSHA1))
pats = re.compile('|'.join(fnmatch.translate(os.path.join('refs/heads', p)) for p in pattern))
- dirpat=re.compile('|'.join(fnmatch.translate(p) for p in dirpattern))
+ dirpat = re.compile('|'.join(fnmatch.translate(p) for p in dirpattern))
for line in stream.readlines():
if isinstance(line, bytes):
line = line.decode("utf-8")
@@ -30,9 +30,9 @@ class RemoteRefsData:
def dump(self, stream):
for repo in sorted(self.heads):
- for ref in sorted(self.heads[repo]):
- if self.heads[repo][ref] != EMPTYSHA1:
- stream.write('{} {} {}\n'.format(self.heads[repo][ref], ref, repo))
+ for ref in sorted(self.heads[repo]):
+ if self.heads[repo][ref] != EMPTYSHA1:
+ stream.write('{} {} {}\n'.format(self.heads[repo][ref], ref, repo))
class GitRemoteRefsData(RemoteRefsData):
def __init__(self, path, pattern, dirpattern=('*')):
diff --git a/slug.py b/slug.py
index ba9ffba..bfac53a 100755
--- a/slug.py
+++ b/slug.py
@@ -51,15 +51,15 @@ def readconfig(path):
config.read(path)
optionslist = {}
for option in ('newpkgs', 'prune'):
- if config.has_option('PLD',option):
+ if config.has_option('PLD', option):
optionslist[option] = config.getboolean('PLD', option)
for option in ('depth', 'repopattern', 'packagesdir', 'remoterefs'):
- if config.has_option('PLD',option):
+ if config.has_option('PLD', option):
optionslist[option] = config.get('PLD', option)
if config.has_option('PLD','branch'):
optionslist['branch'] = config.get('PLD', 'branch').split()
for option in ('jobs'):
- if config.has_option('PLD',option):
+ if config.has_option('PLD', option):
optionslist[option] = config.getint('PLD', option)
for pathopt in ('packagesdir', 'remoterefs'):
@@ -69,8 +69,8 @@ def readconfig(path):
def initpackage(name, options):
repo = GitRepo(os.path.join(options.packagesdir, name))
- remotepush = os.path.join(GIT_REPO_PUSH ,name)
- repo.init(os.path.join(GIT_REPO,name), remotepush)
+ remotepush = os.path.join(GIT_REPO_PUSH, name)
+ repo.init(os.path.join(GIT_REPO, name), remotepush)
return repo
def createpackage(name, options):
@@ -94,7 +94,7 @@ def fetch_packages(options):
try:
refs = GitRemoteRefsData(options.remoterefs, options.branch, options.repopattern)
except GitRepoError as e:
- print('Problem with repository {}: {}'.format(options.remoterefs,e), file=sys.stderr)
+ print('Problem with repository {}: {}'.format(options.remoterefs, e), file=sys.stderr)
sys.exit(1)
except RemoteRefsError as e:
print('Problem with file {} in repository {}'.format(*e), file=sys.stderr)
@@ -102,7 +102,7 @@ def fetch_packages(options):
print('Read remotes data')
- updated_repos=[]
+ updated_repos = []
for dir in sorted(refs.heads):
gitdir = os.path.join(options.packagesdir, dir, '.git')
if not os.path.isdir(gitdir):
@@ -129,13 +129,13 @@ def fetch_packages(options):
try:
refs = GitRemoteRefsData(options.remoterefs, '*')
except GitRepoError as e:
- print('Problem with repository {}: {}'.format(options.remoterefs,e), file=sys.stderr)
+ print('Problem with repository {}: {}'.format(options.remoterefs, e), file=sys.stderr)
sys.exit(1)
except RemoteRefsError as e:
print('Problem with file {} in repository {}'.format(*e), file=sys.stderr)
sys.exit(1)
for pattern in options.repopattern:
- for fulldir in glob.iglob(os.path.join(options.packagesdir,pattern)):
+ for fulldir in glob.iglob(os.path.join(options.packagesdir, pattern)):
dir = os.path.basename(fulldir)
if len(refs.heads[dir]) == 0 and os.path.isdir(os.path.join(fulldir, '.git')):
print('Removing', fulldir)
@@ -153,7 +153,7 @@ def list_packages(options):
try:
refs = GitRemoteRefsData(options.remoterefs, options.branch, options.repopattern)
except GitRepoError as e:
- print('Problem with repository {}: {}'.format(options.remoterefs,e), file=sys.stderr)
+ print('Problem with repository {}: {}'.format(options.remoterefs, e), file=sys.stderr)
sys.exit(1)
except RemoteRefsError as e:
print('Problem with file {} in repository {}'.format(*e), file=sys.stderr)
diff --git a/slug_watch b/slug_watch
index 32564b7..ac35016 100755
--- a/slug_watch
+++ b/slug_watch
@@ -101,7 +101,7 @@ def runwatch(user=None):
notifier = pyinotify.Notifier(wm, EventHandler())
wdd = wm.add_watch(WATCHDIR, mask, rec=False)
for filename in sorted(os.listdir(WATCHDIR), key=lambda f: os.stat(os.path.join(WATCHDIR, f)).st_mtime):
- process_file(os.path.join(WATCHDIR,filename))
+ process_file(os.path.join(WATCHDIR, filename))
notifier.loop()
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5
More information about the pld-cvs-commit
mailing list