Trivially encode the password in settings, just to not make is so apparent.

This commit is contained in:
Lukáš Lalinský
2007-09-05 10:12:53 +02:00
parent ff677ce91e
commit 7cd1b7cbb9
2 changed files with 11 additions and 3 deletions

View File

@@ -130,3 +130,10 @@ class FloatOption(Option):
Option.__init__(self, section, name, default, convert)
class PasswordOption(Option):
"""Super l33t h3ckery!"""
def __init__(self, section, name, default):
def convert(value):
return unicode(value.toString()).decode('rot13')
Option.__init__(self, section, name, default, convert)

View File

@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from picard.config import IntOption, TextOption, BoolOption
from picard.config import IntOption, TextOption, BoolOption, PasswordOption
from picard.ui.options import OptionsPage, register_options_page
from picard.ui.ui_options_general import Ui_GeneralOptionsPage
@@ -34,7 +34,7 @@ class GeneralOptionsPage(OptionsPage):
TextOption("setting", "server_host", "musicbrainz.org"),
IntOption("setting", "server_port", 80),
TextOption("setting", "username", ""),
TextOption("setting", "password", ""),
PasswordOption("setting", "password", ""),
BoolOption("setting", "analyze_new_files", False),
]
@@ -60,7 +60,8 @@ class GeneralOptionsPage(OptionsPage):
self.config.setting["server_host"] = unicode(self.ui.server_host.currentText())
self.config.setting["server_port"] = self.ui.server_port.value()
self.config.setting["username"] = unicode(self.ui.username.text())
self.config.setting["password"] = unicode(self.ui.password.text())
# trivially encode the password, just to not make it so apparent
self.config.setting["password"] = unicode(self.ui.password.text()).encode('rot13')
self.config.setting["analyze_new_files"] = self.ui.analyze_new_files.isChecked()