diff options
author | Stuart Rackham <srackham@methods.co.nz> | 2009-09-14 18:17:53 +1200 |
---|---|---|
committer | Stuart Rackham <srackham@methods.co.nz> | 2009-09-14 18:17:53 +1200 |
commit | d8888fe9b15b6afc058917a08f682c5da14a5ebe (patch) | |
tree | 470654718c50bcb4bbf959841f5762a6bcb75fdc | |
parent | 82a20381e709e15563a8a27d2bfb78648b5d6a3e (diff) | |
download | asciidoc-py3-d8888fe9b15b6afc058917a08f682c5da14a5ebe.tar.gz |
Added program name suffix to console messages.
-rwxr-xr-x | a2x.py | 2 | ||||
-rwxr-xr-x | asciidoc.py | 4 |
2 files changed, 5 insertions, 1 deletions
@@ -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: |