~ubuntu-branches/ubuntu/precise/desktopcouch/precise

« back to all changes in this revision

Viewing changes to desktopcouch/application/replication_services/example.py

  • Committer: Bazaar Package Importer
  • Author(s): Chad MILLER
  • Date: 2011-01-12 15:08:25 UTC
  • mfrom: (1.5.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110112150825-bzvn23kzufr0qdyb
Tags: 1.0.5-0ubuntu1
* New upstream release, skipping a few buggy releases.
* Split code into binary packages:
  - desktopcouch, configuration files and dependencies, but no code.
  - python-desktopcouch: transitional package
  - python-desktopcouch-application: local DB startup and discovery
  - python-desktopcouch-records: library for DB access anywhere
  - python-desktopcouch-recordtypes: support specific data structures
  - desktopcouch-ubuntuone, replication and pairing with cloud service
* Drop patch that some maverick apps incorrectly needed.
  patches/0-items-should-expose-private-data-for-now.patch
* Update package compatibility-version, 6 -> 7.
* Use newer debhelper and use python-support instead of python-central.
* Depend on contemporary python-couchdb, instead of ancient version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""An example replication service."""
 
2
 
 
3
# Note that the __init__.py of this package must import this module for it to
 
4
# be found.  Plugin logic is not pretty, and not implemented yet.
 
5
 
 
6
# pylint: disable=C0103
 
7
 
 
8
# FIXME all of the constants should be capitalized, but that needs to
 
9
# be fixed in importing code as well
 
10
 
 
11
# Required
 
12
NAME = "Example"
 
13
# Required; should include the words "cloud service" on the end.
 
14
DESCRIPTION = "Example cloud service"
 
15
 
 
16
 
 
17
# Required
 
18
def is_active():
 
19
    """Can we deliver information?"""
 
20
    return False
 
21
 
 
22
 
 
23
# Required
 
24
def oauth_data():
 
25
    """OAuth information needed to replicate to a server.  This may be
 
26
    called from a subthread, so be sure not to violate any execution
 
27
    idioms, like updating the GUI from a non-main thread."""
 
28
    return dict(consumer_key="", consumer_secret="", oauth_token="",
 
29
            oauth_token_secret="")
 
30
    # In case of failure return None
 
31
 
 
32
 
 
33
# Access to this as a string fires off functions.
 
34
# Required
 
35
db_name_prefix = "http://host.required.example.com/a_prefix_if_necessary"
 
36
# You can be sure that access to this will always, always be through its
 
37
# __str__ method.