forcing everything python3, might end up with bugs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
@@ -36,16 +36,16 @@ class bc:
|
||||
self.CLR = ''
|
||||
self.CYA = ''
|
||||
self.WHI = ''
|
||||
|
||||
|
||||
def pos(self,y,x):
|
||||
return "\033["+str(y)+";"+str(x)+"H"
|
||||
|
||||
class getch:
|
||||
def __init__(self):
|
||||
import sys, tty, termios
|
||||
|
||||
|
||||
def get(self):
|
||||
|
||||
|
||||
fd = sys.stdin.fileno()
|
||||
old_settings = termios.tcgetattr(fd)
|
||||
try:
|
||||
@@ -57,7 +57,7 @@ class getch:
|
||||
|
||||
|
||||
def ichr(i):
|
||||
''' convert integer to 1-9, a-z, A-Z, omitting x '''
|
||||
''' convert integer to 1-9, a-z, A-Z, omitting x '''
|
||||
|
||||
if i < 10:
|
||||
return str(i)
|
||||
@@ -75,7 +75,7 @@ def drawmenu(entries):
|
||||
twocol=False
|
||||
co=bc()
|
||||
helptext=""
|
||||
|
||||
|
||||
print(co.END+co.CLR+co.pos(1,3)+co.YEL+'XRandrMenu x:exit '+helptext+co.END)
|
||||
if len(entries)>20:
|
||||
twocol=True
|
||||
@@ -127,7 +127,7 @@ def read_displays():
|
||||
entries.sort(key=lambda x: x[0])
|
||||
return entries
|
||||
|
||||
|
||||
|
||||
def append_index(entries,offset=0,color=None):
|
||||
e=1+offset
|
||||
for el in range(len(entries)):
|
||||
@@ -153,7 +153,7 @@ def initialize():
|
||||
entries=read_displays()
|
||||
entries=append_index(entries,offset=0,color=bc.CYA)
|
||||
return entries
|
||||
|
||||
|
||||
def main():
|
||||
entries=initialize()
|
||||
print(entries)
|
||||
|
||||
Reference in New Issue
Block a user