forked from DylanBruner/VexEmulator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathveximplementations.py
More file actions
36 lines (30 loc) · 902 Bytes
/
veximplementations.py
File metadata and controls
36 lines (30 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import time as _time
import threading as _threading
import os as _os
def fileOpen(path: str, mode: str):
return open(_os.path.join('data/emulatedstorage/SDCard/',path), mode)
class Colors(object):
def __init__(self):
self.BLACK = (0, 0, 0)
self.BLUE = (0, 0, 255)
self.CYAN = (0, 255, 255)
self.GREEN = (0, 255, 0)
self.ORANGE = (255, 165, 0)
self.PURPLE = (128, 0, 128)
self.RED = (255, 0, 0)
self.TRANSPARENT = (0,0,0)
self.WHITE = (255, 255, 255)
self.YELLOW = (255, 255, 0)
def wait(amount: float, units: str):
if units == 'msec':
_time.sleep(amount / 1000)
elif units == 'seconds':
_time.sleep(amount)
def Thread(target: callable):
_threading.Thread(target=target).start()
new_globals = {
'wait': wait,
'Thread': Thread,
'Color': Colors(),
'open': fileOpen,
}