Esempio n. 1
0
def url(is_beta):

    string = json.dumps(monitor.ship(),
                        ensure_ascii=False,
                        sort_keys=True,
                        separators=(',', ':')).encode(
                            'utf-8')  # most compact representation
    if not string:
        return False

    out = StringIO.StringIO()
    with gzip.GzipFile(fileobj=out, mode='w') as f:
        f.write(string)
    return (is_beta and 'http://www.edshipyard.com/beta/#/I='
            or 'http://www.edshipyard.com/#/I=') + base64.urlsafe_b64encode(
                out.getvalue()).replace('=', '%3D')
 def shipyard_url(self, shipname):
     return plug.invoke(config.get('shipyard_provider'), 'EDSY',
                        'shipyard_url', monitor.ship(), monitor.is_beta)
 def shipyard_url(self, shipname):
     return plug.invoke(config.get('shipyard_provider'), 'EDSY', 'shipyard_url', monitor.ship(), monitor.is_beta)