def __init__(self):
# ????????? ???? ?? ???????????
if isfile('/usr/local/bin/terminal-notifier'):
self.notifier = True
else:
self.notifier = False
# ????? ?????? ?? parser.py
self.session = Session()
# ?????????? ??????
self.root_dir = dirname(abspath(__file__))
# ????????? ? ??????
# ??????? ??? ?????? ? ????? ?? ????????
chdir(self.root_dir)
# ????? ????????
self.plugins_dir = join(self.root_dir, 'plugins')
# ????? ????????
self.configs_dir = join(self.root_dir, 'configs')
# ????? ??????
self.icons_dir = join(self.root_dir, 'icons')
# ?????, ???? ????? ???????????? ??????????? ???????
self.series_dir = join(environ['HOME'], 'Movies', '???????')
# ????????? ??????? ? ????? ??????
self.name = self.__class__.__name__
# ????????? ? ????? ????????
chdir(self.configs_dir)
# ????????? ??? ??????? ???????? ???????
self.config_path = join(self.configs_dir, '%s.plist' % self.name)
# ???? ??? - ?????? ?????? ? ????? ???????????, ??????? ???? ????????????
if not isfile(self.config_path):
dump({'old_links': [''], 'subscriptions': [''], 'quality': '720p', 'excluding': ['']},
open(self.config_path, 'wb'))
exit(0)
self.settings = AttrDict(load(open(self.config_path, 'rb')))
# ???? ????? ???????? ?? ?????????? ???? ??? ???, ??????? ??
if not isdir(self.series_dir):
mkdir(self.series_dir)
chdir(self.series_dir)
评论列表
文章目录