def main_module(): # Clear Screen, Default color 15 = White Text, Background = |18 Dark Green bbs_io.pyPipe2Ansi("|CS|15|18") # Put Raw Line of Text, No String Parsing bbs_io.pyPutLine("This is just a test!, test.py in the src/scripts folder! :) ") # Reset Text color to 15 = White, Background |16 = Black with 2 carriage returns bbs_io.pyPipe2Ansi("|15|16|CR|CR") # Run Pause Prompt bbs_io.pyStartPause() # Put String with MCI Codes |09 = Light Blue, with |IP Ip address, |DE = Wait 1 second... CR = Carriage Return bbs_io.pyPipe2Ansi("|CR|09This is a Test with MCI Codes: |07{ |15IP ADDRESS |07} |13|IP, |DE|05Wait Over! |CR|03Did you like the test?|CR") #Put String with MCI Codes bbs_io.pyPipe2Ansi("|CR|CR|09This is a simple get HotKey Test, hit any key! |CR"); #Get Hotkey Input into ch, will Contain All Chars, Minus Escape Sequences.. If ch = 27, then ESC Sequence, Arrow Key, etc.. # Testing the pyGetKey Functions bbs_io.pyPipe2Ansi('|15Hotkey Input: |11') # ch = the int key code returned from key press. ch = bbs_io.pyGetKey() # Write out the key that was pressed first. # Convery from a String with Number, to Int Number, Then to Character Value. print chr(int(ch)) # Test Key Input, and Extended Esc Sequences # if input Ch == 27, & Extended is not blank, Then Escape # Other Extended Sequence capture Arrow, Home Insert, F1 keys etc.. # Then it could be arror keys, Home, Insert etc... myStr = "|CR|03Char (Int): |11" + ch bbs_io.pyPipe2Ansi(myStr) # Check input character. if ch == '27': if bbs_io.pyGetKeyExtended() <> "": # Means we got an Arror Key, Home, Insert Etc.. myStr = "|CR|03GetKeyExtended (ESC Sequence): |11" + bbs_io.pyGetKeyExtended() bbs_io.pyPipe2Ansi(myStr) else: # Means we got just the ESC Key bbs_io.pyPipe2Ansi("|CR|03GetKeyExtended (ESC Sequence) Empty (ESC Hit!)") else: # Normal Key/Letter Input bbs_io.pyPipe2Ansi("|CR|03Normal Input") # Reset Text color to 15 = White, Background |16 = Black with 2 carriage returns bbs_io.pyPipe2Ansi("|15|16|CR|CR") # Set Length of Input to Return to 15 chars. bbs_io.pyPipe2Ansi("|15Get Line Input |08(|15Hit ENTER when done.|08) |07: ") len = 15 getstr = bbs_io.pyGetLine(len); bbs_io.pyPipe2Ansi("|03|CR|CRPrinting Line Input: |07") print getstr # Test Fancy Input, input field, |IN Limits the input field (overide), |FB sets forground and bg colors. text = "|CRInput Field Testing.. : " # Set default length of input field to 10 len = 10 # Append input field to text string text = bbs_io.pyInputField(text,len); # Write out input field bbs_io.pyPipe2Ansi(text) # Now getline after inputfield!! :) Fancy. getstr = bbs_io.pyGetLine(len); bbs_io.pyPipe2Ansi("|03|CR|CRPrinting Inputfield Line Input: |07") print getstr bbs_io.pyPipe2Ansi("|15|CR|CRDisplaying an ansi file, hit any key to continue|CR|CR") bbs_io.pyStartPause() # Will printf out ansi.ans in ansi folder leave off extension .ans ansifile = "file" bbs_io.pyAnsiPrintf(ansifile) # Run Pause Prompt bbs_io.pyStartPause() # Clear Screen, Move down two lones, then go back to Home |xy coords . Top left of screen! bbs_io.pyPipe2Ansi("|CS|CR|CR|XY0101|13Testing XY top left coner of screen") # Print Done. bbs_io.pyPipe2Ansi("|CR|05done.") # Run Pause Prompt bbs_io.pyStartPause()
def bootup_sequence(): # Startup Message bbs_io.pyPipe2Ansi("|CS|07|16Starting Bootup Sequence... |DE|DE|CS") ansifile = "osload" bbs_io.pyAnsiPrintf(ansifile) bbs_io.pyPipe2Ansi("|CR|CR |15Enthral OS |07v|151.0 |07Alpha") bbs_io.pyPipe2Ansi("|CR|CR '-[ ]-'") bootup_done = False # Loop Bootup Bar barLen = 20 percent = 0 progress = "" color = 3 # Setup Bootup Percentage Bar (ESC) Will abort. for i in range(barLen): # Listen for ESC Key, if Hit Abort Mem Test while stdin in select([stdin], [], [], 0)[0]: ch = bbs_io.pyGetKey() if ch == '27': escsequence = bbs_io.pyGetKeyExtended() if not escsequence: # we jsut just ESC no arror keys # We got Escape, exit loop. bootup_done = True # Display full pencentage bar # Repeat string to max length after abort output = format("\r\x1b[31G|%02d" % (color)) bbs_io.pyPipe2Ansi(output) color = 11 progress = chr(177) bbs_io.pyPipe2Ansi(repstr(progress,19)) break else: # Test if loop is done. if bootup_done is True: break if i < int(barLen * percent): progress += chr(177) # Format Output with color Pipe Codes. output = format("\r\x1b[31G|%02d" % (color)) bbs_io.pyPipe2Ansi(output) # Slide Fade the update on progress bar. for o in range(len(progress)): bbs_io.pyPipe2Ansi(progress[o]) sleep(0.02) # Delay between drawing redrawing bar sleep(0.15) percent += 1 # Alternate high/low colors. if color == 3: color = 11 else: color = 3 bbs_io.pyPipe2Ansi("|CR|CR |07OS Loaded|08.") bbs_io.pyPipe2Ansi("|DE|DE") bbs_io.pyPipe2Ansi("|CS|07")
def play(): import time from random import randint import os field = [] global charcache charcache = "" field_width = 10 field_height = 20 # Access scheme looks like this: # layout[p][r][ypox][xpos] # layoutcolor = [ 7,2,3,4,4,6,7 ] layout = [ # ## # ## [[[1, 1], [1, 1]]], # # # # # # # # [ [[0, 1, 0, 0], [0, 1, 0, 0], [0, 1, 0, 0], [0, 1, 0, 0]], [[0, 0, 0, 0], [1, 1, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], ], # ### # # [ [[0, 0, 0], [1, 1, 1], [0, 1, 0]], [[0, 1, 0], [0, 1, 1], [0, 1, 0]], [[0, 1, 0], [1, 1, 1], [0, 0, 0]], [[0, 1, 0], [1, 1, 0], [0, 1, 0]], ], # # # # # ## [ [[0, 1, 0], [0, 1, 0], [0, 1, 1]], [[0, 0, 1], [1, 1, 1], [0, 0, 0]], [[1, 1, 0], [0, 1, 0], [0, 1, 0]], [[0, 0, 0], [1, 1, 1], [1, 0, 0]], ], # # # # # ## [ [[0, 1, 0], [0, 1, 0], [1, 1, 0]], [[0, 0, 0], [1, 1, 1], [0, 0, 1]], [[0, 1, 1], [0, 1, 0], [0, 1, 0]], [[1, 0, 0], [1, 1, 1], [0, 0, 0]], ], # ## # ## [[[0, 1, 0], [1, 1, 0], [1, 0, 0]], [[0, 0, 0], [1, 1, 0], [0, 1, 1]]], # ## # ## [[[0, 1, 0], [0, 1, 1], [0, 0, 1]], [[0, 0, 0], [0, 1, 1], [1, 1, 0]]], ] fieldx1 = 32 fieldy1 = 10 scorex1 = 11 scorey1 = 11 class RectRedraw: x1 = None y1 = None x2 = None y2 = None def max(r, val, valmax): if val > valmax: return valmax return val def min(r, val, valmin): if val < valmin: return valmin return val def merge(r, x1, y1, x2, y2): if r.x1 is None or r.x1 > x1: r.x1 = r.min(x1, 0) if r.y1 is None or r.y1 > y1: r.y1 = r.min(y1, 0) if r.x2 is None or r.x2 < x2: r.x2 = r.max(x2, field_width) if r.y2 is None or r.y2 < y2: r.y2 = r.max(y2, field_height) # print r.x1,r.y1,r.x2,r.y2 def clean(r): r.x1 = None r.y1 = None r.x2 = None r.y2 = None rr = RectRedraw() for _ in range(field_height): field.append([0] * field_width) def echo(s): global charcache charcache += s # Turn off the Cursor bbs_io.pyPipe2Ansi("\x1b[?25l") # Display Welcome Message bbs_io.pyPipe2Ansi("|CS|CR|CR|09REAdY YOUR tERMiNAl! |CR|CR|03PRESS ANY kEY") # get key from user, wait for input. bbs_io.pyGetKey() # Clear the Screen First bbs_io.pyPipe2Ansi("|CS") # Display ANSI screen .ans extension is assumed. bbs_io.pyAnsiPrintf("tetris") def gotoxy(x, y): echo("|XY%02d%02d" % (x + 1, y + 1)) def plotblock(color, lastcolor): if color: # c = u'\u2588\u2588' # '\xDB\xDB' c = chr(219) + chr(219) else: # both empty c = " " color = 0 # Output optimization if color % 8 == 0: color = color / 8 if color == lastcolor: echo(c) else: if color: fg = str(30 + color % 8) else: fg = "37" if color >= 8: bg = ";%d" % (40 + color / 8) else: bg = "" echo("\x1b[0;" + fg + bg + "m") echo(c) lastcolor = color return lastcolor def drawfield(): lastcolor = "" for y in range(0, field_height, 2): gotoxy(fieldx1 + 2, fieldy1 + 1 + y / 2) # Which block to show, full, half-up, half-down or empty. for x in range(field_width): color = field[y][x] + field[y + 1][x] * 8 if field[y][x] and field[y + 1][x]: # c = u'\u2588' # '\xDB' c = chr(219) if field[y][x] == field[y + 1][x]: color = color % 8 else: # c = u'\u2580' # '\xDF' c = chr(223) elif field[y][x] and not field[y + 1][x]: # c = u'\u2580' # '\xDF' c = chr(223) elif not field[y][x] and field[y + 1][x]: # c = u'\u2584' # '\xDC' c = chr(220) else: # both empty c = " " # Output optimization if color % 8 == 0: color = color / 8 if color == lastcolor: echo(c) else: if color: fg = str(30 + color % 8) else: fg = "37" if color >= 8: bg = ";%d" % (40 + color / 8) else: bg = "" echo("\x1b[0;" + fg + bg + "m") echo(c) lastcolor = color # echo(term.normal) echo("|07|16") # reset background color layoutcolor = [7, 2, 7, 6, 3, 6, 3] # p = -1 # Current piece type nextpiece = randint(0, len(layout) - 1) p = randint(0, len(layout) - 1) p = 1 r = 0 # Current rotation xpos = 4 # X position # ypos = -2 # Y position ypos = -len(layout[p][0]) level = 1 score = 0 lines = 0 def flush(): global charcache bbs_io.pyPipe2Ansi(charcache) charcache = "" def fillpiece(x, y, p, r, value): row = 0 for line in layout[p][r]: col = 0 for c in line: if c and (y + row) >= 0: field[y + row][x + col] = value col += 1 row += 1 def showpiece(x, y, p, r): fillpiece(x, y, p, r, layoutcolor[p]) def hidepiece(): fillpiece(xpos, ypos, p, r, 0) def testpiece(x, y, newr): hidepiece() # Space at the new location? row = 0 for line in layout[p][newr]: col = 0 for c in line: try: if c: if (y + row) >= 0 and field[y + row][x + col] or (x + col) < 0 or (x + col) > 9: return 0 except IndexError: return 0 col += 1 row += 1 # Movement possible return 1 def movepiece(x, y, newr): if testpiece(x, y, newr): # Build redraw rectangle rr.merge(xpos, ypos, xpos + len(layout[p][0][0]), ypos + len(layout[p][0])) rr.merge(x, y, x + len(layout[p][0][0]), y + len(layout[p][0])) showpiece(x, y, p, newr) return (x, y, newr, 1) else: showpiece(xpos, ypos, p, r) return (xpos, ypos, r, 0) def shownext(p): r = 0 for y in range(4): gotoxy(26, 18 + y) echo(" " * 4) bbs_io.pyPipe2Ansi("|%02d" % (layoutcolor[p])) yoffset = int(len(layout[p][r][0]) < 4) xoffset = int(len(layout[p][r]) < 3) for y in range(len(layout[p][r])): for x in range(len(layout[p][r][y])): val = layout[p][r][y][x] if val: gotoxy(26 + x + xoffset, 18 + y + yoffset) # echo(u'\u2588\u2588') echo(chr(219) + chr(219)) def drawstats(): bbs_io.pyPipe2Ansi("|XY%02d%02d%d" % (scorex1, scorey1 + 1, level)) bbs_io.pyPipe2Ansi("|XY%02d%02d%d" % (scorex1, scorey1 + 3, lines)) bbs_io.pyPipe2Ansi("|XY%02d%02d%d" % (scorex1, scorey1 + 4, score)) drawstats() ticksize = 0.4 nexttick = time.time() + ticksize showpiece(xpos, ypos, p, r) gotoxy(26, 17) # echo(term.blue_reverse('next')) echo("|09|17n|00|17ext|07|16") shownext(nextpiece) # Full redraw first frame rr.merge(0, 0, field_width, field_height) buf = "" key = "" while True: drawfield() slice = nexttick - time.time() if slice < 0: slice = 0 echo(buf) buf = "" flush() # Get User Key presses for block movement {Non-Blocking) if stdin in select([stdin], [], [], slice + 0.01)[0]: key = bbs_io.pyGetKey() if key != "": # if we got an escape sequence, then reassign the key if key == "27": # Get Extended ESC Sequence key = bbs_io.pyGetKeyExtended() else: # Translate int to char value. key = chr(int(key)) else: key = "" now = time.time() # hidepiece() if key is not None: if key in ("q", "Q"): return (0, 0, 0) elif key in ("[D", "h"): xpos, ypos, r, m = movepiece(xpos - 1, ypos, r) elif key in ("[C", "l"): xpos, ypos, r, m = movepiece(xpos + 1, ypos, r) elif key in ("[A", "k"): xpos, ypos, r, m = movepiece(xpos, ypos, (r + 1) % len(layout[p])) elif key in ("[B", "j"): xpos, ypos, r, m = movepiece(xpos, ypos + 1, r) elif key in (" ",): m = True c = 0 while m: xpos, ypos, r, m = movepiece(xpos, ypos + 1, r) if m: c += 1 if c: nexttick = time.time() + ticksize # New tick? if now > nexttick: nexttick += ticksize # Move down piece xpos, ypos, r, moved = movepiece(xpos, ypos + 1, r) # Piece has touched down? if not moved: # Is the player dead? if ypos <= -len(layout[p][0]): # End of Game Message bbs_io.pyPipe2Ansi("|XY3324|12!! |04gAME OVeR |12!!|07") bbs_io.pyGetKey() # death_win = AnsiWindow(height=6, width=40, # yloc=fieldy1 + 10 / 2, xloc=fieldx1 - 11) # death_win.colors['border'] = term.bold_black # echo_unbuffered(death_win.clear() + death_win.border()) # echo_unbuffered( # term.move(fieldy1 + 10 / 2 + 1, fieldx1 - 11)) # echo_unbuffered(( # u'!! gAME OVeR!! Score was: %i' % (score,)).center(40)) # echo_unbuffered( # term.move(fieldy1 + 10 / 2 + 3, fieldx1 - 11)) # echo_unbuffered(u'press RETURN'.center(40)) # while True: # inp = getch() # if inp in (u'\r', term.KEY_ENTER): # break return (score, level, lines) # Any complete rows to remove? complete = [] for y in range(field_height): x = 0 while x < field_width: if field[y][x] == 0: break x += 1 if x == field_width: complete.append(y) if len(complete) > 0: # Add score lines += len(complete) score += len(complete) * len(complete) * 100 # Shrink field for line in complete: del field[line] field.insert(0, [0] * field_width) if lines >= level * 10: level += 1 ticksize = 0.4 - level * 0.02 drawstats() # Redraw complete field rr.merge(0, 0, field_width, field_height) # Time for a new piece p = nextpiece nextpiece = randint(0, len(layout) - 1) r = 0 xpos = 4 ypos = -len(layout[p][0]) showpiece(xpos, ypos, p, r) shownext(nextpiece)
def main_module(): # Clear Screen, Default color 15 = White Text, Background = |18 Dark Green bbs_io.pyPipe2Ansi("|CS|15|18") # Put Raw Line of Text, No String Parsing bbs_io.pyPutLine( "This is just a test!, test.py in the src/scripts folder! :) ") # Reset Text color to 15 = White, Background |16 = Black with 2 carriage returns bbs_io.pyPipe2Ansi("|15|16|CR|CR") # Run Pause Prompt bbs_io.pyStartPause() # Put String with MCI Codes |09 = Light Blue, with |IP Ip address, |DE = Wait 1 second... CR = Carriage Return bbs_io.pyPipe2Ansi( "|CR|09This is a Test with MCI Codes: |07{ |15IP ADDRESS |07} |13|IP, |DE|05Wait Over! |CR|03Did you like the test?|CR" ) #Put String with MCI Codes bbs_io.pyPipe2Ansi( "|CR|CR|09This is a simple get HotKey Test, hit any key! |CR") #Get Hotkey Input into ch, will Contain All Chars, Minus Escape Sequences.. If ch = 27, then ESC Sequence, Arrow Key, etc.. # Testing the pyGetKey Functions bbs_io.pyPipe2Ansi('|15Hotkey Input: |11') # ch = the int key code returned from key press. ch = bbs_io.pyGetKey() # Write out the key that was pressed first. # Convery from a String with Number, to Int Number, Then to Character Value. print chr(int(ch)) # Test Key Input, and Extended Esc Sequences # if input Ch == 27, & Extended is not blank, Then Escape # Other Extended Sequence capture Arrow, Home Insert, F1 keys etc.. # Then it could be arror keys, Home, Insert etc... myStr = "|CR|03Char (Int): |11" + ch bbs_io.pyPipe2Ansi(myStr) # Check input character. if ch == '27': if bbs_io.pyGetKeyExtended() <> "": # Means we got an Arror Key, Home, Insert Etc.. myStr = "|CR|03GetKeyExtended (ESC Sequence): |11" + bbs_io.pyGetKeyExtended( ) bbs_io.pyPipe2Ansi(myStr) else: # Means we got just the ESC Key bbs_io.pyPipe2Ansi( "|CR|03GetKeyExtended (ESC Sequence) Empty (ESC Hit!)") else: # Normal Key/Letter Input bbs_io.pyPipe2Ansi("|CR|03Normal Input") # Reset Text color to 15 = White, Background |16 = Black with 2 carriage returns bbs_io.pyPipe2Ansi("|15|16|CR|CR") # Set Length of Input to Return to 15 chars. bbs_io.pyPipe2Ansi( "|15Get Line Input |08(|15Hit ENTER when done.|08) |07: ") len = 15 getstr = bbs_io.pyGetLine(len) bbs_io.pyPipe2Ansi("|03|CR|CRPrinting Line Input: |07") print getstr # Test Fancy Input, input field, |IN Limits the input field (overide), |FB sets forground and bg colors. text = "|CRInput Field Testing.. : " # Set default length of input field to 10 len = 10 # Append input field to text string text = bbs_io.pyInputField(text, len) # Write out input field bbs_io.pyPipe2Ansi(text) # Now getline after inputfield!! :) Fancy. getstr = bbs_io.pyGetLine(len) bbs_io.pyPipe2Ansi("|03|CR|CRPrinting Inputfield Line Input: |07") print getstr bbs_io.pyPipe2Ansi( "|15|CR|CRDisplaying an ansi file, hit any key to continue|CR|CR") bbs_io.pyStartPause() # Will printf out ansi.ans in ansi folder leave off extension .ans ansifile = "file" bbs_io.pyAnsiPrintf(ansifile) # Run Pause Prompt bbs_io.pyStartPause() # Clear Screen, Move down two lones, then go back to Home |xy coords . Top left of screen! bbs_io.pyPipe2Ansi( "|CS|CR|CR|XY0101|13Testing XY top left coner of screen") # Print Done. bbs_io.pyPipe2Ansi("|CR|05done.") # Run Pause Prompt bbs_io.pyStartPause()
def main_module(): # Clear Screen, Default color 07 = Grey Text, Background = |16 Black bbs_io.pyPipe2Ansi("|CS|07|16Wake on Lan Detected... |DE|DE|CS") # Write out BIOS Info Line bbs_io.pyPipe2Ansi("|15Enthral |07Python BIOS v1.0, An |15BBS-Scene |07Alley (|15irc.bbs-scene.org #|07enthral, |15#|07bbs|07)|CR") bbs_io.pyPipe2Ansi("Copyright (c) 2004-2014, Michael Griffin (|15irc.bbses.info |15#|07bbs|07)|CR|CR") #Detect and write out Basic CPU Info command = "cat /proc/cpuinfo" all_info = check_output(command, shell=True).strip() for line in all_info.split("\n"): if "model name" in line: bbs_io.pyPipe2Ansi(sub(".*model name.*:", "", line,1).strip()+"|CR") break # Clear Data del all_info #Detect Memory size in KB command = "cat /proc/meminfo" all_info = check_output(command, shell=True).strip() for line in all_info.split("\n"): if "MemTotal" in line: mem_string = sub(".*MemTotal.*:", "", line,1).strip() mem_size = sub(r"kB", "", mem_string,1).strip() break # Clear Data del all_info # Convert String to Number for Loop. iMem_size = int(mem_size) # Memory test. bbs_io.pyPipe2Ansi("Memory Test : \x1b[30G|15ESC |07to Abort Memory Test|07") # Break from look when done. memtest_done = False try: # Loop Memory Test Counter for i in range(iMem_size): # Listen for ESC Key, if Hit Abort Mem Test while stdin in select([stdin], [], [], 0)[0]: ch = bbs_io.pyGetKey(); if ch == '27': escsequence = bbs_io.pyGetKeyExtended() if not escsequence:# we jsut just ESC no arror keys # We got Escape, exit loop. memtest_done = True break else: # Test if loop is done. if memtest_done is True: break # Write out counter if 0 == i % 1024: stdout.write("\r\x1b[15G%dK" %i) stdout.flush() except: sys.exit(1) # Write out final counter stdout.write("\r\x1b[15G%dK OK" % iMem_size) stdout.flush() # Write Generic Information, can't detect this. bbs_io.pyPipe2Ansi("|CR|07Memory Information: |15DDR 400 mhz CL 2, T2 Dual Channel, 128 bit|CR") # Write Generic Init Output With a Delay at the End. bbs_io.pyPipe2Ansi("|CR|07Enthral Plug and Play Extensions v1.0A") bbs_io.pyPipe2Ansi("|CRInitialize Python Extensions...") bbs_io.pyPipe2Ansi("|CRPython Init Completed|DE|DE") # Detect Hard Drives (dmesg) - Wmvare #[ 1.869546] scsi 1:0:0:0: CD-ROM NECVMWar VMware IDE CDR10 1.00 PQ: 0 ANSI: 5 #[ 2.652638] scsi 2:0:0:0: Direct-Access VMware, VMware Virtual S 1.0 PQ: 0 ANSI: 2 bbs_io.pyPipe2Ansi("|CR|CRDetecting Hard Disks...|CR|DE") # Detect Hard Disks and PNP devices from dmesg # Currently setup for Arch Linux command = "dmesg" all_info = check_output(command, shell=True).strip() for line in all_info.split("\n"): # Get Fist Scsi Drive if "scsi 0:0:0:0:" in line: bbs_io.pyPipe2Ansi("|15SCSI Primary : |07"); tmp = sub(".*scsi 0:0:0:0:*:", "", line,1).strip() value = tmp.split("PQ:") bbs_io.pyPipe2Ansi(value[0] + "|CR") # Get Second Scsi Drive elif "scsi 0:0:1:0:" in line: bbs_io.pyPipe2Ansi("|15SCSI Secondary: |07"); tmp = sub(".*scsi 0:0:1:0:*:", "", line,1).strip() value = tmp.split("PQ:") bbs_io.pyPipe2Ansi(value[0] + "|CR") elif "scsi 2:0:0:0:" in line: bbs_io.pyPipe2Ansi("|15SCSI Primary : |07"); tmp = sub(".*scsi 2:0:0:0:*:", "", line,1).strip() value = tmp.split("PQ:") bbs_io.pyPipe2Ansi(value[0] + "|CR") # Get Second Scsi Drive elif "scsi 3:0:0:0:" in line: bbs_io.pyPipe2Ansi("|15SCSI Secondary: |07"); tmp = sub(".*scsi 3:0:0:0:*:", "", line,1).strip() value = tmp.split("PQ:") bbs_io.pyPipe2Ansi(value[0] + "|CR") # Get Second Scsi Drive elif "scsi 4:0:0:0:" in line: bbs_io.pyPipe2Ansi("|15SCSI Primary : |07"); tmp = sub(".*scsi 4:0:0:0:*:", "", line,1).strip() value = tmp.split("PQ:") bbs_io.pyPipe2Ansi(value[0] + "|CR") # Get Second Scsi Drive elif "scsi 4:0:1:0:" in line: bbs_io.pyPipe2Ansi("|15SCSI Secondary: |07"); tmp = sub(".*scsi 4:0:1:0:*:", "", line,1).strip() value = tmp.split("PQ:") bbs_io.pyPipe2Ansi(value[0] + "|CR") # Get Second Scsi Drive elif "scsi 5:0:0:0:" in line: bbs_io.pyPipe2Ansi("|15SCSI Secondary: |07"); tmp = sub(".*scsi 5:0:0:0:*:", "", line,1).strip() value = tmp.split("PQ:") bbs_io.pyPipe2Ansi(value[0] + "|CR") # Get Plug and Play (Mouse) elif "i8042: PNP:" in line: pnp = sub(".*i8042: PNP:*:", "", line,1).strip() # Get Input Keyboard elif "serio: i8042 KBD" in line: value = line.split("serio: i8042") pnp2 = value[1].strip() # Get Input Mouse elif "serio: i8042 AUX" in line: value = line.split("serio: i8042") pnp3 = value[1].strip() # Clear Data del all_info bbs_io.pyPipe2Ansi("|CRDetecting PNP Devices...|CR|DE") bbs_io.pyPipe2Ansi("|15Detected : |07" + pnp); bbs_io.pyPipe2Ansi("|CR|15Detected : |07" + pnp2); bbs_io.pyPipe2Ansi("|CR|15Detected : |07" + pnp3); bbs_io.pyPipe2Ansi("|CR"); loopcount = 4 bbs_io.pyPipe2Ansi("|CR|15ESC |07to Continue Bootup Sequence or |15Wait ") # Listen for ESC Key, to Exit Script and Continue into BBS. #while True: # ch = bbs_io.pyGetKey() # if ch == "27": # break # Listen for ESC Key, if Hit Abort Mem Test # 4 Seconds until we start boot up sequence if ESC is not hit. waittest_done = False for i in range(10,-1,-1): while stdin in select([stdin], [], [], 0)[0]: ch = bbs_io.pyGetKey(); if ch == '27': escsequence = bbs_io.pyGetKeyExtended() if not escsequence: # we just just ESC no arrow keys # We got Escape, exit loop. waittest_done = True break else: # Format Output with color Pipe Codes. output = format("\r\x1b[41G|07%01d seconds." % i) bbs_io.pyPipe2Ansi(output) sleep(1) if waittest_done is True: break