summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Rackham <srackham@methods.co.nz>2009-09-14 18:17:53 +1200
committerStuart Rackham <srackham@methods.co.nz>2009-09-14 18:17:53 +1200
commitd8888fe9b15b6afc058917a08f682c5da14a5ebe (patch)
tree470654718c50bcb4bbf959841f5762a6bcb75fdc
parent82a20381e709e15563a8a27d2bfb78648b5d6a3e (diff)
downloadasciidoc-py3-d8888fe9b15b6afc058917a08f682c5da14a5ebe.tar.gz
Added program name suffix to console messages.
-rwxr-xr-xa2x.py2
-rwxr-xr-xasciidoc.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/a2x.py b/a2x.py
index c006adf..3776a7c 100755
--- a/a2x.py
+++ b/a2x.py
@@ -169,6 +169,8 @@ def shell(cmd, raise_error=True):
If raise_error is True then a non-zero return terminates the application.
'''
if os.name == 'nt':
+ # TODO: this is probably unnecessary, see:
+ # http://groups.google.com/group/asciidoc/browse_frm/thread/9442ee0c419f1242
# Windows doesn't like running scripts directly so explicitly
# specify python interpreter.
# Extract first (quoted or unquoted) argument.
diff --git a/asciidoc.py b/asciidoc.py
index 5dfb2df..042ad21 100755
--- a/asciidoc.py
+++ b/asciidoc.py
@@ -144,6 +144,8 @@ class Message:
"""
Message functions.
"""
+ PROG = os.path.basename(os.path.splitext(__file__)[0])
+
def __init__(self):
self.linenos = None # Used to globally override line numbers.
self.messages = []
@@ -151,7 +153,7 @@ class Message:
def stderr(self,line=''):
self.messages.append(line)
if __name__ == '__main__':
- sys.stderr.write(line+os.linesep)
+ sys.stderr.write('%s: %s%s' % (self.PROG, line, os.linesep))
def verbose(self, msg,linenos=True):
if config.verbose: