mirror of
https://github.com/onionshare/onionshare.git
synced 2025-07-20 05:22:20 -04:00
Merge branch 'main' into mig/prepare-2.6.3
This commit is contained in:
commit
202f1dc985
19 changed files with 245 additions and 142 deletions
|
@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
import base64
|
||||
import hashlib
|
||||
import importlib.resources as importlib_resources
|
||||
import os
|
||||
import platform
|
||||
import random
|
||||
|
@ -29,7 +30,6 @@ import threading
|
|||
import time
|
||||
import shutil
|
||||
import re
|
||||
from pkg_resources import resource_filename
|
||||
|
||||
import colorama
|
||||
from colorama import Fore, Back, Style
|
||||
|
@ -313,9 +313,10 @@ class Common:
|
|||
"""
|
||||
Returns the absolute path of a resource
|
||||
"""
|
||||
path = resource_filename("onionshare_cli", os.path.join("resources", filename))
|
||||
self.log("Common", "get_resource_path", f"filename={filename}, path={path}")
|
||||
return path
|
||||
ref = importlib_resources.files("onionshare_cli.resources") / filename
|
||||
with importlib_resources.as_file(ref) as path:
|
||||
self.log("Common", "get_resource_path", f"filename={filename}, path={str(path)}")
|
||||
return str(path)
|
||||
|
||||
def get_tor_paths(self):
|
||||
if self.platform == "Linux":
|
||||
|
|
|
@ -176,11 +176,17 @@ class Web:
|
|||
self.website_mode = WebsiteModeWeb(self.common, self)
|
||||
elif self.mode == "chat":
|
||||
if self.common.verbose:
|
||||
self.socketio = SocketIO(
|
||||
async_mode="gevent", logger=True, engineio_logger=True
|
||||
)
|
||||
try:
|
||||
self.socketio = SocketIO(
|
||||
async_mode="gevent", logger=True, engineio_logger=True
|
||||
)
|
||||
except ValueError:
|
||||
self.socketio = SocketIO(logger=True, engineio_logger=True)
|
||||
else:
|
||||
self.socketio = SocketIO(async_mode="gevent")
|
||||
try:
|
||||
self.socketio = SocketIO(async_mode="gevent")
|
||||
except ValueError:
|
||||
self.socketio = SocketIO()
|
||||
self.socketio.init_app(self.app)
|
||||
self.chat_mode = ChatModeWeb(self.common, self)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue