コード例 #1
0
def extract_xml(mkv_file):
    oddconfig.read("../../../settings.ini")
    xml_outpot = subprocess.getoutput(
        oddconfig.get_setting('mkvextract', 'APPLICATIONS') + " chapters " +
        mkv_file)
    #TODO if starts with <something>: return, else raise exception
    return xml_outpot
コード例 #2
0
ファイル: main.py プロジェクト: Oddsor/showmover
    def create_widgets(self):
        self.path_frame = tk.Frame(self)
        oddconfig.read(os.path.dirname(os.path.realpath(__file__)) + "\settings.ini")
        print(oddconfig.read_files)
        inn = oddconfig.get_setting("input")
        self.in_path = create_fileselect(self.path_frame, True, inn)
        self.in_path.pack(side="top")
        out = oddconfig.get_setting("output")
        self.out_path = create_fileselect(self.path_frame, True, out)
        self.out_path.pack(side="top")
        self.path_frame.pack()
        self.display_button = tk.Button(self, text="Find", command=self.list_shows)
        self.display_button.pack()
        self.showlist = tk.Frame(self)
        self.showlist.pack(side="left")

        MOVE = tk.Button(self, text="Move", command=self.movefiles)
        MOVE.pack(side="bottom")
        QUIT = tk.Button(self, text="QUIT", fg="red", command=root.destroy)
        QUIT.pack(side="bottom")
コード例 #3
0
    def create_widgets(self):
        self.path_frame = tk.Frame(self)
        oddconfig.read(
            os.path.dirname(os.path.realpath(__file__)) + "\settings.ini")
        print(oddconfig.read_files)
        inn = oddconfig.get_setting("input")
        self.in_path = create_fileselect(self.path_frame, True, inn)
        self.in_path.pack(side="top")
        out = oddconfig.get_setting("output")
        self.out_path = create_fileselect(self.path_frame, True, out)
        self.out_path.pack(side="top")
        self.path_frame.pack()
        self.display_button = tk.Button(self,
                                        text="Find",
                                        command=self.list_shows)
        self.display_button.pack()
        self.showlist = tk.Frame(self)
        self.showlist.pack(side="left")

        MOVE = tk.Button(self, text="Move", command=self.movefiles)
        MOVE.pack(side="bottom")
        QUIT = tk.Button(self, text="QUIT", fg="red", command=root.destroy)
        QUIT.pack(side="bottom")
コード例 #4
0
def get_apikey(keyname):
    oddconfig.read(
        os.path.dirname(__file__).rsplit('\\', maxsplit=1)[0].rsplit(
            '\\', maxsplit=1)[0] + '\settings.ini')
    return oddconfig.get_setting(keyname, 'API_KEYS')
コード例 #5
0
def replace_chapternames(chapter_xml, chapter_csv):
    oddconfig.read("../../../settings.ini")

    pass
コード例 #6
0
ファイル: chapterdb.py プロジェクト: Filibogd93/MKVTagger
def replace_chapternames(chapter_xml, chapter_csv):
    oddconfig.read("../../../settings.ini")

    pass
コード例 #7
0
ファイル: chapterdb.py プロジェクト: Filibogd93/MKVTagger
def extract_xml(mkv_file):
    oddconfig.read("../../../settings.ini")
    xml_outpot = subprocess.getoutput(oddconfig.get_setting('mkvextract', 'APPLICATIONS') + " chapters " + mkv_file)
    #TODO if starts with <something>: return, else raise exception
    return xml_outpot
コード例 #8
0
ファイル: file_handler.py プロジェクト: Filibogd93/MKVTagger
import tempfile
import shutil
import subprocess

import requests

from OddTools import oddconfig


__author__ = 'Odd'

oddconfig.read("../settings.ini")
mkvprop_path = oddconfig.get_setting('mkvpropedit', 'APPLICATIONS')


def download_file(name, dir, url):
    response = requests.get(url, stream=True)
    with open(dir + '/' + name, 'wb') as out_file:
        shutil.copyfileobj(response.raw, out_file)
    del response
    return dir + '/' + name


def attach_files(attachments, file):
    directory = tempfile.mkdtemp('attachment')
    print(directory)
    for attachment in attachments:
        print(subprocess.getoutput(mkvprop_path + ' "' + file + '"' + ' --add-attachment "' + download_file(attachment, directory, attachments[attachment]) + '"'))


def add_tags(filename, xml):