Ejemplo n.º 1
0
    def checkDataDir(self):
        if isSubFolder(Env.get('data_dir'), Env.get('app_dir')):
            log.error(
                'You should NOT use your CouchPotato directory to save your settings in. Files will get overwritten or be deleted.'
            )

        return True
Ejemplo n.º 2
0
    def doSubfolderTest(self):

        tests = {
            ('/test/subfolder', '/test/sub'): False,
            ('/test/sub/folder', '/test/sub'): True,
            ('/test/sub/folder', '/test/sub2'): False,
            ('/sub/fold', '/test/sub/fold'): False,
            ('/sub/fold', '/test/sub/folder'): False,
            ('/opt/couchpotato', '/var/opt/couchpotato'): False,
            ('/var/opt', '/var/opt/couchpotato'): False,
            ('/CapItaLs/Are/OK', '/CapItaLs/Are/OK'): True,
            ('/CapItaLs/Are/OK', '/CapItaLs/Are/OK2'): False,
            ('/capitals/are/not/OK', '/capitals/are/NOT'): False,
            ('\\\\Mounted\\Volume\\Test', '\\\\Mounted\\Volume'): True,
            ('C:\\\\test\\path', 'C:\\\\test2'): False
        }

        failed = 0
        for x in tests:
            if isSubFolder(x[0], x[1]) is not tests[x]:
                log.error('Failed subfolder test %s %s', x)
                failed += 1

        if failed > 0:
            log.error('Subfolder test failed %s tests', failed)
        else:
            log.info('Subfolder test succeeded')

        return failed == 0
Ejemplo n.º 3
0
    def doSubfolderTest(self):

        tests = {
            ("/test/subfolder", "/test/sub"): False,
            ("/test/sub/folder", "/test/sub"): True,
            ("/test/sub/folder", "/test/sub2"): False,
            ("/sub/fold", "/test/sub/fold"): False,
            ("/sub/fold", "/test/sub/folder"): False,
            ("/opt/couchpotato", "/var/opt/couchpotato"): False,
            ("/var/opt", "/var/opt/couchpotato"): False,
            ("/CapItaLs/Are/OK", "/CapItaLs/Are/OK"): True,
            ("/CapItaLs/Are/OK", "/CapItaLs/Are/OK2"): False,
            ("/capitals/are/not/OK", "/capitals/are/NOT"): False,
            ("\\\\Mounted\\Volume\\Test", "\\\\Mounted\\Volume"): True,
            ("C:\\\\test\\path", "C:\\\\test2"): False,
        }

        failed = 0
        for x in tests:
            if isSubFolder(x[0], x[1]) is not tests[x]:
                log.error("Failed subfolder test %s %s", x)
                failed += 1

        if failed > 0:
            log.error("Subfolder test failed %s tests", failed)
        else:
            log.info("Subfolder test succeeded")

        return failed == 0
Ejemplo n.º 4
0
    def checkDataDir(self):
        if isSubFolder(Env.get("data_dir"), Env.get("app_dir")):
            log.error(
                "You should NOT use your CouchPotato directory to save your settings in. Files will get overwritten or be deleted."
            )

        return True
Ejemplo n.º 5
0
    def doSubfolderTest(self):

        tests = {
            ('/test/subfolder', '/test/sub'): False,
            ('/test/sub/folder', '/test/sub'): True,
            ('/test/sub/folder', '/test/sub2'): False,
            ('/sub/fold', '/test/sub/fold'): False,
            ('/sub/fold', '/test/sub/folder'): False,
            ('/opt/couchpotato', '/var/opt/couchpotato'): False,
            ('/var/opt', '/var/opt/couchpotato'): False,
            ('/CapItaLs/Are/OK', '/CapItaLs/Are/OK'): True,
            ('/CapItaLs/Are/OK', '/CapItaLs/Are/OK2'): False,
            ('/capitals/are/not/OK', '/capitals/are/NOT'): False,
            ('\\\\Mounted\\Volume\\Test', '\\\\Mounted\\Volume'): True,
            ('C:\\\\test\\path', 'C:\\\\test2'): False
        }

        failed = 0
        for x in tests:
            if isSubFolder(x[0], x[1]) is not tests[x]:
                log.error('Failed subfolder test %s %s', x)
                failed += 1

        if failed > 0:
            log.error('Subfolder test failed %s tests', failed)
        else:
            log.info('Subfolder test succeeded')

        return failed == 0