sys

Here are the examples of the python api sys taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 View Source File : e2m3u2bouquet-v0.7.7.py
License : MIT License
Project Creator : oottppxx

    def read_providers(self, providerfile):
        # Check we have data
        try:
            if not os.path.getsize(providerfile):
                raise Exception('Providers file is empty')
        except Exception, e:
            raise
        with open(providerfile, "r") as f:
            for line in f:
                if line == '400: Invalid request\n':
                    print("Providers download is invalid please resolve or use URL based setup")
                    sys(exit(1))
                line = base64.b64decode(line)
                if line:
                    provider = {
                        'name': line.split(',')[0],
                        'm3u': line.split(',')[1],
                        'epg': line.split(',')[2]
                    }
                PROVIDERS[provider['name']] = provider

        if not DEBUG:
            # remove providers file
            os.remove(providerfile)
        return PROVIDERS

    def process_provider(self, provider, username, password):