mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
formatting code
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
import time
|
||||
|
||||
import pip
|
||||
from pip._internal import main as pipmain
|
||||
from common.log import logger,_reset_logger
|
||||
|
||||
from common.log import _reset_logger, logger
|
||||
|
||||
|
||||
def install(package):
|
||||
pipmain(['install', package])
|
||||
pipmain(["install", package])
|
||||
|
||||
|
||||
def install_requirements(file):
|
||||
pipmain(['install', '-r', file, "--upgrade"])
|
||||
pipmain(["install", "-r", file, "--upgrade"])
|
||||
_reset_logger(logger)
|
||||
|
||||
|
||||
def check_dulwich():
|
||||
needwait = False
|
||||
for i in range(2):
|
||||
@@ -18,13 +23,14 @@ def check_dulwich():
|
||||
needwait = False
|
||||
try:
|
||||
import dulwich
|
||||
|
||||
return
|
||||
except ImportError:
|
||||
try:
|
||||
install('dulwich')
|
||||
install("dulwich")
|
||||
except:
|
||||
needwait = True
|
||||
try:
|
||||
import dulwich
|
||||
except ImportError:
|
||||
raise ImportError("Unable to import dulwich")
|
||||
raise ImportError("Unable to import dulwich")
|
||||
|
||||
Reference in New Issue
Block a user