gsdview.utils

Utility classes and functions

Functions

addquotes(string_) Add double quotes at the begin and end of the input string if not present.
buildpyexec(toolname[, extrapath, extraenv]) Build the full command line for launching a python script
default_maxcachesize()
default_workdir()
frozen()
gsdview_prerun()
isexecutable(cmd) Check if “cmd” actually is an executable program.
isscript(filename) Check if a file is a script
locateresource(resource, modfile) Return path of a resource used by modfile
restore_settings()
size(path) Return the directory size in bytes
which(cmd[, env, func]) Return the full path of the program (cmd) or None.
gsdview.utils.addquotes(string_)
Add double quotes at the begin and end of the input string if not present. If double quotes are present only at the begin or end input string is returned with a warning message.
gsdview.utils.buildpyexec(toolname, extrapath=None, extraenv=None)

Build the full command line for launching a python script

Parameters :
  • toolname
  • extrapath: directory added by user
  • extraenv: environment variables added by user
gsdview.utils.default_maxcachesize()
gsdview.utils.default_workdir()
gsdview.utils.frozen()
gsdview.utils.gsdview_prerun()
gsdview.utils.isexecutable(cmd)
Check if “cmd” actually is an executable program.
gsdview.utils.isscript(filename)
Check if a file is a script
gsdview.utils.locateresource(resource, modfile)

Return path of a resource used by modfile

Parameters :
  • resource: name of resource, preceded by a folder name if it isn’t located in the same path of modfile (ex. ui/layout.ui)
  • modfile: file which uses resource
gsdview.utils.restore_settings()
gsdview.utils.size(path)
Return the directory size in bytes
gsdview.utils.which(cmd, env=None, func=<function isexecutable at 0x34c9410>)

Return the full path of the program (cmd) or None.

>>> which('ls')
'/bin/ls'

Previous topic

gsdview.mainwin

Next topic

gsdview.widgets

This Page