def form_url(i):
    """
    Input:  {
              (url)                      - if type=='remote' or 'git', URL of remote repository or git repository
              (hostname)                 - if !='', automatically form url above (add http:// + /ck?)
              (port)                     - if !='', automatically add to url above
              (hostext)                  - if !='', add to the end of above URL instead of '/ck?' -
                                           useful when CK server is accessed via Apache2, IIS or other web servers
            }

    Output: {
              return       - return code =  0, if successful
                                         >  0, if error
              (error)      - error text if return > 0

              url          - formed URL
            }

    """

    url=i.get('url','')

    if i.get('hostname','')!='':
       url='http://'+i['hostname']

       if i.get('port','')!='':
          url+=':'+i['port']

       if i.get('hostext','')!='':
          url+='/'+i['hostext']
       else:
          url+='/ck?'

    return {'return':0, 'url':url}
def form_url ( i ) : url = i . get ( 'url' , '' ) if i . get ( 'hostname' , '' ) != '' : url = 'http://' + i [ 'hostname' ] if i . get ( 'port' , '' ) != '' : url += ':' + i [ 'port' ] if i . get ( 'hostext' , '' ) != '' : url += '/' + i [ 'hostext' ] else : url += '/ck?' return { 'return' : 0 , 'url' : url }
Input:  {
              (url)                      - if type=='remote' or 'git', URL of remote repository or git repository
              (hostname)                 - if !='', automatically form url above (add http:// + /ck?)
              (port)                     - if !='', automatically add to url above
              (hostext)                  - if !='', add to the end of above URL instead of '/ck?' -
                                           useful when CK server is accessed via Apache2, IIS or other web servers
            }

    Output: {
              return       - return code =  0, if successful
                                         >  0, if error
              (error)      - error text if return > 0

              url          - formed URL
            }