plain.dev 0.28.0__py3-none-any.whl → 0.29.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.
plain/dev/cli.py CHANGED
@@ -49,8 +49,8 @@ ENTRYPOINT_GROUP = "plain.dev"
49
49
  @click.option(
50
50
  "--log-level",
51
51
  "-l",
52
- default="info",
53
- type=click.Choice(["debug", "info", "warning", "error", "critical"]),
52
+ default="",
53
+ type=click.Choice(["debug", "info", "warning", "error", "critical", ""]),
54
54
  help="Log level",
55
55
  )
56
56
  def cli(ctx, port, hostname, log_level):
@@ -145,10 +145,14 @@ class Dev:
145
145
  self.plain_env = {
146
146
  "PYTHONUNBUFFERED": "true",
147
147
  "PLAIN_DEV": "true",
148
- "PLAIN_LOG_LEVEL": self.log_level.upper(),
149
- "APP_LOG_LEVEL": self.log_level.upper(),
150
- **os.environ,
151
148
  }
149
+
150
+ if log_level:
151
+ self.plain_env["PLAIN_LOG_LEVEL"] = log_level.upper()
152
+ self.plain_env["APP_LOG_LEVEL"] = log_level.upper()
153
+
154
+ self.plain_env.update(os.environ)
155
+
152
156
  self.custom_process_env = {
153
157
  **self.plain_env,
154
158
  "PORT": str(self.port),
@@ -404,7 +408,7 @@ class Dev:
404
408
  "--timeout",
405
409
  "60",
406
410
  "--log-level",
407
- self.log_level,
411
+ self.log_level or "info",
408
412
  "--access-logfile",
409
413
  "-",
410
414
  "--error-logfile",
plain/dev/requests.py CHANGED
@@ -137,10 +137,10 @@ class RequestLog:
137
137
  "method": request.method,
138
138
  "path": request.path,
139
139
  "full_path": request.get_full_path(),
140
- "querydict": request.POST.dict()
140
+ "querydict": request.data.dict()
141
141
  if request.method == "POST"
142
- else request.GET.dict(),
143
- "cookies": request.COOKIES,
142
+ else request.query_params.dict(),
143
+ "cookies": request.cookies,
144
144
  # files?
145
145
  "absolute_uri": request.build_absolute_uri(),
146
146
  "body": request.body.decode("utf-8"),
@@ -192,7 +192,7 @@ def should_capture_request(request):
192
192
 
193
193
  # This could be an attribute set on request or response
194
194
  # or something more dynamic
195
- if "querystats" in request.GET:
195
+ if "querystats" in request.query_params:
196
196
  return False
197
197
 
198
198
  return True
plain/dev/views.py CHANGED
@@ -11,10 +11,12 @@ class RequestsView(TemplateView):
11
11
  ctx = super().get_template_context()
12
12
  requestlogs = RequestLog.load_json_logs()
13
13
 
14
- if self.request.GET.get("log"):
14
+ if self.request.query_params.get("log"):
15
15
  try:
16
16
  requestlog = [
17
- x for x in requestlogs if x.get("name") == self.request.GET["log"]
17
+ x
18
+ for x in requestlogs
19
+ if x.get("name") == self.request.query_params["log"]
18
20
  ][0]
19
21
  except IndexError:
20
22
  requestlog = None
@@ -29,9 +31,9 @@ class RequestsView(TemplateView):
29
31
  return ctx
30
32
 
31
33
  def post(self):
32
- if self.request.POST.get("action") == "clear":
34
+ if self.request.data.get("action") == "clear":
33
35
  RequestLog.clear()
34
36
  return ResponseRedirect(self.request.path)
35
37
  else:
36
- RequestLog.replay_request(self.request.POST["log"])
38
+ RequestLog.replay_request(self.request.data["log"])
37
39
  return ResponseRedirect(".")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.dev
3
- Version: 0.28.0
3
+ Version: 0.29.1
4
4
  Summary: Local development tools for Plain.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-Expression: BSD-3-Clause
@@ -1,17 +1,17 @@
1
1
  plain/dev/README.md,sha256=EQJ9lF-JQ9KQWJZ_j6CD3jbRquOLgDRlIPbgT7A2gG4,3658
2
2
  plain/dev/__init__.py,sha256=nRX1B0Br8gmqhJLqo5Z9PqzReDahBtbmwH6C-7hzuls,103
3
- plain/dev/cli.py,sha256=lyiIJveVedrO1MDwTlV-C-UYzMHR48q7MWEUODEQMUc,15605
3
+ plain/dev/cli.py,sha256=5rh-CSVmdcfBM6RrSD1SCUB0lYEb94NOmAd8LXicZr0,15678
4
4
  plain/dev/debug.py,sha256=Ka84K8zUdF0kMYNyqiLYDrdzU1jU8LSOkts3hcw_Gok,1005
5
5
  plain/dev/default_settings.py,sha256=uXWYORWP_aRDwXIFXdu5kHyiBFUZzARIJdhPeFaX35c,75
6
6
  plain/dev/entrypoints.py,sha256=diqNwA6eydUMtoO7p_rH-DtSYsw5-GBmjFe1Z5bHagc,579
7
7
  plain/dev/gunicorn_logging.json,sha256=yU23jzs5G4YGdDWBNiyAc3KypR4HirR6afIkD7w6DhU,1113
8
8
  plain/dev/mkcert.py,sha256=fm1U_UTGPREso6ZaP79WqEvd9uvA4lYWFo6fKhNglMM,3911
9
9
  plain/dev/pdb.py,sha256=4ru3rlIIyuYVXteyI7v42i4MmdBIjpJP0IJemBpf83A,3742
10
- plain/dev/requests.py,sha256=D1NX0qC8ADtf_zwsGMTp9aiE6Sh9QmoxFJCU_V8Wers,6839
10
+ plain/dev/requests.py,sha256=NH-_FYolAUbh2-m0x9hTdK6AS7HLo6cGETTpp6R-Wto,6857
11
11
  plain/dev/services.py,sha256=bfIXEVsot20cDbyIeRJ9xAiTTVxowHrLAiZM2aOMXDU,2845
12
12
  plain/dev/urls.py,sha256=6fyl-DvxDgKjUjpyhuLN8m6GisB8L-eH4rhYH_eRmGA,188
13
13
  plain/dev/utils.py,sha256=4wMzpvj1Is_c0QxhsTu34_P9wAYlzw4glNPfVtZr_0A,123
14
- plain/dev/views.py,sha256=r2Ivk7OXytpRhXq4DZpsb7FXNP9vzmEE3D5kLajYG4w,1073
14
+ plain/dev/views.py,sha256=yCZ_YmkJGCb3YYgElhzAPrA9V0X3lkiLD1-Ht1HjV7A,1131
15
15
  plain/dev/contribute/README.md,sha256=v9Ympugu2wvDEe_045WJnF1dmC4ZH7v_Bnxkpfaf_rM,329
16
16
  plain/dev/contribute/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
17
17
  plain/dev/contribute/cli.py,sha256=YirzF4YCQoFhWS-JgQHNxqJIX9BY_m9lb3_ZdrI7sn4,3097
@@ -24,8 +24,8 @@ plain/dev/poncho/process.py,sha256=JJOKy-C6vMCg7-6JMCtu6C649h7HmOBSJqDP_hnX49I,2
24
24
  plain/dev/precommit/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
25
25
  plain/dev/precommit/cli.py,sha256=KVHcG3Y_JZJNu3_MLIrO5s6yMYQfAArIU5L0hNWZUjg,3441
26
26
  plain/dev/templates/dev/requests.html,sha256=kQKJZq5L77juuL_t8UjcAehEU61U4RXNnKaAET-wAm8,7627
27
- plain_dev-0.28.0.dist-info/METADATA,sha256=e9YKAUJem8n9tLYT0kCmFD5aEKPE5fBX5dmwu-RUWyk,4163
28
- plain_dev-0.28.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
- plain_dev-0.28.0.dist-info/entry_points.txt,sha256=zrcTOiFk_MLKsnYVlwVP7aMm1XLEqq7w4EBkJ-3ge-g,114
30
- plain_dev-0.28.0.dist-info/licenses/LICENSE,sha256=Cx4Dq9yR2fLHthf8Ke36B8QJvE1bZFXVzDIGE8wGzsY,4132
31
- plain_dev-0.28.0.dist-info/RECORD,,
27
+ plain_dev-0.29.1.dist-info/METADATA,sha256=xKFUKIWICvxJCwQwdok-X13y8-_lP2CORyE9HBjRFbo,4163
28
+ plain_dev-0.29.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
+ plain_dev-0.29.1.dist-info/entry_points.txt,sha256=zrcTOiFk_MLKsnYVlwVP7aMm1XLEqq7w4EBkJ-3ge-g,114
30
+ plain_dev-0.29.1.dist-info/licenses/LICENSE,sha256=Cx4Dq9yR2fLHthf8Ke36B8QJvE1bZFXVzDIGE8wGzsY,4132
31
+ plain_dev-0.29.1.dist-info/RECORD,,