Module smbc :: Class Context
[hide private]
[frames] | no frames]

Class Context

object --+
         |
        Context

SMBC context

A context for libsmbclient calls.

Optional parameters are:

auth_fn: a function for collecting authentication details from the user. This is called whenever authentication details are needed. The parameters it will be given are all strings: server, share, workgroup, username, and password (these last two can be ignored). The function should return a tuple of strings: workgroup, username, and password.

debug: an integer representing the debug level to use.

Instance Methods [hide private]
 
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
int
chmod(uri, mode)
Returns: 0 on success, < 0 on error
File
creat(uri)
Returns: a smbc.File object for the URI
int
mkdir(uri, mode)
Returns: 0 on success, < 0 on error
File
open(uri)
Returns: a smbc.File object for the URI
Dir
opendir(uri)
Returns: a smbc.Dir object for the URI
int
rename(ouri, nuri)
Returns: 0 on success, < 0 on error
int
rmdir(uri)
Returns: 0 on success, < 0 on error
tuple
stat(uri)
Returns: stat information
int
unlink(uri)
Returns: 0 on success, < 0 on error

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  debug
Debug level.
  functionAuthData
Function for obtaining authentication data.
  netbiosName
Netbios name used for making connections.
  optionDebugToStderr
Whether to log to standard error instead of standard output.
  optionFallbackAfterKerberos
Whether to fallback after Kerberos.
  optionNoAutoAnonymousLogin
Whether to automatically select anonymous login.
  optionUseKerberos
Whether to enable use of Kerberos.
  timeout
Get the timeout used for waiting on connections and response data(in milliseconds)
  workgroup
Workgroup used for making connections.

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

chmod(uri, mode)

 
Parameters:
  • uri (string) - URI to chmod
  • mode (int) - permissions to set
Returns: int
0 on success, < 0 on error

creat(uri)

 
Parameters:
  • uri (string) - URI to creat
Returns: File
a smbc.File object for the URI

mkdir(uri, mode)

 
Parameters:
  • uri (string) - URI to mkdir
  • mode - Specifies the permissions to use.
Returns: int
0 on success, < 0 on error

open(uri)

 
Parameters:
  • uri (string) - URI to open
Returns: File
a smbc.File object for the URI

opendir(uri)

 
Parameters:
  • uri (string) - URI to opendir
Returns: Dir
a smbc.Dir object for the URI

rename(ouri, nuri)

 
Parameters:
  • ouri (string) - The original smb uri
  • nuri (string) - The new smb uri
Returns: int
0 on success, < 0 on error

rmdir(uri)

 
Parameters:
  • uri (string) - URI to rmdir
Returns: int
0 on success, < 0 on error

stat(uri)

 
Parameters:
  • uri (string) - URI to get stat information
Returns: tuple
stat information

unlink(uri)

 
Parameters:
  • uri (string) - URI to unlink
Returns: int
0 on success, < 0 on error