Changeset 14376 in genesis


Ignore:
Timestamp:
Jun 11, 2019, 12:57:59 PM (5 years ago)
Author:
www
Message:

Fix python3 conversion errors gformat CGI

CGI was not tested and causing errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r14374 r14376  
    15021502
    15031503  # Update repository if requested
    1504   form = urllib.parse.urlparse.parse_qs(environ['QUERY_STRING']) if QUERY_STRING in environ else None
     1504  form = urllib.parse.parse_qs(environ.get('QUERY_STRING'))
    15051505  if form and 'action' in form and 'update' in form['action']:
    15061506    refresh_rate = 5
    15071507    output = "[INFO] Updating subverion, please wait...\n"
    1508     old_version = subprocess.Popen([SVNVERSION, '-c', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0]
    1509     output += subprocess.Popen([SVN, 'cleanup', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0]
    1510     output += subprocess.Popen([SVN, 'up', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0]
    1511     new_version = subprocess.Popen([SVNVERSION, '-c', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0]
    1512     if old_version != new_version or ('QUERY_STRING' in environ and 'force' in environ['QUERY_STRING']):
     1508    old_version = subprocess.Popen([SVNVERSION, '-c', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].decode('utf-8')
     1509    output += subprocess.Popen([SVN, 'cleanup', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].decode('utf-8')
     1510    output += subprocess.Popen([SVN, 'up', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].decode('utf-8')
     1511    new_version = subprocess.Popen([SVNVERSION, '-c', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].decode('utf-8')
     1512    if old_version != new_version or 'force' in environ.get('QUERY_STRING'):
    15131513        try:
    15141514            generate_static(CACHE_DIR, False)
     
    15281528    # URL must be of format <prefix>/config/<path>
    15291529    base_uri = environ['REQUEST_URI']
    1530     uri = filter(None, base_uri.split('/config/')[1].strip('/').split('/'))
     1530    uri = list(filter(None, base_uri.split('/config/')[1].strip('/').split('/')))
    15311531
    15321532    output = "Template Holder"
Note: See TracChangeset for help on using the changeset viewer.