name consistency and method placement changes

This commit is contained in:
itdominator 2021-04-27 22:09:21 -05:00
parent 870f40de3c
commit e9bd2440b7
3 changed files with 23 additions and 22 deletions

View File

@ -119,7 +119,7 @@ class WindowController:
if window.id == win_id: if window.id == win_id:
return window.get_views_count() return window.get_views_count()
def return_views_from_window(self, win_id): def get_views_from_window(self, win_id):
for window in self.windows: for window in self.windows:
if window.id == win_id: if window.id == win_id:
return window.get_all_views() return window.get_all_views()

View File

@ -7,6 +7,9 @@ import os
class Path: class Path:
def get_home(self):
return os.path.expanduser("~") + self.subpath
def get_path(self): def get_path(self):
return "/" + "/".join(self.path) return "/" + "/".join(self.path)
@ -41,6 +44,3 @@ class Path:
path = list( filter(None, home.replace("\\", "/").split('/')) ) path = list( filter(None, home.replace("\\", "/").split('/')) )
self.path = path self.path = path
self.load_directory() self.load_directory()
def get_home(self):
return os.path.expanduser("~") + self.subpath

View File

@ -91,6 +91,25 @@ class View(Settings, Launcher, Icon, Path):
data.append([arr, self.hash_text(arr)]) data.append([arr, self.hash_text(arr)])
return data return data
def is_folder_locked(self, hash):
if self.lock_folder:
path_parts = self.get_path().split('/')
file = self.get_path_part_from_hash(hash)
# Insure chilren folders are locked too.
lockedFolderInPath = False
for folder in self.locked_folders:
if folder in path_parts:
lockedFolderInPath = True
break
return (file in self.locked_folders or lockedFolderInPath)
else:
return False
def get_path_part_from_hash(self, hash): def get_path_part_from_hash(self, hash):
files = self.get_files() files = self.get_files()
file = None file = None
@ -122,24 +141,6 @@ class View(Settings, Launcher, Icon, Path):
} }
} }
def is_folder_locked(self, hash):
if self.lock_folder:
path_parts = self.get_path().split('/')
file = self.get_path_part_from_hash(hash)
# Insure chilren folders are locked too.
lockedFolderInPath = False
for folder in self.locked_folders:
if folder in path_parts:
lockedFolderInPath = True
break
return (file in self.locked_folders or lockedFolderInPath)
else:
return False
def get_pixbuf_icon_str_combo(self): def get_pixbuf_icon_str_combo(self):
data = [] data = []
dir = self.get_current_directory() dir = self.get_current_directory()