Package application :: Module Utility
[hide private]
[frames] | no frames]

Module Utility

source code

Application utilities.

Classes [hide private]
  ChandlerRotatingFileHandler
  CertificateVerificationError
An error that will be raised when, as part of an SSL/TLS connection attempt, the X.509 certificate returned by the peer does not verify.
  SchemaMismatchError
The schema version in the repository doesn't match the application.
Functions [hide private]
 
createProfileDir(profileDir)
Create the profile directory with the right permissions.
source code
 
locateProfileDir()
Locate the Chandler repository.
source code
 
getDesktopDir()
Return a reasonable guess at the desktop folder.
source code
 
getPlatformID()
Return an identifier string that represents what platform Chandler is being run on.
source code
 
getPlatformName()
Return a plain text string that represents what platform Chandler is being run on.
source code
 
getUserAgent()
Construct a rfc spec'd UserAgent string from the platform and version information
source code
 
initDefaults(**kwds)
Return a default command line options object from COMMAND_LINE_OPTIONS dict, optional env vars and optional kwd args
source code
 
varArgsCallback(option, opt, value, parser, default) source code
 
initOptions(**kwds)
Load and parse the command line options, with overrides in **kwds.
source code
 
initProfileDir(options)
Ensure we have the profile directory.
source code
 
loadPrefs(options)
Load the chandler.prefs file as a ConfigObj, in profileDir by default.
source code
 
initI18n(options) source code
 
initLogging(options) source code
 
getLoggingLevel() source code
 
setLoggingLevel(level) source code
 
locateChandlerDirectory()
Find the directory that Chandler lives in by looking up the file that the application module lives in.
source code
 
locateRepositoryDirectory(profileDir, options) source code
 
initRepository(directory, options, allowSchemaView=True) source code
 
stopRepository(view, commit=True) source code
 
verifySchema(view) source code
 
initParcelEnv(options, chandlerDirectory)
PARCEL_IMPORT defines the import directory containing parcels relative to chandlerDirectory where os separators are replaced with "." just as in the syntax of the import statement.
source code
 
initPluginEnv(options, path) source code
 
initParcels(options, view, path, namespaces=<Locale: en_US>) source code
 
initPlugins(options, view, plugin_env, eggs) source code
 
initTimezone(options, view) source code
 
_randpoolPath(profileDir) source code
 
initCrypto(profileDir)
Initialize the cryptographic services before doing any other cryptographic operations.
source code
 
stopCrypto(profileDir)
Shut down the cryptographic services.
source code
 
initTwisted(view, options=<Locale: en_US>) source code
 
stopTwisted() source code
 
initWakeup(view) source code
 
stopWakeup() source code
Variables [hide private]
  SCHEMA_VERSION = '456'
  logger = <Locale: en_US>
  COMMAND_LINE_OPTIONS = {'appParcel': ('-a', '--app-parcel', 's...
Function Details [hide private]

createProfileDir(profileDir)

source code 

Create the profile directory with the right permissions.

Will raise exception if the directory cannot be created.

locateProfileDir()

source code 
Locate the Chandler repository. The location is determined either by parameters, or if not specified, by the presence of a .chandler directory in the users home directory.

getDesktopDir()

source code 

Return a reasonable guess at the desktop folder.

On Mac, returns '~/Desktop'; on Linux, it'll return '~/Desktop' if it exists, or just '~' if not.

initOptions(**kwds)

source code 
Load and parse the command line options, with overrides in **kwds. Returns options

loadPrefs(options)

source code 
Load the chandler.prefs file as a ConfigObj, in profileDir by default. If prefs file doesn't exist, an ConfigObj is returned.

initCrypto(profileDir)

source code 
Initialize the cryptographic services before doing any other cryptographic operations.
Parameters:
  • profileDir - The profile directory. Additional entropy will be loaded from a file in this directory. It is not a fatal error if the file does not exist.
Returns:
The number of bytes read from file.

stopCrypto(profileDir)

source code 
Shut down the cryptographic services. You must call startup() before doing cryptographic operations again.
Parameters:
  • profileDir - The profile directory. A snapshot of current entropy state will be saved into a file in this directory. It is not a fatal error if the file cannot be created.
Returns:
The number of bytes saved to file.

Variables Details [hide private]

COMMAND_LINE_OPTIONS

Value:
{'appParcel': ('-a',
               '--app-parcel',
               's',
               'osaf.app',
               None,
               'Parcel that defines the core application'),
 'ask': ('',
         '--ask',
...