Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# def get_relative_actual_dir(): # Inherited from GenericContainer
# def get_relative_default_dir(): # Inherited from GenericContainer
def never_called_func(self):
"""Function that is never called, but which makes this class object
collapse neatly in my IDE."""
pass
class Folder(GenericContainer):
"""Python class that handles a sub-directory inside Tartube's data folder,
into which other media data objects (media.Video, media.Channel,
media.Playlist and other media.Folder objects) can be downloaded.
Args:
app_obj (mainapp.TartubeApp): The main application (not stored as an
IV)
dbid (int): A unique ID for this media data object
name (str) - The folder name
parent_obj (media.Folder) - The parent media data object, if any
if new_name is not None:
dir_list = [new_name]
else:
dir_list = [self.name]
obj = self
while obj.parent_obj:
obj = obj.parent_obj
dir_list.insert(0, obj.name)
return os.path.join(*dir_list)
class GenericRemoteContainer(GenericContainer):
"""Base python class inherited by media.Channel and media.Playlist."""
# Public class methods
def add_child(self, child_obj, no_sort_flag=False):
"""Can be called by anything.
Adds a child media data object, which must be a media.Video object.
Args:
child_obj (media.Video): The child object