Module Text :: Class Text
[frames | no frames]

Class Text


The Text object

This object gives access to Texts in Blender.
Method Summary
list of strings asLines()
Retrieve the contents of this Text buffer as a list of strings.
  clear()
Clear this Text object: its buffer becomes empty.
string getFilename()
Get the filename of the file loaded into this Text object.
string getName()
Get the name of this Text object.
int getNLines()
Get the number of lines in this Text buffer.
  set(attribute, value)
Set this Text's attributes.
  setName(name)
Set the name of this Text object.
  write(data)
Append a string to this Text buffer.

Instance Variable Summary
bool fakeUser: When set to True, this datablock wont be removed, even if nothing is using it.
  filename: The filename of the file loaded into this Text.
string or None lib: path to the blend file this datablock is stored in (readonly).
  mode: The follow_mode flag: if 1 it is 'on'; if 0, 'off'.
string name: unique name within each blend file.
  nlines: The number of lines in this Text.
IDGroup properties: Returns an IDGroup reference to this datablocks's ID Properties.
bool tag: A temporary tag that to flag data as being used within a loop.
int users: The number of users this datablock has.

Method Details

asLines()

Retrieve the contents of this Text buffer as a list of strings.
Returns:
A list of strings, one for each line in the buffer
           (type=list of strings)

clear()

Clear this Text object: its buffer becomes empty.

getFilename()

Get the filename of the file loaded into this Text object.
Returns:
string

getName()

Get the name of this Text object.
Returns:
string

getNLines()

Get the number of lines in this Text buffer.
Returns:
int

set(attribute, value)

Set this Text's attributes.
Parameters:
attribute - The attribute to change: currently, 'follow_cursor' is the only one available. It can be turned 'on' with value = 1 and 'off' with value = 0.
           (type=string)
value - The new attribute value.
           (type=int)

setName(name)

Set the name of this Text object.
Parameters:
name - The new name.
           (type=string)

write(data)

Append a string to this Text buffer.
Parameters:
data - The string to append to the text buffer.
           (type=string)

Instance Variable Details

fakeUser

When set to True, this datablock wont be removed, even if nothing is using it. All data has this disabled by default except for Actions.
Type:
bool

filename

The filename of the file loaded into this Text.

lib

path to the blend file this datablock is stored in (readonly).

lib will be None unless you are using external blend files with (File, Append/Link)

Note: the path may be relative, to get the full path use Blender.sys.expandpath
Type:
string or None

mode

The follow_mode flag: if 1 it is 'on'; if 0, 'off'.

name

unique name within each blend file.

The name is case sensitive and 21 characters maximum length.

Note: a blend file may have naming collisions when external library data is used, be sure to check the value of lib.

Note: Setting a value longer then 21 characters will be shortened
Type:
string

nlines

The number of lines in this Text.

properties

Returns an IDGroup reference to this datablocks's ID Properties.
Type:
IDGroup

tag

A temporary tag that to flag data as being used within a loop. always set all tags to True or False before using since blender uses this flag for its own internal operations.
Type:
bool

users

The number of users this datablock has. (readonly) Zero user datablocks are de-allocated after reloading and saving.
Type:
int

Generated by Epydoc 2.1 on Thu May 10 20:31:59 2007 http://epydoc.sf.net