mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-31 15:23:02 +00:00 
			
		
		
		
	Find imports in executables
This commit is contained in:
		| @@ -81,6 +81,7 @@ else: | ||||
|     calibre_web_version = (constants.STABLE_VERSION['version'] + ' - ' | ||||
|                            + constants.NIGHTLY_VERSION[0].replace('%', '%%') + ' - ' | ||||
|                            + constants.NIGHTLY_VERSION[1].replace('%', '%%')) | ||||
|  | ||||
| if getattr(sys, 'frozen', False): | ||||
|     calibre_web_version += " - Exe-Version" | ||||
| elif constants.HOME_CONFIG: | ||||
|   | ||||
| @@ -1,5 +1,7 @@ | ||||
| import os | ||||
| import re | ||||
| import sys | ||||
| import json | ||||
|  | ||||
| from .constants import BASE_DIR | ||||
| try: | ||||
| @@ -8,7 +10,7 @@ try: | ||||
|     ImportNotFound = BaseException | ||||
| except ImportError: | ||||
|     importlib = False | ||||
|  | ||||
|     version = None | ||||
|  | ||||
| if not importlib: | ||||
|     try: | ||||
| @@ -20,6 +22,9 @@ if not importlib: | ||||
|  | ||||
| def load_dependencys(optional=False): | ||||
|     deps = list() | ||||
|     if getattr(sys, 'frozen', False): | ||||
|         with open(os.path.join(BASE_DIR, ".pip_installed")) as f: | ||||
|             exe_deps = json.loads(f.readlines()) | ||||
|     if importlib or pkgresources: | ||||
|         if optional: | ||||
|             req_path = os.path.join(BASE_DIR, "optional-requirements.txt") | ||||
| @@ -31,6 +36,9 @@ def load_dependencys(optional=False): | ||||
|                     if not line.startswith('#') and not line == '\n' and not line.startswith('git'): | ||||
|                         res = re.match(r'(.*?)([<=>\s]+)([\d\.]+),?\s?([<=>\s]+)?([\d\.]+)?', line.strip()) | ||||
|                         try: | ||||
|                             if getattr(sys, 'frozen', False): | ||||
|                                 dep_version = exe_deps[res.group(1).lower()] | ||||
|                             else: | ||||
|                                 if importlib: | ||||
|                                     dep_version = version(res.group(1)) | ||||
|                                 else: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ozzie Isaacs
					Ozzie Isaacs