WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.2% 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
......@@ -16,3 +16,19 @@ def path_split(path):
ext = file_and_ext[-1]
file_name = file_and_ext[0]
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