def sftp_prefix(config):
 login_str = u''
 port_str = u''
 if (config[u'username'] and config[u'password']):
  login_str = (u'%s:%s@' % (config[u'username'], config[u'password']))
 elif config[u'username']:
  login_str = (u'%s@' % config[u'username'])
 if (config[u'port'] and (config[u'port'] != 22)):
  port_str = (u':%d' % config[u'port'])
 return (u'sftp://%s%s%s/' % (login_str, config[u'host'], port_str))

def sftp_prefix ( config ) : login_str = u'' port_str = u'' if ( config [ u'username' ] and config [ u'password' ] ) : login_str = ( u'%s:%s@' % ( config [ u'username' ] , config [ u'password' ] ) ) elif config [ u'username' ] : login_str = ( u'%s@' % config [ u'username' ] ) if ( config [ u'port' ] and ( config [ u'port' ] != 22 ) ) : port_str = ( u':%d' % config [ u'port' ] ) return ( u'sftp://%s%s%s/' % ( login_str , config [ u'host' ] , port_str ) )
generate sftp url prefix .