Changeset 689:7aa9d7136b41 for src/mlx


Ignore:
Timestamp:
10/20/15 15:23:12 (9 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
cef
Phase:
public
Message:

Added configuration items for the SimBrief credentials (re #279)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/config.py

    r688 r689  
    234234
    235235        self._useSimBrief = False
     236        self._simBriefUserName = ""
     237        self._simBriefPassword = ""
     238        self._rememberSimBriefPassword = False
    236239
    237240        self._pirepDirectory = None
     
    456459        if self._useSimBrief != useSimBrief:
    457460            self._useSimBrief = useSimBrief
     461            self._modified = True
     462
     463    @property
     464    def simBriefUserName(self):
     465        """Get the SimBrief user name last used"""
     466        return self._simBriefUserName
     467
     468    @simBriefUserName.setter
     469    def simBriefUserName(self, simBriefUserName):
     470        """Set the SimBrief user name to be used next."""
     471        if self._simBriefUserName != simBriefUserName:
     472            self._simBriefUserName = simBriefUserName
     473            self._modified = True
     474
     475    @property
     476    def simBriefPassword(self):
     477        """Get the SimBrief password last used"""
     478        return self._simBriefPassword
     479
     480    @simBriefPassword.setter
     481    def simBriefPassword(self, simBriefPassword):
     482        """Set the SimBrief password to be used next."""
     483        if self._simBriefPassword != simBriefPassword:
     484            self._simBriefPassword = simBriefPassword
     485            self._modified = True
     486
     487    @property
     488    def rememberSimBriefPassword(self):
     489        """Get if we should remember the SimBrief password."""
     490        return self._rememberSimBriefPassword
     491
     492    @rememberSimBriefPassword.setter
     493    def rememberSimBriefPassword(self, rememberSimBriefPassword):
     494        """Set if we should remember the SimBrief password."""
     495        if rememberSimBriefPassword!=self._rememberSimBriefPassword:
     496            self._rememberSimBriefPassword = rememberSimBriefPassword
    458497            self._modified = True
    459498
     
    695734        self._useSimBrief = self._getBoolean(config, "simbrief",
    696735                                             "use", False)
     736        self._simBriefUserName = self._get(config, "simbrief",
     737                                           "username", "")
     738        self._simBriefPassword = self._get(config, "simbrief",
     739                                           "password", "")
     740        self._rememberSimBriefPassword = self._getBoolean(config, "simbrief",
     741                                                          "rememberPassword",
     742                                                          False)
    697743
    698744        self._pirepDirectory = self._get(config, "general",
     
    779825        config.set("simbrief", "use",
    780826                   "yes" if self._useSimBrief else "no")
     827        config.set("simbrief", "username", self._simBriefUserName)
     828        config.set("simbrief", "password", self._simBriefPassword)
     829        config.set("simbrief", "rememberPassword",
     830                   "yes" if self._rememberSimBriefPassword else "no")
    781831
    782832        if self._pirepDirectory is not None:
     
    930980
    931981        print "  useSimBrief:", self._useSimBrief
     982        print "  simBriefUserName:", self._simBriefUserName
     983        print "  rememberSimBriefPassword:", self._rememberSimBriefPassword
    932984
    933985        print "  pirepDirectory:", self._pirepDirectory
Note: See TracChangeset for help on using the changeset viewer.