Ignore:
Timestamp:
03/24/19 08:15:59 (4 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Ran 2to3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/cef.py

    r915 r919  
    1 from common import *
     1from .common import *
    22
    33from mlx.util import secondaryInstallation
     
    1010import os
    1111import re
    12 import thread
     12import _thread
    1313import threading
    1414import tempfile
    1515import traceback
    16 import urllib2
     16import urllib.request, urllib.error, urllib.parse
    1717from lxml import etree
    18 from StringIO import StringIO
     18from io import StringIO
    1919import lxml.html
    2020
     
    115115        """Called when a page has been loaded in the SimBrief browser."""
    116116        url = frame.GetUrl()
    117         print "gui.cef.SimBriefHandler._onLoadEnd", httpCode, url
     117        print("gui.cef.SimBriefHandler._onLoadEnd", httpCode, url)
    118118        if httpCode>=300:
    119119            self._updateProgress(self._lastProgress,
     
    127127
    128128            js = "form=document.getElementById(\"sbapiform\");"
    129             for (name, value) in self._plan.iteritems():
     129            for (name, value) in self._plan.items():
    130130                js += "form." + name + ".value=\"" + value + "\";"
    131             for (name, value) in SimBriefHandler._querySettings.iteritems():
     131            for (name, value) in SimBriefHandler._querySettings.items():
    132132                if isinstance(value, bool):
    133133                    js += "form." + name + ".checked=" + \
     
    175175
    176176            thread = threading.Thread(target = self._getResults, args = (link,))
    177             thread.daemon = True
    178             thread.start()
     177            _thread.daemon = True
     178            _thread.start()
    179179        else:
    180180            self._updateProgress(SIMBRIEF_PROGRESS_RETRIEVING_BRIEFING,
     
    219219
    220220        # Obtaining the xml
    221         response = urllib2.urlopen(link)
     221        response = urllib.request.urlopen(link)
    222222        xmlContent = response.read()
    223223        # Processing xml
     
    242242                    imageLinks.append(imageLink[2])
    243243        flightInfo["image_links"] = imageLinks
    244         print(sorted(availableInfo.keys()))
     244        print((sorted(availableInfo.keys())))
    245245        htmlFilePath = "simbrief_plan.html" if self._htmlFilePath is None \
    246246          else self._htmlFilePath
     
    266266def _initializeCEF(args, initializedCallback):
    267267    """Perform the actual initialization of CEF using the given arguments."""
    268     print "Initializing CEF with args:", args
     268    print("Initializing CEF with args:", args)
    269269
    270270    settings = {
     
    290290                    switches[arg[2:assignIndex]] = arg[assignIndex+1:]
    291291        else:
    292             print "Unhandled switch", arg
     292            print("Unhandled switch", arg)
    293293
    294294    cefpython.Initialize(settings, switches)
     
    296296    gobject.timeout_add(10, _handleTimeout)
    297297
    298     print "Initialized, executing callback..."
     298    print("Initialized, executing callback...")
    299299    initializedCallback()
    300300
     
    322322        window = container.get_window()
    323323        if window is None:
    324             print "mlx.gui.cef.startInContainer: no window found!"
     324            print("mlx.gui.cef.startInContainer: no window found!")
    325325            windowID = None
    326326        else:
Note: See TracChangeset for help on using the changeset viewer.