(P) server

(M) PeekPlatformAdminHttpHookABC

class peek_plugin_base.server.PeekPlatformAdminHttpHookABC.PeekPlatformAdminHttpHookABC[source]

Bases: object

Peek Platform Site HTTP Hook

The methods provided by this class apply to the HTTP sites served by the Client service for the mobile and desktop apps, and the Server service for the admin app.

It is not the HTTP service that provides resources (vortex, etc) beween the server and the agent, worker and client.

addAdminResource(pluginSubPath: bytes, resource: txhttputil.site.BasicResource.BasicResource) → None[source]

Add Site Resource

Add a cusotom implementation of a served http resource.

Parameters:
  • pluginSubPath – The resource path where you want to serve this resource.
  • resource – The resource to serve.
Returns:

None

addAdminStaticResourceDir(dir: str) → None[source]

Add Site Static Resource Directory

Calling this method sets up directory dir to be served by the site.

Parameters:dir – The file system directory to be served.
Returns:None
rootAdminResource

Site Root Resource

This returns the root site resource for this plugin.

(M) PeekPlatformServerHttpHookABC

class peek_plugin_base.server.PeekPlatformServerHttpHookABC.PeekPlatformServerHttpHookABC[source]

Bases: object

Peek Platform Server HTTP Hook

The methods provided by this class apply to the HTTP service that provides resources (vortex, etc) beween the server and the agent, worker and client.

These resources will not be availible to the web apps.

addServerResource(pluginSubPath: bytes, resource: txhttputil.site.BasicResource.BasicResource) → None[source]

Add Server Resource

Add a cusotom implementation of a served http resource.

Parameters:
  • pluginSubPath – The resource path where you want to serve this resource.
  • resource – The resource to serve.
Returns:

None

addServerStaticResourceDir(dir: str) → None[source]

Add Server Static Resource Directory

Calling this method sets up directory dir to be served by the site.

Parameters:dir – The file system directory to be served.
Returns:None
rootServerResource

Server Root Resource

This returns the root site resource for this plugin.

(M) PeekServerPlatformHookABC

class peek_plugin_base.server.PeekServerPlatformHookABC.PeekServerPlatformHookABC[source]

Bases: peek_plugin_base.PeekPlatformCommonHookABC.PeekPlatformCommonHookABC, peek_plugin_base.server.PeekPlatformAdminHttpHookABC.PeekPlatformAdminHttpHookABC, peek_plugin_base.server.PeekPlatformServerHttpHookABC.PeekPlatformServerHttpHookABC, peek_plugin_base.PeekPlatformFileStorageHookABC.PeekPlatformFileStorageHookABC

dbConnectString

DB Connect String

Returns:The SQLAlchemy database engine connection string/url.

(M) PluginServerEntryHookABC

class peek_plugin_base.server.PluginServerEntryHookABC.PluginServerEntryHookABC(pluginName: str, pluginRootDir: str, platform: peek_plugin_base.server.PeekServerPlatformHookABC.PeekServerPlatformHookABC)[source]

Bases: peek_plugin_base.PluginCommonEntryHookABC.PluginCommonEntryHookABC

dbSession

Database Session

Returns:An instance of the sqlalchemy ORM session
migrateStorageSchema(metadata: sqlalchemy.sql.schema.MetaData) → None[source]

Initialise the DB

Parameters:metadata – the SQLAlchemy metadata for this plugins schema
platform
publishedServerApi

Published Server API

:return class that implements the API that can be used by other PLUGINs on this platform.

(M) PluginServerStorageEntryHookABC

class peek_plugin_base.server.PluginServerStorageEntryHookABC.PluginServerStorageEntryHookABC[source]

Bases: object

dbEngine

DB Engine

This is a helper property that can be used by the papp to get easy access to the SQLAlchemy C{Engine}

Returns:The instance of the database engine for this plugin
dbMetadata

DB Metadata

This property returns an instance to the metadata from the ORM Declarative
on which, all the ORM classes have inherited.

This means the metadata knows about all the tables.

NOTE: The plugin must be constructed with a schema matching the plugin package

Returns:The instance of the metadata for this plugin.

Example from peek_plugin_noop.storage.DeclarativeBase.py

metadata = MetaData(schema="noop")
DeclarativeBase = declarative_base(metadata=metadata)
dbSessionCreator

Database Session

This is a helper property that can be used by the papp to get easy access to the SQLAlchemy C{Session}

Returns:An instance of the sqlalchemy ORM session
prefetchDeclarativeIds(Declarative, count) → twisted.internet.defer.Deferred[source]

Get PG Sequence Generator

A PostGreSQL sequence generator returns a chunk of IDs for the given declarative.

Returns:A generator that will provide the IDs
Return type:an iterator, yielding the numbers to assign

(M) PluginServerWorkerEntryHookABC

class peek_plugin_base.server.PluginServerWorkerEntryHookABC.PluginServerWorkerEntryHookABC[source]

Bases: object