Changeset 740:940403ee48fb


Ignore:
Timestamp:
01/02/16 12:16:46 (9 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added support for an environment variable that can be set to use a different base URL for the MAVA site.

Location:
src/mlx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/common.py

    r651 r740  
    1515# used, which is the default on Windows or when the \c FORCE_PYGTK environment
    1616# variable is set.
     17
     18#---------------------------------------------------------------------------------------
     19
     20MAVA_BASE_URL = os.environ.get("MAVA_BASE_URL", "http://virtualairlines.hu")
    1721
    1822#-------------------------------------------------------------------------------
  • src/mlx/gui/acars.py

    r649 r740  
    2121    """The flight info tab."""
    2222    # The URL of the ACARS map
    23     URL = "http://virtualairlines.hu/acars2/show.html"
     23    URL = MAVA_BASE_URL + "/acars2/show.html"
    2424
    2525    def __init__(self, gui):
  • src/mlx/web.py

    r570 r740  
    22import const
    33import util
     4
     5from common import MAVA_BASE_URL
    46
    57import threading
     
    687689
    688690        if self._entranceExam:
    689             url = "http://www.virtualairlines.hu/ellenorzo/getflightplan.php?pid=%s" % \
     691            url = MAVA_BASE_URL + "/ellenorzo/getflightplan.php?pid=%s" % \
    690692                  (pilotID,)
    691693        else:
    692             url = "http://www.virtualairlines.hu/leker2.php?pid=%s&psw=%s" % \
     694            url = MAVA_BASE_URL + "/leker2.php?pid=%s&psw=%s" % \
    693695                  (pilotID, password)
    694696
     
    745747    def run(self):
    746748        """Perform the login request."""
    747         url = "http://www.virtualairlines.hu/onlinegates_get.php"
     749        url = MAVA_BASE_URL + "/onlinegates_get.php"
    748750
    749751        f = urllib2.urlopen(url, timeout = 10.0)
     
    767769    def run(self):
    768770        """Perform the plane update."""
    769         url = "http://www.virtualairlines.hu/onlinegates_set.php"
     771        url = MAVA_BASE_URL + "/onlinegates_set.php"
    770772
    771773        status = "H" if self._status==const.PLANE_HOME else \
     
    912914    def run(self):
    913915        """Perform the sending of the PIREP."""
    914         url = "http://www.virtualairlines.hu/malevacars.php"
    915         #url = "http://localhost:15000"
     916        url = MAVA_BASE_URL + "/malevacars.php"
    916917
    917918        pirep = self._pirep
     
    993994        print "Sending the online ACARS"
    994995
    995         url = "http://www.virtualairlines.hu/acars2/acarsonline.php"
     996        url = MAVA_BASE_URL  + "/acars2/acarsonline.php"
    996997
    997998        acars = self._acars
Note: See TracChangeset for help on using the changeset viewer.