diff options
author | hut <hut@lavabit.com> | 2010-04-14 01:53:47 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-04-14 01:53:47 +0200 |
commit | 61ee65bf3e71c422728e999b119a702d5b1712a2 (patch) | |
tree | 3d18620e46ed0b7ec1dd94eb97d46922e48b7236 /ranger | |
parent | e07d8797bf8b1029205f48e65241a4819768f310 (diff) | |
download | ranger-61ee65bf3e71c422728e999b119a702d5b1712a2.tar.gz |
actions: move imports to top level
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/core/actions.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 9bef8bdc..e0f36104 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -15,13 +15,18 @@ import os import shutil +from os.path import join, isdir +from os import symlink, getcwd from inspect import cleandoc import ranger -from ranger.shared import EnvironmentAware, SettingsAware from ranger import fsobject +from ranger.ext.direction import Direction +from ranger.shared import FileManagerAware, EnvironmentAware, SettingsAware from ranger.gui.widgets import console_mode as cmode from ranger.fsobject import File +from ranger.ext import shutil_generatorized as shutil_g +from ranger.fsobject.loader import LoadableObject class Actions(EnvironmentAware, SettingsAware): search_method = 'ctime' @@ -518,14 +523,7 @@ class Actions(EnvironmentAware, SettingsAware): self.ui.browser.main_column.request_redraw() def paste_symlink(self): - from os import symlink, getcwd - from os.path import join - copied_files = self.env.copy - - if not copied_files: - return - for f in copied_files: try: symlink(f.path, join(getcwd(), f.basename)) @@ -534,9 +532,6 @@ class Actions(EnvironmentAware, SettingsAware): def paste(self, overwrite=False): """Paste the selected items into the current directory""" - from os.path import join, isdir - from ranger.ext import shutil_generatorized as shutil_g - from ranger.fsobject.loader import LoadableObject copied_files = tuple(self.env.copy) if not copied_files: @@ -592,7 +587,7 @@ class Actions(EnvironmentAware, SettingsAware): self.env.copy -= set(selected) if selected: for f in selected: - if os.path.isdir(f.path) and not os.path.islink(f.path): + if isdir(f.path) and not os.path.islink(f.path): try: shutil.rmtree(f.path) except OSError as err: |