mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-22 23:24:44 +00:00
Remove is_frozen()
Not used since:
e3ab9024 ("Remove platform-specific installer stuff and ensure a build .whl wheel file can be built.", 2016-01-17)
This commit is contained in:
parent
d3ba3978f6
commit
3359c7364f
2 changed files with 2 additions and 26 deletions
|
|
@ -50,10 +50,6 @@ def module_path():
|
|||
|
||||
def get_install_data():
|
||||
"""Return absolute path of LinkChecker data installation directory."""
|
||||
from .loader import is_frozen
|
||||
|
||||
if is_frozen():
|
||||
return module_path()
|
||||
return configdata.install_data
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,19 +8,11 @@ Example usage::
|
|||
plugins = loader.get_plugins(modules, PluginClass)
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import zipfile
|
||||
import importlib
|
||||
|
||||
from .fileutil import is_writable_by_others
|
||||
|
||||
|
||||
def is_frozen():
|
||||
"""Return True if running inside a py2exe- or py2app-generated
|
||||
executable."""
|
||||
return hasattr(sys, "frozen")
|
||||
|
||||
|
||||
def check_writable_by_others(filename):
|
||||
"""Check if file is writable by others on POSIX systems.
|
||||
On non-POSIX systems the check is ignored."""
|
||||
|
|
@ -38,20 +30,8 @@ def get_package_modules(packagename):
|
|||
@return: all loaded valid modules
|
||||
@rtype: iterator of module
|
||||
"""
|
||||
if is_frozen():
|
||||
# find modules in library.zip filename
|
||||
zipname = os.path.dirname(os.path.dirname(__file__))
|
||||
parentmodule = os.path.basename(os.path.dirname(__file__))
|
||||
with zipfile.ZipFile(zipname, 'r') as f:
|
||||
prefix = "%s/%s/" % (parentmodule, packagename)
|
||||
modnames = [
|
||||
os.path.splitext(n[len(prefix):])[0]
|
||||
for n in f.namelist()
|
||||
if n.startswith(prefix) and "__init__" not in n
|
||||
]
|
||||
else:
|
||||
dirname = os.path.join(os.path.dirname(__file__), packagename)
|
||||
modnames = [x[:-3] for x in get_importable_files(dirname)]
|
||||
dirname = os.path.join(os.path.dirname(__file__), packagename)
|
||||
modnames = [x[:-3] for x in get_importable_files(dirname)]
|
||||
for modname in modnames:
|
||||
try:
|
||||
name = "..%s.%s" % (packagename, modname)
|
||||
|
|
|
|||
Loading…
Reference in a new issue