From 700ef1c10206f9aee54ce1942bced4d63df953d8 Mon Sep 17 00:00:00 2001 From: AykoPoel Date: Thu, 1 Jan 2015 14:24:55 +0100 Subject: [PATCH] Update changeautorotatestatus.py --- autorotate/changeautorotatestatus.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autorotate/changeautorotatestatus.py b/autorotate/changeautorotatestatus.py index 1fbe0a5..0a12799 100644 --- a/autorotate/changeautorotatestatus.py +++ b/autorotate/changeautorotatestatus.py @@ -2,6 +2,8 @@ import os from gi.repository import Notify +path = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) + def readFile(path): #self.filename myDatei = open(path, "r") myList = [] @@ -19,14 +21,14 @@ def writeFile(path, myList): #self.filename myDatei.writelines(myList) myDatei.close() -status = readFile('/home/marc/.scripts/status.txt') +status = readFile(os.path.join(path, 'status.txt')) if status[0] == "on": - writeFile('/home/marc/.scripts/status.txt', ["off"]) + writeFile(os.path.join(path, 'status.txt'), ["off"]) Notify.init ("Rotation-ON") RotationOFF=Notify.Notification.new ("Rotation","Screenrotation is now turned OFF","dialog-information") RotationOFF.show () if status[0] == "off": - writeFile('/home/marc/.scripts/status.txt', ["on"]) + writeFile(os.path.join(path, 'status.txt'), ["on"]) Notify.init ("Rotation-OFF") RotationON=Notify.Notification.new ("Rotation","Screenrotation is now turned ON","dialog-information") RotationON.show ()