Module Expr Str Import alias Import alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad Str attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Pass decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If NameLoad body Assign NameStore ListComp Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad comprehension NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad orelse Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If NameLoad body Assign NameStore ListComp Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad comprehension NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad orelse Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults ListLoad NameLoad NameLoad body Expr Str Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareNotIn NameLoad NameLoad CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareNotIn NameLoad NameLoad CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str If CompareNotIn AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list
N/A N/A 
********************************************************************************
* Name: workspace.py
* Author: Nathan Swain & Scott Christensen
* Created On: August 5, 2015
* Copyright: (c) Brigham Young University 2015
* License: BSD 2-Clause
********************************************************************************
 N/A os N/A shutil TethysWorkspace N/A object N/A N/A 
    Defines objects that represent file workspaces (directories) for apps and users.

    Attributes:
      path(str): The absolute path to the workspace directory. Cannot be overwritten.
     __init__ N/A N/A self path N/A N/A N/A 
        Constructor
         N/A N/A N/A N/A N/A os path exists path N/A N/A N/A N/A os makedirs path N/A N/A self _path path N/A __repr__ N/A N/A self N/A N/A N/A 
        Rendering
         N/A N/A N/A <TethysWorkspace path="{0}"> format N/A self _path N/A path N/A N/A self N/A N/A N/A N/A self _path N/A property path N/A N/A self value N/A N/A N/A 
        Don't allow overwriting the path property.
         N/A N/A N/A path setter files N/A N/A self full_path N/A False N/A N/A 
        Return a list of files that are in the workspace.

        Args:
          full_path(bool): Returns list of files with full path names when True. Defaults to False.

        Returns:
          list: A list of files in the workspace.

        **Examples:**

        ::

            # List file names
            workspace.files()

            # List full path file names
            workspace.files(full_path=True)

         N/A full_path N/A N/A files N/A N/A N/A N/A os path join N/A self _path f N/A f N/A N/A os listdir N/A self _path N/A N/A N/A os path isfile N/A N/A N/A os path join N/A self _path f N/A N/A files N/A f N/A f N/A N/A os listdir N/A self _path N/A N/A N/A os path isfile N/A N/A N/A os path join N/A self _path f N/A files N/A directories N/A N/A self full_path N/A False N/A N/A 
        Return a list of directories that are in the workspace.

        Args:
          full_path(bool): Returns list of directories with full path names when True. Defaults to False.

        Returns:
          list: A list of directories in the workspace.

        **Examples:**

        ::

            # List directory names
            workspace.directories()

            # List full path directory names
            workspace.directories(full_path=True)

         N/A full_path N/A N/A directories N/A N/A N/A N/A os path join N/A self _path d N/A d N/A N/A os listdir N/A self _path N/A N/A N/A os path isdir N/A N/A N/A os path join N/A self _path d N/A N/A directories N/A d N/A d N/A N/A os listdir N/A self _path N/A N/A N/A os path isdir N/A N/A N/A os path join N/A self _path d N/A directories N/A clear N/A N/A self exclude exclude_files exclude_directories N/A N/A False False N/A N/A 
        Remove all files and directories in the workspace.

        Args:
          exclude(iterable): A list or tuple of file and directory names to exclude from clearing operation.
          exclude_files(bool): Excludes all files from clearing operation when True. Defaults to False.
          exclude_directories(bool): Excludes all directories from clearing operation when True. Defaults to False.

        **Examples:**

        ::

            # Clear everything
            workspace.clear()

            # Clear directories only
            workspace.clear(exclude_files=True)

            # Clear files only
            workspace.clear(exclude_directories=True)

            # Clear all but specified files and directories
            workspace.clear(exclude=['file1.txt', '/full/path/to/directory1', 'directory2', '/full/path/to/file2.txt'])

         N/A files N/A f N/A f N/A N/A os listdir N/A self _path N/A N/A N/A os path isfile N/A N/A N/A os path join N/A self _path f N/A directories N/A d N/A d N/A N/A os listdir N/A self _path N/A N/A N/A os path isdir N/A N/A N/A os path join N/A self _path d N/A N/A exclude_files N/A N/A file files N/A N/A fullpath N/A N/A N/A os path join N/A self _path file N/A N/A N/A file exclude N/A fullpath exclude N/A N/A N/A N/A os remove fullpath N/A N/A exclude_directories N/A N/A directory directories N/A N/A fullpath N/A N/A N/A os path join N/A self _path directory N/A N/A N/A directory exclude N/A fullpath exclude N/A N/A N/A N/A shutil rmtree fullpath N/A remove N/A N/A self item N/A N/A N/A 
        Remove a file or directory from the workspace.

        Args:
          item(str): Name of the item to remove from the workspace.

        **Examples:**

        ::

            workspace.remove('file.txt')
            workspace.remove('/full/path/to/file.txt')
            workspace.remove('relative/path/to/file.txt')
            workspace.remove('directory')
            workspace.remove('/full/path/to/directory')
            workspace.remove('relative/path/to/directory')

        **Note:** Though you can specify relative paths, the ``remove()`` method will not allow you to back into other directories using "../" or similar notation. Futhermore, absolute paths given must contain the path of the workspace to be valid.

         N/A full_path N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A item replace ../ replace ./ replace ..\ replace .\ replace ~/ replace ~\ N/A N/A N/A self _path full_path N/A N/A full_path N/A N/A N/A os path join N/A self _path full_path N/A N/A N/A N/A os path isdir full_path N/A N/A N/A N/A shutil rmtree full_path N/A N/A N/A N/A N/A os path isfile full_path N/A N/A N/A N/A os remove full_path N/A N/A