Ignore:
Timestamp:
07/14/19 14:55:32 (5 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Semi-automatic upgrate of the update URL to HTTPS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/config.py

    r919 r1011  
    211211class Config(object):
    212212    """Our configuration."""
    213     DEFAULT_UPDATE_URL = "http://mlx.varadiistvan.hu/update"
     213    DEFAULT_UPDATE_URL = "https://mlx.varadiistvan.hu/update"
    214214
    215215    _messageTypesSection = "messageTypes"
     
    258258        if secondaryInstallation:
    259259            self._updateURL += "/exp"
     260        self._updateURLUpdated = True
    260261        self._useRPC = True
    261262
     
    703704    def load(self):
    704705        """Load the configuration from its default location."""
     706        self._updateURLUpdated = False
     707
    705708        try:
    706709            config = configparser.RawConfigParser()
     
    788791                                    Config.DEFAULT_UPDATE_URL +
    789792                                    ("/exp" if secondaryInstallation else ""))
     793        self._updateURLUpdated = self._getBoolean(config, "update",
     794                                                  "urlUpdated", False)
     795        if self._updateURL.startswith("http://") and not self._updateURLUpdated:
     796            self._updateURL = "https://" + self._updateURL[7:]
     797            self._updateURLUpdated = True
     798
    790799        self._useRPC = self._getBoolean(config, "general", "useRPC", True)
    791800
     
    880889                   "yes" if self._autoUpdate else "no")
    881890        config.set("update", "url", self._updateURL)
     891        config.set("update", "urlUpdated", self._updateURLUpdated)
    882892
    883893        config.set("general", "useRPC",
     
    10181028        print("  autoUpdate:", self._autoUpdate)
    10191029        print("  updateURL:", self._updateURL)
     1030        print("  updateURLUpdated:", self._updateURLUpdated)
    10201031        print("  useRPC:", self._useRPC)
    10211032
Note: See TracChangeset for help on using the changeset viewer.