currency_converter/currency_converter.py
def load_file(self, currency_file):
        """To be subclassed if alternate methods of loading data.
        """
        if currency_file.startswith(('http://', 'https://')):
            content = urlopen(currency_file).read()
        else:
            with open(currency_file, 'rb') as f:
                content = f.read()

        if currency_file.endswith('.zip'):
            self.load_lines(get_lines_from_zip(content))
        else:
            self.load_lines(content.decode('utf-8').splitlines())
def load_file(self, currency_file):
        if currency_file.startswith(('http://', 'https://')):
            content = urlopen(currency_file).read()
        else:
            with open(currency_file, 'rb') as f:
                content = f.read()

        if currency_file.endswith('.zip'):
            self.load_lines(get_lines_from_zip(content))
        else:
            self.load_lines(content.decode('utf-8').splitlines())
def load_file ( self , currency_file ) : if currency_file . startswith ( ( 'http://' , 'https://' ) ) : content = urlopen ( currency_file ) . read ( ) else : with open ( currency_file , 'rb' ) as f : content = f . read ( ) if currency_file . endswith ( '.zip' ) : self . load_lines ( get_lines_from_zip ( content ) ) else : self . load_lines ( content . decode ( 'utf-8' ) . splitlines ( ) )
To be subclassed if alternate methods of loading data.
To be subclassed if alternate methods of loading data .