Class RegularFile
source code
object --+
|
_File --+
|
RegularFile
NAME
====
B{C{RegularFile}} - Define a regular file filestream helper.
SYNOPSIS
========
C{RegularFile([I{contents}, I{requires}, I{provides}, I{flavor}, I{mode}, I{owner}, I{group}, I{config}, I{initialContents}, I{transient}, I{tags}])}
DESCRIPTION
===========
The C{RegularFile} class defines a regular file filestream helper. This
class takes I{contents} as an optional argument.
PARAMETERS
==========
The following parameters apply to the RegularFile class.
B{contents}: (None) defines the contents of the file. This parameter can
be a string or a file-like object.
B{requires}: (None) Marks this file with the specified requirements.
This parameter is a deps.Dependency object.
B{provides}: (None) Marks files as providing certain features or
characteristics. This parameter is a deps.Dependency object.
B{flavor}: (None) Marks this file with the specified flavor. File
flavors are aggregated to determine trove flavors. This parameter
is a deps.Flavor object.
B{owner}: ('root') Marks this file as owned by I{owner}. This parameter
is a string
B{group}: ('root') Marks this file as belonging to I{group}. This
parameter is a string
B{mode}: (0644) Defines the access permissons of the file. This
parameter is an integer.
B{config}: (False) Marks this file as a config file. This is the same
behavior as the Config Policy. A file marked as a config file cannot
also be marked as a transient file or an initialContents file. Conary
enforces this requirement.
B{initialContents}: (False) Marks this file as a initialContents file.
B{transient}: (False) Marks this file as a transient file.
B{tags} : (None) Tags associated with this File. When a file with a
tag is installed, removed, or changed, the listed tag handler is executed.
See documentation on tag handlers for more information. This parameter
is a list of strings.
USER COMMANDS
=============
The following user commands are applicable to C{RegularFile}:
- L{get(I{pathId})} : Returns a filestream with the settings
represented by this class.
- L{getContents() : Returns a seekable file object reflecting the
contents associated with this filestream.
EXAMPLES
========
C{fileObj = RegularFile(contents = 'foo')}
C{fileObj.get()}
Creates a filestream helper with contents "foo", and retrieves the
filestream associated with it.
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from _File:
get
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
|
|
|
needSha1 = True
|
|
|
kwargs = {'config': False, 'contents': '', 'flavor': None, 'gr...
|
|
Inherited from _File:
aliasedArgs
|
|
Inherited from object:
__class__
|
kwargs
- Value:
{'config': False,
'contents': '',
'flavor': None,
'group': 'root',
'initialContents': False,
'linkGroup': None,
'mtime': None,
'owner': 'root',
...
|
|