core.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:NB-series-downloader 作者: fantomnotabene 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号