diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2004-01-23 22:24:45 +0300 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2004-01-23 22:24:45 +0300 |
commit | 23a3a51e16c72d347f15790ed9e4d7bdc2d4f44a (patch) | |
tree | dd3279b095031344d2bc4bb19eee263d5b1ef6bc /source/blender/python/api2_2x/doc/Sys.py | |
parent | 5aad4bfceb454974e0800bfab08271c8b3baaff3 (diff) |
Blender's debug mode only worked on startup:
- G.f's G_DEBUG flag was being erased in blenkernel/intern/blender.c's
setup_app_data:
G.f= bfd->globalf
// added a line above it to fix this:
if (G.f & G_DEBUG) bfd->globalf |=G_DEBUG;
G.f= bfd->globalf;
BPython:
- debug info now only shown if Blender is started with '-d' option
- added ~/.blender/scripts to modules sys.path
- added two new functions to Blender.sys: basename and splitext
- added doc for Blender.sys, updated other docs
Diffstat (limited to 'source/blender/python/api2_2x/doc/Sys.py')
-rw-r--r-- | source/blender/python/api2_2x/doc/Sys.py | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/doc/Sys.py b/source/blender/python/api2_2x/doc/Sys.py new file mode 100644 index 00000000000..e212784d33c --- /dev/null +++ b/source/blender/python/api2_2x/doc/Sys.py @@ -0,0 +1,65 @@ +# Blender.sys module + +""" +The Blender.sys submodule. + +sys +=== + +This module provides a minimal set of helper functions and data. Its purpose +is to avoid the need for the standard Python module 'os', in special 'os.path', +though it is only meant for the simplest cases. + +Example:: + + import Blender + + filename = "" + def f(name): # file selector callback + global filename + filename = name + + Blender.Window.FileSelector(f) + + if filename: + print 'basename:', Blender.sys.basename(filename) + print 'dirname:', Blender.sys.dirname(filename) + print 'splitext:', Blender.sys.splitext(filename) + +@type sep: char +@var sep: the platform-specific dir separator for this Blender: '/' + everywhere, except on Win systems, that use '\\'. +@type dirsep: char +@var dirsep: same as L{sep}. +@type progname: string +@var progname: the Blender executable (argv[0]). + +@attention: The module is called sys, not Sys. +""" + +def basename (path): + """ + Get the base name (filename stripped from dir info) of 'path'. + @type path: string + @param path: a path name + @rtype: string + @return: the base name + """ + +def dirname (path): + """ + Get the dir name (dir path stripped from filename) of 'path'. + @type path: string + @param path: a path name + @rtype: string + @return: the dir name + """ + +def splitext (path): + """ + Split 'path' into (root, ext), where 'ext' is a file extension. + @type path: string + @param path: a path name + @rtype: list with two strings + @return: (root, ext) + """ |