peek_plugin_base.server package

Submodules

peek_plugin_base.server.PeekPlatformAdminHttpHookABC module

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.

peek_plugin_base.server.PeekPlatformServerHttpHookABC module

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.

peek_plugin_base.server.PeekServerPlatformHookABC module

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.

peek_plugin_base.server.PluginServerEntryHookABC module

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.

peek_plugin_base.server.PluginServerEntryHookInheritenceTest module

class peek_plugin_base.server.PluginServerEntryHookInheritenceTest.MyABC[source]

Bases: object

propA
class peek_plugin_base.server.PluginServerEntryHookInheritenceTest.MyClass[source]

Bases: peek_plugin_base.server.PluginServerEntryHookInheritenceTest.MyABC, peek_plugin_base.server.PluginServerEntryHookInheritenceTest.MyMixin

propA
propB
class peek_plugin_base.server.PluginServerEntryHookInheritenceTest.MyClassNoPropA[source]

Bases: peek_plugin_base.server.PluginServerEntryHookInheritenceTest.MyABC, peek_plugin_base.server.PluginServerEntryHookInheritenceTest.MyMixin

propB
class peek_plugin_base.server.PluginServerEntryHookInheritenceTest.MyClassNoPropB[source]

Bases: peek_plugin_base.server.PluginServerEntryHookInheritenceTest.MyABC, peek_plugin_base.server.PluginServerEntryHookInheritenceTest.MyMixin

propA
class peek_plugin_base.server.PluginServerEntryHookInheritenceTest.MyMixin[source]

Bases: object

propB
class peek_plugin_base.server.PluginServerEntryHookInheritenceTest.PluginServerEntryHookInheritenceTest(methodName='runTest')[source]

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

testIsInstance()[source]
testPropANotImplemeneted()[source]
testPropBNotImplemeneted()[source]

peek_plugin_base.server.PluginServerStorageEntryHookABC module

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.
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

peek_plugin_base.server.PluginServerWorkerEntryHookABC module

class peek_plugin_base.server.PluginServerWorkerEntryHookABC.PluginServerWorkerEntryHookABC[source]

Bases: object

celeryApp

Celery App

This plugin property is called by the platform when the server is initialising the plugin.

The instance of the celery app returned by this property will be configured, allowing tasks linked to it to work with the Peek celerty task queues.

Returns:An instance of C{celery.app.base.Celery}
from peek_plugin_noop.worker.NoopCeleryApp import celeryApp
return celeryApp