Permalink
Browse files

Use print as a function.

  • Loading branch information...
1 parent 52b3124 commit 2bb0f51eff0c1d5bdf236d3cea44953fdb09cf64 @andrewshadura andrewshadura committed Jul 10, 2014
View
@@ -3,7 +3,7 @@ DESTDIR=/
BUILDIR=$(CURDIR)/debian/ajenti
RPMTOPDIR=$(CURDIR)/build
PROJECT=ajenti
-VERSION=`python -c "from ajenti import __version__; print __version__"`
+VERSION=`python -c "from ajenti import __version__; print(__version__)"`
PREFIX=/usr
DATE=`date -R`
View
@@ -24,7 +24,7 @@ class UHTTPConnection (httplib.HTTPConnection):
if len(sys.argv) < 2:
- print 'Usage: ajenti-ipc <endpoint> [arguments]'
+ print('Usage: ajenti-ipc <endpoint> [arguments]')
sys.exit(1)
url = sys.argv[1] + '/' + '\n'.join(sys.argv[2:]).encode('base64').strip()
View
@@ -49,15 +49,15 @@ class PidFile(object):
def usage():
- print """
+ print("""
Usage: %s [options]
Options:
-c, --config <file> - Use given config file instead of default
-v - Debug/verbose logging
-d, --daemon - Run in background (daemon mode)
-h, --help - This help
--set-platform <id> - Override OS detection
- """
+ """)
if __name__ == '__main__':
@@ -67,7 +67,7 @@ if __name__ == '__main__':
try:
opts, args = getopt.getopt(sys.argv[1:], 'hc:dv', ['help', 'config=', 'daemon', 'set-platform='])
except getopt.GetoptError as e:
- print str(e)
+ print(str(e))
usage()
sys.exit(2)
View
@@ -5,7 +5,7 @@ import json
import subprocess
if len(sys.argv) < 2:
- print 'Usage: ajenti-ssl-gen <hostname> [-f]'
+ print('Usage: ajenti-ssl-gen <hostname> [-f]')
sys.exit(1)
host = sys.argv[1]
@@ -17,7 +17,7 @@ marker_path = '/etc/ajenti/.ssl-generated'
conf = json.loads(open(config_path).read())
if len(sys.argv) == 2:
if os.path.exists(marker_path):
- print ':: SSL is already configured'
+ print(':: SSL is already configured')
sys.exit(1)
@@ -45,4 +45,4 @@ open(config_path, 'w').write(json.dumps(conf, indent=4))
open(marker_path, 'w').close()
-print ':: SSL configured!'
+print(':: SSL configured!')
@@ -340,7 +340,7 @@ def load(self, name):
logging.warn(' *** [%s] Plugin error: %s' % (name, e))
except PluginCrashed as e:
logging.warn(' *** [%s] Plugin crashed: %s' % (name, e))
- print e.traceback
+ print(e.traceback)
info.crash = e
except Dependency.Unsatisfied as e:
logging.warn(' *** [%s] skipping due to %s' % (name, e))
@@ -18,7 +18,7 @@ def handle_resources(self, context, type):
if ajenti.debug:
if time.time() - self.last_query > 5:
try:
- print subprocess.check_output('./compile_resources.py nocompress', shell=True)
+ print(subprocess.check_output('./compile_resources.py nocompress', shell=True))
except:
pass
ContentCompressor.get().compress()
View
@@ -486,7 +486,7 @@ def __init__(self, object=None, ui=None):
def __warn_new_binder(self, s):
import traceback; traceback.print_stack();
warnings.warn(s, DeprecationWarning)
- print 'Binding syntax has been changed: see http://docs.ajenti.org/en/latest/dev/binding.html'
+ print('Binding syntax has been changed: see http://docs.ajenti.org/en/latest/dev/binding.html')
def setup(self, object=None):
"""
@@ -57,7 +57,7 @@ def check_password(self, username, password):
try:
return bool(l.bind_s('%s\\%s' % (self.classconfig['domain'], username), password))
except Exception as e:
- print e
+ print(e)
return False
def __search(self):
@@ -54,7 +54,7 @@ def check_password(self, username, password):
try:
return bool(l.bind_s('cn=%s,' % username + self.classconfig['auth_dn'], password))
except Exception as e:
- print e
+ print(e)
return False
def sync(self):

0 comments on commit 2bb0f51

Please sign in to comment.