Ignore:
Timestamp:
03/10/12 16:20:55 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Started the flight wizard and it is now possible to log in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/config.py

    r40 r42  
    2020        """Construct the configuration with default values."""
    2121
     22        self._pilotID = ""
     23        self._password = ""
     24
    2225        self._autoUpdate = True       
    2326        self._updateURL = Config.DEFAULT_UPDATE_URL
    2427
    2528        self._modified = False
     29
     30    @property
     31    def pilotID(self):
     32        """Get the pilot ID."""
     33        return self._pilotID
     34
     35    @pilotID.setter
     36    def pilotID(self, pilotID):
     37        """Set the pilot ID."""
     38        if pilotID!=self._pilotID:
     39            self._pilotID = pilotID
     40            self._modified = True
     41
     42    @property
     43    def password(self):
     44        """Get the password."""
     45        return self._password
     46
     47    @password.setter
     48    def password(self, password):
     49        """Set the password."""
     50        if password!=self._password:
     51            self._password = password
     52            self._modified = True
    2653
    2754    @property
     
    5481        config.read(configPath)
    5582
     83        self._pilotID = self._get(config, "login", "id", "")
     84        self._password = self._get(config, "login", "password", "")
     85
    5686        self._autoUpdate = self._getBoolean(config, "update", "auto", True)
    5787        self._updateURL = self._get(config, "update", "url",
     
    6595
    6696        config = ConfigParser.RawConfigParser()
     97
     98        config.add_section("login")
     99        config.set("login", "id", self._pilotID)
     100        config.set("login", "password", self._password)
    67101
    68102        config.add_section("update")
Note: See TracChangeset for help on using the changeset viewer.