q : Quit """ #Geomteric settings TOTAL_PAGES = 3 SCREEN_WIDTH = 10 #Default screen width SCREEN_HEIGHT = 10 #Default screen height PAGE1_X = 0 #Starting x cordinate of the stats grid PAGE1_Y = 0 #Starting y cordinate of the stats grid PAGE2_X = 0 #Starting x cordinate of the slabs grid PAGE2_Y = 40 #Starting y cordinate of the slabs grid PAGE3_X = 0 #Starting x cordinate of the dump grid PAGE3_Y = 80 #Starting y cordinate of the dump grid MAX_MYPAD_HEIGHT = 10 #Maximum height of mypad m1 = mem('127.0.0.1', '11211') m2 = mem('127.0.0.1', '11212') m3 = mem('127.0.0.1', '11213') class curses_screen: def __enter__(self): self.stdscr = curses.initscr() curses.cbreak() curses.noecho() self.stdscr.keypad(1) SCREEN_HEIGHT, SCREEN_WIDTH = self.stdscr.getmaxyx() return self.stdscr def __exit__(self,a,b,c): curses.nocbreak() self.stdscr.keypad(0) curses.echo()
from datetime import timedelta """ Pages 1: Stats 2: Slabs 3: Dump 4: Items sizes Keys up or down: Traverse pages. r : refresh q : Quit """ m = mem('127.0.0.1', '11211') #Geomteric settings TOTAL_PAGES = 5 SCREEN_WIDTH = 10 #Default screen width SCREEN_HEIGHT = 10 #Default screen height STATS_X = 0 #Starting x cordinate of the stats grid STATS_Y = 0 #Starting y cordinate of the stats grid SLABS_X = 0 #Starting x cordinate of the slabs grid SLABS_Y = 40 #Starting y cordinate of the slabs grid DUMP_X = 0 #Starting x cordinate of the dump grid DUMP_Y = 80 #Starting y cordinate of the dump grid SIZES_X = 0 #Starting x cordinate of the sizes grid SIZES_Y = 120 #Starting y cordinate of the sizes grid MAX_MYPAD_HEIGHT = 10 #Maximum height of mypad IS_HELP = False