diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2023-01-19 18:01:26 +0100 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-01-20 13:05:37 +0900 |
commit | 94f5a3f12e1c61aa2f3cde2d7b260c08489336ac (patch) | |
tree | 9062a30a1d81a1a97e9397548e4ec48ae63c18a4 /modules | |
parent | b9c0b6996a6da72f93baf50121a1be4a6fa48d2e (diff) | |
download | tde-guidance-94f5a3f12e1c61aa2f3cde2d7b260c08489336ac.tar.gz tde-guidance-94f5a3f12e1c61aa2f3cde2d7b260c08489336ac.zip |
Drop python2 support.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'modules')
-rwxr-xr-x | modules/xf86misc.py | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/modules/xf86misc.py b/modules/xf86misc.py index 8b952d8..c21881a 100755 --- a/modules/xf86misc.py +++ b/modules/xf86misc.py @@ -44,8 +44,8 @@ class XF86Screen(object): (rc,x,y) = ixf86misc.XRRQueryExtension(self.display) if rc==0: return - except AttributeError, errmsg: - print "Trapped AttributeError:", errmsg, " - attempting to continue." + except AttributeError as errmsg: + print("Trapped AttributeError:", errmsg, " - attempting to continue.") return self.screenconfig = ixf86misc.XRRGetScreenInfo(self.display, ixf86misc.RootWindow(self.display, self.screenid)) @@ -140,7 +140,7 @@ class XF86Server(object): self.displayname = displayname self.display = ixf86misc.XOpenDisplay(displayname) if self.display is None: - raise XF86Error, "Couldn't connect to X server." + raise XF86Error("Couldn't connect to X server.") self._defaultscreen = ixf86misc.DefaultScreen(self.display) @@ -169,29 +169,29 @@ class XF86Error(Exception): if __name__=='__main__': xg = XF86Server() xs = xg.getDefaultScreen() - print "Number of screens:",str(len(xg.screens)) - print "Idle seconds:",xs.getIdleSeconds() - print - print "Gamma:"+str(xs.getGamma()) - print + print("Number of screens:",str(len(xg.screens))) + print("Idle seconds:",xs.getIdleSeconds()) + print() + print("Gamma:"+str(xs.getGamma())) + print() if xg.resolutionSupportAvailable(): - print "SizeID:"+str(xs.getSizeID()) - print "Size:"+str(xs.getSize()) + print("SizeID:"+str(xs.getSizeID())) + print("Size:"+str(xs.getSize())) sizes = xs.getAvailableSizes() - print "Available Sizes:" + str(sizes) - print - print "Rotation:" + str(xs.getRotation()) - print "Available Rotations:" + str(xs.getAvailableRotations()) - print - print "Refresh rate:" + str(xs.getRefreshRate()) - print "Refresh rates for the current screen:"+str(xs.getAvailableRefreshRates(xs.getSizeID())) + print("Available Sizes:" + str(sizes)) + print() + print("Rotation:" + str(xs.getRotation())) + print("Available Rotations:" + str(xs.getAvailableRotations())) + print() + print("Refresh rate:" + str(xs.getRefreshRate())) + print("Refresh rates for the current screen:"+str(xs.getAvailableRefreshRates(xs.getSizeID()))) for i in range(len(sizes)): - print "All Refresh Rates:"+str(xs.getAvailableRefreshRates(i)) + print("All Refresh Rates:"+str(xs.getAvailableRefreshRates(i))) xs.setScreenConfigAndRate(0,1,75) - print "SizeID:"+str(xs.getSizeID()) - print "Size:"+str(xs.getSize()) + print("SizeID:"+str(xs.getSizeID())) + print("Size:"+str(xs.getSize())) sizes = xs.getAvailableSizes() - print "Available Sizes:" + str(sizes) + print("Available Sizes:" + str(sizes)) else: - print "(no resolution / randr support available)" + print("(no resolution / randr support available)") |