From dc458265e3562ea68bc6ca3cf8ddb71efe1576ef Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 29 Jun 2006 06:04:21 +0000 Subject: There are a few BPy functions that are documented to return a list but actually return tuples. Blender.sys.splitext() raises an error if the path is longer then 80 chars. seems a bit short, noted this anyhow end added an example. (hope its okay to do small doc corrections as I notice them.) --- source/blender/python/api2_2x/doc/Sys.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/python/api2_2x/doc/Sys.py b/source/blender/python/api2_2x/doc/Sys.py index 8d9ecf0eb46..f1efeeb2344 100644 --- a/source/blender/python/api2_2x/doc/Sys.py +++ b/source/blender/python/api2_2x/doc/Sys.py @@ -75,11 +75,20 @@ def join (dir, file): def splitext (path): """ - Split 'path' into (root, ext), where 'ext' is a file extension. + Split 'path' into (root, ext), where 'ext' is a file extension including the full stop. + + Example:: + + import Blender + file, ext= Blender.sys.splitext('/tmp/foobar.blend') + print file, ext + # ('/tmp/foobar', '.blend') + @type path: string @param path: a path name - @rtype: list with two strings + @rtype: tuple of two strings @return: (root, ext) + @note: This function will raise an error if the path is longer then 80 characters. """ def makename (path = "Blender.Get('filename')", ext = "", strip = 0): -- cgit v1.2.3