forked from joshdentremont/fallout-terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfallout_locked.py
41 lines (32 loc) · 975 Bytes
/
fallout_locked.py
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
37
38
39
40
41
import curses
from fallout_functions import slowWrite
from fallout_functions import centeredWrite
################## text strings ######################
LOCKED_1 = 'TERMINAL LOCKED'
LOCKED_2 = 'PLEASE CONTACT AN ADMINISTRATOR'
################## global 'constants' ################
# amount of time to pause after lockout
LOCKED_OUT_TIME = 5000
################## functions #########################
def runLocked(scr):
"""
Start the locked out portion of the terminal
"""
curses.use_default_colors()
size = scr.getmaxyx()
width = size[1]
height = size[0]
# set screen to initial position
scr.erase()
curses.curs_set(0)
scr.move(height / 2 - 1, 0)
centeredWrite(scr, LOCKED_1)
scr.move(height / 2 + 1, 0)
centeredWrite(scr, LOCKED_2)
scr.refresh()
curses.napms(LOCKED_OUT_TIME)
def beginLocked():
"""
Initialize curses and start the locked out process
"""
curses.wrapper(runLocked)