Classes | Functions | Variables
rosclean Namespace Reference

Classes

class  CleanupException
 

Functions

def _ask (comment)
 
def _ask_and_call (cmds, cwd=None)
 
def _call (cmds, cwd=None)
 
def _get_check_dirs ()
 
def _get_disk_usage_by_walking_tree (d)
 
def _rosclean_cmd_check (args)
 
def _rosclean_cmd_purge (args)
 
def _sort_file_by_oldest (d)
 
def _usage ()
 
def get_disk_usage (d)
 
def get_human_readable_disk_usage (d)
 
def rosclean_main (argv=None)
 

Variables

string __version__ = '1.7.0'
 

Function Documentation

◆ _ask()

def rosclean._ask (   comment)
private
ask user with provided comment. If user responds with y, return True

:param comment: comment, ``str``
:return: ``True`` if user responds with y

Definition at line 69 of file src/rosclean/__init__.py.

◆ _ask_and_call()

def rosclean._ask_and_call (   cmds,
  cwd = None 
)
private
Pretty print cmds, ask if they should be run, and if so, runs
them using _call().

:param cmds: a list of commands executed one after another, ``list``
:param cwd: (optional) set cwd of command that is executed, ``str``
:returns: ``True`` if cmds were run.

Definition at line 51 of file src/rosclean/__init__.py.

◆ _call()

def rosclean._call (   cmds,
  cwd = None 
)
private
Runs cmds using subprocess.check_call.

:param cmds: a list of commands executed one after another, ``list``
:param cwd: (optional) set cwd of command that is executed, ``str``

Definition at line 84 of file src/rosclean/__init__.py.

◆ _get_check_dirs()

def rosclean._get_check_dirs ( )
private

Definition at line 108 of file src/rosclean/__init__.py.

◆ _get_disk_usage_by_walking_tree()

def rosclean._get_disk_usage_by_walking_tree (   d)
private

Definition at line 123 of file src/rosclean/__init__.py.

◆ _rosclean_cmd_check()

def rosclean._rosclean_cmd_check (   args)
private

Definition at line 116 of file src/rosclean/__init__.py.

◆ _rosclean_cmd_purge()

def rosclean._rosclean_cmd_purge (   args)
private

Definition at line 200 of file src/rosclean/__init__.py.

◆ _sort_file_by_oldest()

def rosclean._sort_file_by_oldest (   d)
private
Get files and directories in specified path sorted by last modified time
:param d: directory path, ```str```
:return:  a list of files and directories sorted by last modified time (old first), ```list```

Definition at line 189 of file src/rosclean/__init__.py.

◆ _usage()

def rosclean._usage ( )
private

Definition at line 98 of file src/rosclean/__init__.py.

◆ get_disk_usage()

def rosclean.get_disk_usage (   d)
Get disk usage in bytes for directory
:param d: directory path, ``str``
:returns: disk usage in bytes (du -b) or (du -A) * 1024, ``int``
:raises: :exc:`CleanupException` If get_disk_usage() cannot be used on this platform

Definition at line 152 of file src/rosclean/__init__.py.

◆ get_human_readable_disk_usage()

def rosclean.get_human_readable_disk_usage (   d)
Get human-readable disk usage for directory

:param d: directory path, ``str`
:returns: human-readable disk usage (du -h), ``str``

Definition at line 132 of file src/rosclean/__init__.py.

◆ rosclean_main()

def rosclean.rosclean_main (   argv = None)

Definition at line 244 of file src/rosclean/__init__.py.

Variable Documentation

◆ __version__

string rosclean.__version__ = '1.7.0'
private

Definition at line 44 of file src/rosclean/__init__.py.



rosclean
Author(s): Ken Conley
autogenerated on Mon Feb 28 2022 23:28:08