Made the main path properly independent

This commit is contained in:
Maximilian Giller 2019-04-13 19:17:14 +02:00
parent 8552874e7d
commit 188b0497cb
2 changed files with 12 additions and 6 deletions

View file

@ -1,13 +1,19 @@
#!/usr/bin/python3 #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from PIL import Image, ImageFont from PIL import Image, ImageFont
from settings import * from settings import font_boldness
import os
im_open = Image.open im_open = Image.open
path = '' path = os.path.dirname(os.path.relpath(__file__)).replace("\\", "/")
if path != "" and path[-1] != "/":
path += "/"
wpath = path+'weather-icons/' wpath = path+'weather-icons/'
opath = path+'other/' opath = path+'other/'
fpath = path+'fonts/' fpath = 'fonts/'
print(fpath)
print(os.getcwd())
tempicon = im_open(opath+'temperature.jpeg') tempicon = im_open(opath+'temperature.jpeg')
humicon = im_open(opath+'humidity.jpeg') humicon = im_open(opath+'humidity.jpeg')

View file

@ -9,11 +9,11 @@ Copyright by aceisace
""" """
from datetime import datetime from datetime import datetime
from time import sleep from time import sleep
from Assets import datetime_locals from Assets import datetime_locals, path
from LoopTimer import LoopTimer from LoopTimer import LoopTimer
import locale import locale
from DebugConsole import DebugConsole from DebugConsole import DebugConsole
from settings import * from settings import language, render_to_display, render_to_file, display_colours, location, api_key, owm_paid_subscription, choosen_design, ical_urls, highlighted_ical_urls, rss_feeds, update_interval, calibrate_hours
from MonthOvPanel import MonthOvPanel from MonthOvPanel import MonthOvPanel
from DayListPanel import DayListPanel from DayListPanel import DayListPanel
from DayViewPanel import DayViewPanel from DayViewPanel import DayViewPanel
@ -28,7 +28,7 @@ output_adapters = []
if render_to_file: if render_to_file:
import ImageFileAdapter import ImageFileAdapter
epd = ImageFileAdapter.ImageFileAdapter() epd = ImageFileAdapter.ImageFileAdapter(path)
output_adapters.append(epd) output_adapters.append(epd)
if render_to_display: if render_to_display: