Display MoreLululla has to delete it on his git right?
No, he must change the code of ui.py file to something like this :
# Get favorites
global fav1, fav2
fav1 = config.plugins.foreca.fav1.value
fav1 = fav1[fav1.rfind("/") + 1:len(fav1)]
FAlog("fav1 location:", fav1)
fav2 = config.plugins.foreca.fav2.value
fav2 = fav2[fav2.rfind("/") + 1:len(fav2)]
FAlog("fav2 location:", fav2)
# Get home location
global city, start
self.ort = config.plugins.foreca.home.value
start = self.ort[self.ort.rfind("/") + 1:len(self.ort)]
in this last version are here the code
Code
global MAIN_PAGE, menu
self.session = session
# actual, local Time as Tuple
lt = localtime()
# Extract the Tuple, Date
jahr, monat, tag = lt[0:3]
heute = "%04i%02i%02i" % (jahr, monat, tag)
if DEBUG:
FAlog("determined local date:", str(heute))
self.tag = 0
# Get favorites
global fav1, fav2, city, start
if exists(USR_PATH + "/fav1.cfg"):
with open(USR_PATH + "/fav1.cfg", "r") as file:
fav1 = file.readline().strip()
fav1 = fav1[fav1.rfind("/") + 1:]
else:
fav1 = "New_York_City"
print(pluginPrintname, "fav1 location:", fav1)
if exists(USR_PATH + "/fav2.cfg"):
with open(USR_PATH + "/fav2.cfg", "r") as file:
fav2 = file.readline().strip()
fav2 = fav2[fav2.rfind("/") + 1:]
else:
fav2 = "Moskva"
print(pluginPrintname, "fav2 location:", fav2)
# Get home location
if exists(USR_PATH + "/startservice.cfg"):
with open(USR_PATH + "/startservice.cfg", "r") as file:
self.ort = file.readline().strip()
start = self.ort[self.ort.rfind("/") + 1:len(self.ort)]
else:
self.ort = "United_Kingdom/London"
start = "London"
Display More
tell me how you want me to change it if you have tested, do you want me to put the config?
i thing type this:
Code
# Get favorites
global fav1, fav2, city, start
if exists(USR_PATH + "/fav1.cfg"):
with open(USR_PATH + "/fav1.cfg", "r") as file:
fav1 = file.readline().strip()
# fav1 = fav1[fav1.rfind("/") + 1:]
else:
# fav1 = "New_York_City"
fav1 = config.plugins.foreca.fav1.value
fav1 = fav1[fav1.rfind("/") + 1:]
print(pluginPrintname, "fav1 location:", fav1)
if exists(USR_PATH + "/fav2.cfg"):
with open(USR_PATH + "/fav2.cfg", "r") as file:
fav2 = file.readline().strip()
else:
# fav2 = "Moskva"
fav2 = config.plugins.foreca.fav2.value
fav2 = fav2[fav2.rfind("/") + 1:]
print(pluginPrintname, "fav2 location:", fav2)
# Get home location
if exists(USR_PATH + "/startservice.cfg"):
with open(USR_PATH + "/startservice.cfg", "r") as file:
self.ort = file.readline().strip()
# start = self.ort[self.ort.rfind("/") + 1:len(self.ort)]
else:
# self.ort = "United_Kingdom/London"
# start = "London"
self.ort = config.plugins.foreca.home.value
start = self.ort[self.ort.rfind("/") + 1:len(self.ort)]
print(pluginPrintname, "Start Home location:", start)
def Fav0(self):
global start
if exists(USR_PATH + "/startservice.cfg"):
with open(USR_PATH + "/startservice.cfg", "r") as file:
self.ort = file.readline().strip()
else:
self.ort = config.plugins.foreca.home.value
print("home location:", self.ort)
start = self.ort[self.ort.rfind("/") + 1:len(self.ort)]
self.Zukunft(0)
def Fav1(self):
global fav1
if exists(USR_PATH + "/fav1.cfg"):
with open(USR_PATH + "/fav1.cfg", "r") as file:
self.ort = file.readline().strip()
else:
self.ort = config.plugins.foreca.fav1.value
print(pluginPrintname, "fav1 location:", fav1)
fav1 = fav1[fav1.rfind("/") + 1:]
self.Zukunft(0)
def Fav2(self):
global fav2
if exists(USR_PATH + "/fav2.cfg"):
with open(USR_PATH + "/fav2.cfg", "r") as file:
self.ort = file.readline().strip()
else:
self.ort = config.plugins.foreca.fav2.value
fav2 = self.ort[self.ort.rfind("/") + 1:len(self.ort)]
print(pluginPrintname, "fav2 location:", fav2)
self.Zukunft(0)
Display More
