To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.8% of users enabled 2FA.

Commit eb9e876f authored by Stefan Marr's avatar Stefan Marr
Browse files

Move raw_input to rlib


Signed-off-by: default avatarStefan Marr <git@stefan-marr.de>
parent f45c9940
......@@ -15,4 +15,20 @@ def path_split(path):
else:
ext = file_and_ext[-1]
file_name = file_and_ext[0]
return (path, file_name, ext)
\ No newline at end of file
return (path, file_name, ext)
def _read_raw(answer):
buf = os.read(1, 32)
if len(buf) == 0:
return (answer, False)
elif buf[-1] == "\n":
return (answer + buf[:-1], False)
else:
return (answer + buf, True)
def raw_input(msg = ""):
os.write(1, msg)
answer, cont = _read_raw("")
while cont:
answer, cont = _read_raw(answer)
return answer
from rpython.rlib.objectmodel import we_are_translated
from rlib.osext import raw_input
class Shell(object):
def __init__(self, universe, interpreter):
......@@ -11,7 +13,7 @@ class Shell(object):
self._bootstrap_method = method
def start(self):
from som.vm.universe import std_println, error_println, raw_input
from som.vm.universe import std_println, error_println
counter = 0
it = self._universe.nilObject
......
......@@ -588,23 +588,6 @@ def std_print(msg):
def std_println(msg=""):
print msg
def _read_raw(answer):
buf = os.read(1, 32)
if len(buf) == 0:
return (answer, False)
elif buf[-1] == "\n":
return (answer + buf[:-1], False)
else:
return (answer + buf, True)
def raw_input(msg=""):
os.write(1, msg)
answer, cont = _read_raw("")
while cont:
answer, cont = _read_raw(answer)
return answer
def main(args):
u = Universe()
u.interpret(args[1:])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment