diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-08-22 17:06:32 -0300 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-08-22 17:06:32 -0300 |
commit | 6d56902df61c739870278a27cd0184a745672845 (patch) | |
tree | 122d983893c27bec01c55e2fa7367df41a9c5e45 /service/pixelated | |
parent | 13e994b517a77259cd6bbfaf7ba5eefd1a06084a (diff) |
extracting config for leap to config file
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/adapter/mail_service.py | 8 | ||||
-rw-r--r-- | service/pixelated/config/pixelated_ua.cfg | 7 | ||||
-rw-r--r-- | service/pixelated/user_agent.py | 8 |
3 files changed, 9 insertions, 14 deletions
diff --git a/service/pixelated/adapter/mail_service.py b/service/pixelated/adapter/mail_service.py index b9c12e65..100781fd 100644 --- a/service/pixelated/adapter/mail_service.py +++ b/service/pixelated/adapter/mail_service.py @@ -12,11 +12,11 @@ from pixelated.tags import Tags class MailService: - def __init__(self): + def __init__(self, username, password, server_name): try: - self.username = 'testuser_a003' - self.password = 'testpassword' - self.server_name = 'example.wazokazi.is' + self.username = username + self.password = password + self.server_name = server_name self.mailbox_name = 'INBOX' self.certs_home = os.path.join(os.path.abspath("."), "pixelated", "certificates") self.tags = Tags() diff --git a/service/pixelated/config/pixelated_ua.cfg b/service/pixelated/config/pixelated_ua.cfg index 083e1dd4..b46dc95e 100644 --- a/service/pixelated/config/pixelated_ua.cfg +++ b/service/pixelated/config/pixelated_ua.cfg @@ -1,6 +1,5 @@ -DEBUG=True HOST="0.0.0.0" -ACCOUNT="pixelatedinboxapp@gmail.com" -PROVIDER="inboxapp" PORT=3333 - +LEAP_USERNAME="testuser_a003" +LEAP_PASSWORD="testpassword" +LEAP_SERVER_NAME="example.wazokazi.is" diff --git a/service/pixelated/user_agent.py b/service/pixelated/user_agent.py index f2f62134..43c8d1bc 100644 --- a/service/pixelated/user_agent.py +++ b/service/pixelated/user_agent.py @@ -14,9 +14,8 @@ from pixelated.adapter.pixelated_mail import PixelatedMail from pixelated.tags import Tags app = Flask(__name__, static_url_path='', static_folder='../../web-ui/app') - -mail_service = MailService() -account = None +app.config.from_pyfile('config/pixelated_ua.cfg') +mail_service = MailService(app.config['LEAP_USERNAME'], app.config['LEAP_PASSWORD'], app.config['LEAP_SERVER_NAME']) def respond_json(entity): @@ -134,9 +133,6 @@ def index(): def setup(): debug_enabled = os.environ.get('DEBUG', False) reactor_manager.start_reactor(logging=debug_enabled) - app.config.from_pyfile('config/pixelated_ua.cfg') - account = app.config['ACCOUNT'] - app.config['DEBUG'] = debug_enabled app.run(host=app.config['HOST'], debug=debug_enabled, port=app.config['PORT']) |