ソースを参照

migrate to Flask 1.1 and Python 3.8

pull/259/head
Juan Pablo Giménez 5年前
コミット
3330583903
5個のファイルの変更30行の追加21行の削除
  1. +1
    -1
      Dockerfile
  2. +3
    -3
      modules/base_plugins/gpio_actor/__init__.py
  3. +2
    -2
      modules/core/core.py
  4. +1
    -1
      modules/notification/__init__.py
  5. +23
    -14
      requirements.txt

+ 1
- 1
Dockerfile ファイルの表示

@@ -1,5 +1,5 @@
# Dockerfile for development on a pc/mac
FROM python:3.5
FROM python:3.8

EXPOSE 5000



+ 3
- 3
modules/base_plugins/gpio_actor/__init__.py ファイルの表示

@@ -116,12 +116,12 @@ class DummyPWM(ActorBase):
:return:
'''
self.power = int(power) if power is not None else 100
print "DummyPWM ON %s" % self.power
print("DummyPWM ON %s" % self.power)

def off(self):
self.power = 100
print "OFF"
print("OFF")

def set_power(self, power):
self.power = int(power)
print "DummyPWM POWER %s" % self.power
print("DummyPWM POWER %s" % self.power)

+ 2
- 2
modules/core/core.py ファイルの表示

@@ -378,12 +378,12 @@ class CraftBeerPi(ActorAPI, SensorAPI):


# Event Bus
def event(self, name, async=False):
def event(self, name, use_async=False):

def real_decorator(function):
if self.eventbus.get(name) is None:
self.eventbus[name] = []
self.eventbus[name].append({"function": function, "async": async})
self.eventbus[name].append({"function": function, "async": use_async})
def wrapper(*args, **kwargs):
return function(*args, **kwargs)
return wrapper


+ 1
- 1
modules/notification/__init__.py ファイルの表示

@@ -24,7 +24,7 @@ class NotificationView(FlaskView):
cbpi.cache["messages"].pop(idx)
return ('', 204)

@cbpi.event("MESSAGE", async=True)
@cbpi.event("MESSAGE", use_async=True)
def messageEvent(message, **kwargs):
"""
React on message event. add the message to the cache and push the message to the clients


+ 23
- 14
requirements.txt ファイルの表示

@@ -1,14 +1,23 @@
Flask==1.0
Flask-SocketIO==2.6.2
eventlet==0.19.0
greenlet==0.4.10
python-dateutil==2.5.3
python-engineio==3.8.2.post1
python-mimeparse==1.5.2
python-socketio==1.4.4
PyYAML==4.2b1
requests==2.20.0
Werkzeug==0.15.3
httplib2==0.18.0
flask-classy==0.6.10
GitPython
attrs==19.3.0
certifi==2020.6.20
chardet==3.0.4
click==7.1.2
coverage==5.2.1
Flask==1.1.2
Flask-Classy==0.6.10
Flask-SocketIO==2.6.2
gitdb==4.0.5
GitPython==3.1.7
greenlet==0.4.16
idna==2.10
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
python-engineio==3.8.2.post1
python-socketio==1.4.4
PyYAML==5.3.1
requests==2.24.0
six==1.15.0
smmap==3.0.4
urllib3==1.25.10
Werkzeug==1.0.1

読み込み中…
キャンセル
保存