forcing everything python3, might end up with bugs

This commit is contained in:
Ville Rantanen
2021-04-09 13:01:04 +03:00
parent 72310083f6
commit 525c93a106
23 changed files with 276 additions and 243 deletions

View File

@@ -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
@@ -115,7 +115,7 @@ def read_displays():
pass
return entries
def append_index(entries,offset=0,color=None):
e=1+offset
for el in range(len(entries)):
@@ -138,7 +138,7 @@ def initialize():
entries=read_displays()
entries=append_index(entries,offset=0,color=bc.CYA)
return entries
def main():
arg_input=None
if (len(sys.argv)>1):