Drop python2. PIL everywhere. Bootstrap serve local (#1)

* all local

* local ref

* typo

* proper local

* remove static
This commit is contained in:
Denys Savchenko 2023-10-10 21:28:39 +02:00 committed by GitHub
parent be79b63627
commit 56f7e9f152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 11 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
__pycache__/ __pycache__/
*.pem *.pem
.venv

View File

@ -23,12 +23,7 @@ if ver==2:
elif ver==3: elif ver==3:
import io import io
if sys.platform in ["win32", "darwin"]: from PIL import ImageGrab as ig
from PIL import ImageGrab as ig
else:
import pyscreenshot as ig
bkend = "pygdk3"
class Screen(): class Screen():
def __init__(self): def __init__(self):
@ -46,10 +41,7 @@ class Screen():
def getframes(self): def getframes(self):
while True: while True:
if sys.platform in ["win32", "darwin"]:
im = ig.grab() im = ig.grab()
else:
im = ig.grab(childprocess=False,backend=bkend)
self.screenfile.seek(0) self.screenfile.seek(0)
self.screenfile.truncate(0) self.screenfile.truncate(0)
im_converted = im.convert("RGB") im_converted = im.convert("RGB")

View File

@ -26,8 +26,10 @@ secret_key = u'f71b10b68b1bc00019cfc50d6ee817e75d5441bd5db0bd83453b398225cede69'
app = Flask(__name__) app = Flask(__name__)
app.secret_key = secret_key app.secret_key = secret_key
app.config['BOOTSTRAP_SERVE_LOCAL'] = True
Bootstrap(app) Bootstrap(app)
###### general ########################################## ###### general ##########################################
@app.route('/') @app.route('/')
def welcome(): def welcome():

View File

@ -32,13 +32,16 @@ along with Screenshare. If not, see <https://www.gnu.org/licenses/>.
<link rel="stylesheet" href="{{url_for('static', filename='css/jquery-confirm.min.css')}}"/> <link rel="stylesheet" href="{{url_for('static', filename='css/jquery-confirm.min.css')}}"/>
<link rel="stylesheet" href="{{url_for('static', filename='css/common.css')}}?ver=2"/> <link rel="stylesheet" href="{{url_for('static', filename='css/common.css')}}?ver=2"/>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
{{super()}} {{super()}}
<script src="{{url_for('static', filename='js/jquery-confirm.min.js')}}"></script> <script src="{{url_for('static', filename='js/jquery-confirm.min.js')}}"></script>
<script src="{{url_for('static', filename='js/screen.js')}}?ver=3"></script> <script src="{{url_for('static', filename='js/screen.js')}}?ver=3"></script>
{% endblock %} {% endblock %}
{% block body_attribs %} {% block body_attribs %}