OSDN Git Service
(root)
/
ti2
/
ti2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix debug_out, error_out, warn_out method
[ti2/ti2.git]
/
linkpair
/
utils
/
common.py
diff --git
a/linkpair/utils/common.py
b/linkpair/utils/common.py
index
5606fc1
..
9aad16c
100755
(executable)
--- a/
linkpair/utils/common.py
+++ b/
linkpair/utils/common.py
@@
-2,15
+2,17
@@
# -*- coding: utf-8 -*-
#
# -*- coding: utf-8 -*-
#
-__version__ = '1.1'
-
+from __future__ import print_function
import re
import re
-
+import sys
class CommonUtils(object):
def __init__(self):
self._tmp_stack = []
class CommonUtils(object):
def __init__(self):
self._tmp_stack = []
+
+ def set_opts(self, opts):
+ self._opts = opts
def d_push(self, x):
self._tmp_stack.append(x)
def d_push(self, x):
self._tmp_stack.append(x)
@@
-20,15
+22,21
@@
class CommonUtils(object):
return self._tmp_stack.pop()
def verbose_out(self, msg):
return self._tmp_stack.pop()
def verbose_out(self, msg):
- if self.opts.verbose is True:
- print
msg
+ if self.
_
opts.verbose is True:
+ print
r("[verbose]: " + msg, file=sys.stderr)
def debug_out(self, msg):
def debug_out(self, msg):
- if self.opts.debug is True:
- print "debug: " + msg
+ if self._opts.debug is True:
+ print("[debug]: " + msg, file=sys.stderr)
+
+ def warn_out(self, msg):
+ print("[warn]: " + msg, file=sys.stderr)
+
+ def error_out(self, msg):
+ print("[error]: " + msg, file=sys.stderr)
def message_out(self, msg):
def message_out(self, msg):
- print
msg
+ print
(msg)
def parse_remote_desc(self, remote_desc):
ssh_username = ""
def parse_remote_desc(self, remote_desc):
ssh_username = ""