muffin 0.96.2__py3-none-any.whl → 0.97.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
muffin/app.py CHANGED
@@ -75,10 +75,6 @@ class Application(BaseApp):
75
75
  self.manage = Manager(self)
76
76
 
77
77
  # Setup logging
78
- log_config = self.cfg.get("LOG_CONFIG")
79
- if log_config and isinstance(log_config, dict) and log_config.get("version"):
80
- dictConfig(log_config)
81
-
82
78
  self.logger = logging.getLogger("muffin")
83
79
  self.logger.setLevel(self.cfg.LOG_LEVEL)
84
80
  self.logger.propagate = False
@@ -89,6 +85,10 @@ class Application(BaseApp):
89
85
  )
90
86
  self.logger.addHandler(ch)
91
87
 
88
+ log_config = self.cfg.get("LOG_CONFIG")
89
+ if log_config and isinstance(log_config, dict) and log_config.get("version"):
90
+ dictConfig(log_config)
91
+
92
92
  super().__init__(
93
93
  debug=self.cfg.DEBUG,
94
94
  logger=self.logger,
muffin/plugins.py CHANGED
@@ -50,7 +50,7 @@ class BasePlugin(ABC):
50
50
  msg = "Plugin.name is required"
51
51
  raise TypeError(msg)
52
52
 
53
- self.cfg = Config(config_config={"update_from_env": False}, **self.defaults)
53
+ self.cfg = Config(config_config={"update_from_env": False}, disabled=False, **self.defaults)
54
54
  self.__app__ = app
55
55
 
56
56
  if app is not None:
@@ -74,8 +74,6 @@ class BasePlugin(ABC):
74
74
  """Bind app and update the plugin's configuration."""
75
75
  # allow to redefine the name for multi plugins with same type
76
76
  self.name = name or self.name
77
- self.__app__ = app
78
- app.plugins[self.name] = self
79
77
 
80
78
  # Update configuration
81
79
  self.cfg.update_from_dict(
@@ -84,6 +82,12 @@ class BasePlugin(ABC):
84
82
  exist_only=True,
85
83
  )
86
84
  self.cfg.update_from_dict(options)
85
+ if self.cfg.disabled:
86
+ app.logger.warning("Plugin %s is disabled", self.name)
87
+ return
88
+
89
+ app.plugins[self.name] = self
90
+ self.__app__ = app
87
91
 
88
92
  # Register a middleware
89
93
  if self.middleware:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: muffin
3
- Version: 0.96.2
3
+ Version: 0.97.1
4
4
  Summary: Muffin is a fast, simple and asyncronous web-framework for Python 3 (asyncio, trio, curio)
5
5
  Home-page: https://github.com/klen/muffin
6
6
  License: MIT
@@ -1,15 +1,15 @@
1
1
  muffin/__init__.py,sha256=F8Qp4ETX5FqI1832dj2moRAQ5hEb0TO9u4aRjSKXNjI,982
2
- muffin/app.py,sha256=jZQlVyrqDh7XuJx4J5dj6SV1t2tUHovVXMCzNx5Zg_o,5130
2
+ muffin/app.py,sha256=HxTuFjokxw5_cDeWeOzLXYvw0HZB6ifIcOXAd1GMfTA,5130
3
3
  muffin/constants.py,sha256=Ga1UJiEdXUk6dIEH_IEVYkFSZxQFPhxie7fCJwQY8V0,71
4
4
  muffin/errors.py,sha256=I-vKbMMBiMU07zPdKvoJKqA7s4xYAUA-4oZXrRMRzcM,701
5
5
  muffin/handler.py,sha256=YGodKswFv-dNf8ABODp_JQx0M36nCGmcKewAolrsq9k,3754
6
6
  muffin/manage.py,sha256=-z-J5py2cqLrl259j1Psk61ZxsBbNEBX2T-v2AVZKEs,8805
7
- muffin/plugins.py,sha256=nab6JqdWzAF65--lbhjOo9lzNzG5jiNtmk-UC-WcLTI,2724
7
+ muffin/plugins.py,sha256=rIBO7Y3i3UUGyjPzjkS8XrEcOeoDTRg6sZiMfKtBuhY,2857
8
8
  muffin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  muffin/pytest.py,sha256=Fzersdp2WoO9xCKx5Cezp3yU-We2AU6etiQcT360p3E,2705
10
10
  muffin/types.py,sha256=wsUj5oAfqSZMoEf-wyFJLBlWa8Mc-eJGqKLr02HxuXE,153
11
11
  muffin/utils.py,sha256=xWhd79f1qEw7CH4BjB6OqVHEOukWckIEc9ap7EHh_hs,2449
12
- muffin-0.96.2.dist-info/METADATA,sha256=qGkxAfpM1xSKXzlN1VZeyOEdf87mWOwCmO4OM2zzmZI,11614
13
- muffin-0.96.2.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
14
- muffin-0.96.2.dist-info/entry_points.txt,sha256=GvPS3M-tNVPzhUS5jnUpOmWw2NAqedY34VRCYgPYzlM,84
15
- muffin-0.96.2.dist-info/RECORD,,
12
+ muffin-0.97.1.dist-info/METADATA,sha256=AyLC8pBP1jvFWRGCEWM8FvbOvqifj0pLA8G3OUhms7E,11614
13
+ muffin-0.97.1.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
14
+ muffin-0.97.1.dist-info/entry_points.txt,sha256=GvPS3M-tNVPzhUS5jnUpOmWw2NAqedY34VRCYgPYzlM,84
15
+ muffin-0.97.1.dist-info/RECORD,,