Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-fuse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Lambert
swh-fuse
Commits
d3cb2178
Commit
d3cb2178
authored
4 years ago
by
Thibault Allançon
Browse files
Options
Downloads
Patches
Plain Diff
cli: move module-level import to function-level to reduce startup time
Closes T2716.
parent
6bb4deb7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/fuse/cli.py
+11
-7
11 additions, 7 deletions
swh/fuse/cli.py
with
11 additions
and
7 deletions
swh/fuse/cli.py
+
11
−
7
View file @
d3cb2178
...
...
@@ -3,20 +3,14 @@
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
import
asyncio
from
contextlib
import
ExitStack
import
logging
import
os
# WARNING: do not import unnecessary things here to keep cli startup time under
# control
import
os
from
pathlib
import
Path
from
typing
import
Any
,
Dict
import
click
from
daemon
import
DaemonContext
from
swh.core
import
config
from
swh.core.cli
import
CONTEXT_SETTINGS
from
swh.core.cli
import
swh
as
swh_cli_group
from
swh.model.cli
import
SWHIDParamType
...
...
@@ -56,8 +50,11 @@ DEFAULT_CONFIG: Dict[str, Any] = {
def
fuse
(
ctx
,
config_file
):
"""
Software Heritage virtual file system
"""
import
logging
import
pprint
from
swh.core
import
config
if
not
config_file
:
config_file
=
DEFAULT_CONFIG_PATH
...
...
@@ -119,6 +116,12 @@ def mount(ctx, swhids, path, foreground):
"""
import
asyncio
from
contextlib
import
ExitStack
import
logging
from
daemon
import
DaemonContext
from
swh.fuse
import
fuse
# TODO: set default logging settings when --log-config is not passed
...
...
@@ -164,6 +167,7 @@ def umount(ctx, path):
FUSE-based virtual file system. See ``man fusermount3``.
"""
import
logging
import
subprocess
try
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment