Ejemplo n.º 1
0
def getDefaults():
    # Get all the profile's settings. I know there has to be a better
    # way to do profiles, but this should work.
    defaultsettings = {
        'defaultmakemkvpath': utils.getSetting('defaultmakemkvpath'),
        'defaulthandbrakeclipath': utils.getSetting('defaulthandbrakeclipath'),
        'defaulttempfolder': utils.getSetting('defaulttempfolder'),
        'defaultdestinationfolder':
        utils.getSetting('defaultdestinationfolder'),
        'defaultniceness': utils.getSettingLow('defaultniceness'),
        'defaultresolution': utils.getSetting('defaultresolution'),
        'defaultquality': utils.getSettingLow('defaultquality'),
        'defaultmintitlelength': utils.getSetting('defaultmintitlelength'),
        'defaultnativelanguage': utils.getSettingLow('defaultnativelanguage'),
        'defaultforeignaudio': utils.getSettingLow('defaultforeignaudio'),
        'defaultencodeafterrip': utils.getSettingLow('defaultencodeafterrip'),
        'defaultejectafter': utils.getSettingLow('defaultejectafter'),
        'defaultnotifyafterrip': utils.getSettingLow('defaultnotifyafterrip'),
        'defaultnotifyafterencode':
        utils.getSettingLow('defaultnotifyafterencode'),
        'defaultcleanuptempdir': utils.getSettingLow('defaultcleanuptempdir'),
        'defaultblackandwhite': utils.getSettingLow('defaultblackandwhite'),
        'defaultdriveid': utils.getSetting('defaultdriveid'),
        'defaultenablecustomripcommand':
        utils.getSetting('defaultenablecustomripcommand'),
        'defaultcustomripcommand': utils.getSetting('defaultcustomripcommand'),
        'defaultenablecustomencodecommand':
        utils.getSetting('defaultenablecustomencodecommand'),
        'defaultcustomencodecommand':
        utils.getSetting('defaultcustomencodecommand'),
        'defaultadditionalhandbrakeargs':
        utils.getSetting('defaultadditionalhandbrakeargs')}
    # Parse the 3 letter language code from selection
    languagesearch = re.search( r"(.*\()(.*)\)",
            defaultsettings['defaultnativelanguage'])
    if languagesearch:
        defaultsettings['defaultnativelanguage'] = languagesearch.group(2)
    return defaultsettings
Ejemplo n.º 2
0
def getProfile(defaultsettings, profilenum):
    if profilenum == '':
        validprofiles = []
        for profile in ['profile1', 'profile2', 'profile3', 'profile4',
                'profile5', 'profile6', 'profile7', 'profile8', 'profile9',
                'profile10']:
            if utils.getSetting(profile + 'enabled') == 'true':
                validprofiles.append(utils.getSetting(profile + 'prettyname'))
        if validprofiles == []:
            utils.exitFailed(utils.getString(30080), utils.getString(30080))
        profilenum = utils.showSelectDialog(
                '{couchripper} - {profilestr}'.format(
                couchripper = utils.getString(30010),
                profilestr = utils.getString(30051)),
                validprofiles)
        profilename = validprofiles[profilenum]
    else:
        profilename = utils.getSetting(profilenum + 'prettyname')
    if profilenum == -1:
        # 30081 == Rip Cancelled
        utils.exitFailed(utils.getString(30081), utils.getString(30081))
    profiledict = []
    for profile in ['profile1', 'profile2', 'profile3', 'profile4', 'profile5',
            'profile6', 'profile7', 'profile8', 'profile9', 'profile10']:
        if utils.getSetting(profile + 'prettyname') == profilename:
            profiledict = {
                    'makemkvpath':
                    utils.getSetting(profile + 'makemkvpath'),
                    'handbrakeclipath':
                    utils.getSetting(profile + 'handbrakeclipath'),
                    'tempfolder':
                    utils.getSetting(profile + 'tempfolder'),
                    'destinationfolder':
                    utils.getSetting(profile + 'destinationfolder'),
                    'niceness':
                    utils.getSettingLow(profile + 'niceness'),
                    'resolution':
                    utils.getSettingLow(profile + 'resolution'),
                    'quality':
                    utils.getSettingLow(profile + 'quality'),
                    'mintitlelength':
                    utils.getSettingLow(profile + 'mintitlelength'),
                    'nativelanguage':
                    utils.getSettingLow(profile + 'nativelanguage'),
                    'foreignaudio':
                    utils.getSettingLow(profile + 'foreignaudio'),
                    'encodeafterrip':
                    utils.getSettingLow(profile + 'encodeafterrip'),
		    'updatelibraryafterencode':
                    utils.getSettingLow(profile + 'updatelibraryafterencode'),
                    'ejectafter':
                    utils.getSettingLow(profile + 'ejectafter'),
                    'notifyafterrip':
                    utils.getSettingLow(profile + 'notifyafterrip'),
                    'notifyafterencode':
                    utils.getSettingLow(profile + 'notifyafterencode'),
                    'cleanuptempdir':
                    utils.getSettingLow(profile + 'cleanuptempdir'),
                    'blackandwhite':
                    utils.getSettingLow(profile + 'blackandwhite'),
                    'driveid':
                    utils.getSetting(profile + 'driveid'),
                    'enablecustomripcommand':
                    utils.getSetting(profile + 'enablecustomripcommand'),
                    'customripcommand':
                    utils.getSetting(profile + 'customripcommand'),
                    'enablecustomencodecommand':
                    utils.getSetting(profile + 'enablecustomencodecommand'),
                    'customencodecommand':
                    utils.getSetting(profile + 'customencodecommand'),
                    'additionalhandbrakeargs':
                    utils.getSetting(profile + 'additionalhandbrakeargs')}
            # Parse the 3 letter language code from selection
            languagesearch = re.search( r"(.*\()(.*)\)",
                    profiledict['nativelanguage'])
            if languagesearch:
                profiledict['nativelanguage'] = languagesearch.group(2)
            for key, value in profiledict.iteritems():
                if (value == 'default' or value == ''):
                    profiledict[key] = defaultsettings['default' + key]
    return profiledict
Ejemplo n.º 3
0
def getDefaults():
    # Get all the profile's settings. I know there has to be a better
    # way to do profiles, but this should work.
    defaultsettings = {
        'defaultmakemkvpath': utils.getSetting('defaultmakemkvpath'),
        'defaulthandbrakeclipath': utils.getSetting('defaulthandbrakeclipath'),
        'defaulttempfolder': utils.getSetting('defaulttempfolder'),
        'defaultdestinationfolder':
        utils.getSetting('defaultdestinationfolder'),
        'defaultniceness': utils.getSettingLow('defaultniceness'),
        'defaultresolution': utils.getSetting('defaultresolution'),
        'defaultquality': utils.getSettingLow('defaultquality'),
        'defaultmintitlelength': utils.getSetting('defaultmintitlelength'),
        'defaultnativelanguage': utils.getSettingLow('defaultnativelanguage'),
        'defaultforeignaudio': utils.getSettingLow('defaultforeignaudio'),
        'defaultencodeafterrip': utils.getSettingLow('defaultencodeafterrip'),
	'defaultupdatelibraryafterencode': utils.getSettingLow('defaultupdatelibraryafterencode'),
        'defaultejectafter': utils.getSettingLow('defaultejectafter'),
        'defaultnotifyafterrip': utils.getSettingLow('defaultnotifyafterrip'),
        'defaultnotifyafterencode':
        utils.getSettingLow('defaultnotifyafterencode'),
        'defaultcleanuptempdir': utils.getSettingLow('defaultcleanuptempdir'),
        'defaultblackandwhite': utils.getSettingLow('defaultblackandwhite'),
        'defaultdriveid': utils.getSetting('defaultdriveid'),
        'defaultenablecustomripcommand':
        utils.getSetting('defaultenablecustomripcommand'),
        'defaultcustomripcommand': utils.getSetting('defaultcustomripcommand'),
        'defaultenablecustomencodecommand':
        utils.getSetting('defaultenablecustomencodecommand'),
        'defaultcustomencodecommand':
        utils.getSetting('defaultcustomencodecommand'),
        'defaultadditionalhandbrakeargs':
        utils.getSetting('defaultadditionalhandbrakeargs')}
    # Parse the 3 letter language code from selection
    languagesearch = re.search( r"(.*\()(.*)\)",
            defaultsettings['defaultnativelanguage'])
    if languagesearch:
        defaultsettings['defaultnativelanguage'] = languagesearch.group(2)
    return defaultsettings
Ejemplo n.º 4
0
def getProfile(defaultsettings, profilenum):
    if profilenum == '':
        validprofiles = []
        for profile in ['profile1', 'profile2', 'profile3', 'profile4',
                'profile5', 'profile6', 'profile7', 'profile8', 'profile9',
                'profile10']:
            if utils.getSetting(profile + 'enabled') == 'true':
                validprofiles.append(utils.getSetting(profile + 'prettyname'))
        if validprofiles == []:
            utils.exitFailed(utils.getString(30080), utils.getString(30080))
        profilenum = utils.showSelectDialog(
                '{couchripper} - {profilestr}'.format(
                couchripper = utils.getString(30010),
                profilestr = utils.getString(30051)),
                validprofiles)
        profilename = validprofiles[profilenum]
    else:
        profilename = utils.getSetting(profilenum + 'prettyname')
    if profilenum == -1:
        # 30081 == Rip Cancelled
        utils.exitFailed(utils.getString(30081), utils.getString(30081))
    profiledict = []
    for profile in ['profile1', 'profile2', 'profile3', 'profile4', 'profile5',
            'profile6', 'profile7', 'profile8', 'profile9', 'profile10']:
        if utils.getSetting(profile + 'prettyname') == profilename:
            profiledict = {
                    'makemkvpath':
                    utils.getSetting(profile + 'makemkvpath'),
                    'handbrakeclipath':
                    utils.getSetting(profile + 'handbrakeclipath'),
                    'tempfolder':
                    utils.getSetting(profile + 'tempfolder'),
                    'destinationfolder':
                    utils.getSetting(profile + 'destinationfolder'),
                    'niceness':
                    utils.getSettingLow(profile + 'niceness'),
                    'resolution':
                    utils.getSettingLow(profile + 'resolution'),
                    'quality':
                    utils.getSettingLow(profile + 'quality'),
                    'mintitlelength':
                    utils.getSettingLow(profile + 'mintitlelength'),
                    'nativelanguage':
                    utils.getSettingLow(profile + 'nativelanguage'),
                    'foreignaudio':
                    utils.getSettingLow(profile + 'foreignaudio'),
                    'encodeafterrip':
                    utils.getSettingLow(profile + 'encodeafterrip'),
                    'ejectafter':
                    utils.getSettingLow(profile + 'ejectafter'),
                    'notifyafterrip':
                    utils.getSettingLow(profile + 'notifyafterrip'),
                    'notifyafterencode':
                    utils.getSettingLow(profile + 'notifyafterencode'),
                    'cleanuptempdir':
                    utils.getSettingLow(profile + 'cleanuptempdir'),
                    'blackandwhite':
                    utils.getSettingLow(profile + 'blackandwhite'),
                    'driveid':
                    utils.getSetting(profile + 'driveid'),
                    'enablecustomripcommand':
                    utils.getSetting(profile + 'enablecustomripcommand'),
                    'customripcommand':
                    utils.getSetting(profile + 'customripcommand'),
                    'enablecustomencodecommand':
                    utils.getSetting(profile + 'enablecustomencodecommand'),
                    'customencodecommand':
                    utils.getSetting(profile + 'customencodecommand'),
                    'additionalhandbrakeargs':
                    utils.getSetting(profile + 'additionalhandbrakeargs')}
            # Parse the 3 letter language code from selection
            languagesearch = re.search( r"(.*\()(.*)\)",
                    profiledict['nativelanguage'])
            if languagesearch:
                profiledict['nativelanguage'] = languagesearch.group(2)
            for key, value in profiledict.iteritems():
                if (value == 'default' or value == ''):
                    profiledict[key] = defaultsettings['default' + key]
    return profiledict