diff options
author | Bruno Wagner <bwgpro@gmail.com> | 2015-06-04 19:21:24 -0300 |
---|---|---|
committer | Bruno Wagner <bwgpro@gmail.com> | 2015-06-04 19:25:59 -0300 |
commit | 00c11da60aed649448ddebc0007e2bb88a0201e8 (patch) | |
tree | ad454912c999b7edca6ac8b72c08311e25843b80 | |
parent | 492c6ca2aee8ffcb74e6cb7549542e4bae97bbb7 (diff) |
Config is not used anymore
-rw-r--r-- | service/pixelated/config/config.py | 33 | ||||
-rw-r--r-- | service/pixelated/config/initialize_leap.py | 1 | ||||
-rw-r--r-- | service/pixelated/maintenance.py | 2 | ||||
-rw-r--r-- | service/test/support/integration/app_test_client.py | 10 |
4 files changed, 4 insertions, 42 deletions
diff --git a/service/pixelated/config/config.py b/service/pixelated/config/config.py deleted file mode 100644 index a346344c..00000000 --- a/service/pixelated/config/config.py +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (c) 2014 ThoughtWorks, Inc. -# -# Pixelated is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Pixelated is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Pixelated. If not, see <http://www.gnu.org/licenses/>. - - -class Config(dict): - - def __getattr__(self, name): - if name in self: - return self[name] - else: - raise AttributeError("No such attribute: " + name) - - def __setattr__(self, name, value): - self[name] = value - - def __delattr__(self, name): - if name in self: - del self[name] - else: - raise AttributeError("No such attribute: " + name) diff --git a/service/pixelated/config/initialize_leap.py b/service/pixelated/config/initialize_leap.py index 3ddc3a57..7b600bf8 100644 --- a/service/pixelated/config/initialize_leap.py +++ b/service/pixelated/config/initialize_leap.py @@ -1,4 +1,3 @@ -from pixelated.config.config import Config from pixelated.config import credentials from leap.common.events import server as events_server import pixelated.bitmask_libraries.certs as certs diff --git a/service/pixelated/maintenance.py b/service/pixelated/maintenance.py index dfbd1931..c3e021b4 100644 --- a/service/pixelated/maintenance.py +++ b/service/pixelated/maintenance.py @@ -15,7 +15,6 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. from mailbox import Maildir -from pixelated.config.config import Config from pixelated.config.args import parse_maintenance_args from pixelated.config.initialize_leap import initialize_leap from pixelated.config.logging_setup import init_logging @@ -35,7 +34,6 @@ import pixelated.support.ext_requests_urllib3 def initialize(): args = parse_maintenance_args() - app = Config() init_logging(debug=args.debug) diff --git a/service/test/support/integration/app_test_client.py b/service/test/support/integration/app_test_client.py index 7de6d5b5..25171353 100644 --- a/service/test/support/integration/app_test_client.py +++ b/service/test/support/integration/app_test_client.py @@ -35,7 +35,6 @@ from pixelated.adapter.services.draft_service import DraftService from pixelated.adapter.services.mail_service import MailService from pixelated.adapter.services.mailboxes import Mailboxes from pixelated.adapter.soledad.soledad_querier import SoledadQuerier -from pixelated.config.config import Config from pixelated.resources.root_resource import RootResource from test.support.integration.model import MailBuilder from test.support.test_helper import request_mock @@ -73,9 +72,8 @@ class AppTestClient(object): self.mail_service = self._create_mail_service(self.mailboxes, self.mail_sender, self.soledad_querier, self.search_engine) self.search_engine.index_mails(self.mail_service.all_mails()) - self.config = Config() - self.config.resource = RootResource() - self.config.resource.initialize(self.soledad_querier, self.keymanager, self.search_engine, self.mail_service, self.draft_service) + self.resource = RootResource() + self.resource.initialize(self.soledad_querier, self.keymanager, self.search_engine, self.mail_service, self.draft_service) def _render(self, request, as_json=True): def get_str(_str): @@ -86,7 +84,7 @@ class AppTestClient(object): if written_data: return get_str(written_data) - resource = getChildForRequest(self.config.resource, request) + resource = getChildForRequest(self.resource, request) result = resource.render(request) if isinstance(result, basestring): @@ -99,7 +97,7 @@ class AppTestClient(object): def run_on_a_thread(self, logfile='/tmp/app_test_client.log', port=4567, host='0.0.0.0'): def _start(): - reactor.listenTCP(port, Site(self.config.resource), interface=host) + reactor.listenTCP(port, Site(self.resource), interface=host) reactor.run() process = multiprocessing.Process(target=_start) process.start() |