Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
elif o == '--passwd':
password = a
elif o == '--language':
language = a
elif o == '--database':
database = a
elif o == '--encoding':
encoding = a
if encoding is None:
import locale
encoding = locale.getlocale()[1]
if encoding is None:
encoding = locale.getdefaultlocale()[1]
s = mapi.Server()
s.connect(hostname = hostname,
port = int(port),
username = username,
password = password,
language = language,
database = database)
print("#mclient (python) connected to %s:%d as %s" % (hostname, int(port), username))
fi = sys.stdin
prompt = '%s>' % language
sys.stdout.write(prompt.encode('utf-8'))
line = fi.readline()
if encoding != 'utf-8':
prompt = unicode(prompt, 'utf-8').encode(encoding, 'replace')
while line and line != "\q\n":
elif o == '--passwd':
password = a
elif o == '--language':
language = a
elif o == '--database':
database = a
elif o == '--encoding':
encoding = a
if encoding is None:
import locale
encoding = locale.getlocale()[1]
if encoding is None:
encoding = locale.getdefaultlocale()[1]
s = mapi.Server()
s.connect(hostname = hostname,
port = int(port),
username = username,
password = password,
language = language,
database = database)
print("#mclient (python) connected to %s:%d as %s" % (hostname, int(port), username))
fi = sys.stdin
prompt = '%s>' % language
sys.stdout.write(prompt.encode('utf-8'))
line = fi.readline()
if encoding != 'utf-8':
prompt = str(prompt, 'utf-8').encode(encoding, 'replace')
while line and line != "\q\n":