Thread (43 messages) flat view 43 messages, 4 authors, 2016-06-15

Re: [PATCH 12/19] 1/2: Add Python support library for CVS remote helper

From: Johan Herland <hidden>
Date: 2016-06-15 22:47:38

On Thursday 29 October 2009, Sverre Rabbelier wrote:
From: Johan Herland <redacted>

This patch introduces parts of a Python package called "git_remote_cvs"
containing the building blocks of the CVS remote helper.
The CVS remote helper itself is NOT part of this patch.

This patch has been improved by the following contributions:
- David Aguilar: Lots of Python coding style fixes

Cc: David Aguilar <redacted>
Signed-off-by: Johan Herland <redacted>
Signed-off-by: Sverre Rabbelier <redacted>
---

	This has my patch to util.py squashed in.
Why? Or: why that one, and not the others? Also, you might want to mention 
your contribution in the commit message itself.
quoted hunk ↗ jump to hunk
diff --git a/git_remote_cvs/util.py b/git_remote_cvs/util.py
new file mode 100644
index 0000000..d3ca487
--- /dev/null
+++ b/git_remote_cvs/util.py
@@ -0,0 +1,194 @@
[snip]
+
+def notify(msg, *args):
+	"""Print a message to stderr."""
+	print >> sys.stderr, msg % args
+
+def debug (msg, *args):
+    """Print a debug message to stderr when DEBUG is enabled."""
+    if DEBUG:
+        print >> sys.stderr, msg % args
+
+def error (msg, *args):
+    """Print an error message to stderr."""
+    print >> sys.stderr, "ERROR:", msg % args
+
+def warn(msg, *args):
+	"""Print a warning message to stderr."""
+	print >> sys.stderr, "warning:", msg % args
+
+def die (msg, *args):
+    """Print as error message to stderr and exit the program."""
+    error(msg, *args)
+    sys.exit(1)
+
+
It seems the two functions you add (notify() and warn()) have a different 
indentation than the existing code (which uses 4 spaces). Please fix.

(When I first introduced these Python patches, there was a discussion on the 
differences in indentation/style between the Git C code, and Python code, 
and it was decided to follow the Python conventions, to make the code more 
inviting to the Python community.)


...Johan

-- 
Johan Herland, [off-list ref]
www.herland.net
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help