-
Notifications
You must be signed in to change notification settings - Fork 141
api specification
nvbn edited this page Mar 3, 2013
·
2 revisions
Api version 1
- Provider -- "com.everpad.Provider", '/EverpadProvider'
-
Pad -- "com.everpad.App", "/EverpadService"
In everyday use please use
everpad.tools.get_provider
andeverpad.tools.get_pad
.
For basetypes please use classes from everpad.basetypes
, for creating new basetype inherit DbusSendable
and fill fields
with tuple of pairs (name, signature)
.
class DbusSendable(object):
@classmethod
def from_obj(cls, data):
...
@classmethod
def from_tuple(cls, data):
...
@property
def struct(self):
...
def give_to_obj(self, obj):
...
class Note(DbusSendable):
ORDER_TITLE = 0
ORDER_UPDATED = 1
ORDER_TITLE_DESC = 2
ORDER_UPDATED_DESC = 3
fields = (
('id', 'i'),
('title', 's'),
('content', 's'),
('created', 'x'),
('updated', 'x'),
('notebook', 'i'),
('tags', 'as'),
('place', 's'),
('pinnded', 'b'),
)
class Notebook(DbusSendable):
fields = (
('id', 'i'),
('name', 's'),
('default', 'i'),
)
class Tag(DbusSendable):
fields = (
('id', 'i'),
('name', 's'),
)
class Resource(DbusSendable):
fields = (
('id', 'i'),
('file_name', 's'),
('file_path', 's'),
('mime', 's'),
('hash', 's'),
)
class Place(DbusSendable):
fields = (
('id', 'i'),
('name', 's'),
)
###Provider
-
get_note(id) -> Note
in:i
out:Note.signature
-
find_notes(words, notebooks, tags, place, limit=100, order=Note.ORDER_UPDATED, pinnded=-1) -> Note[]
in:saiaiiiii
out:a+Note.signature
-
list_notebooks() -> Notebook[]
out:a+Notebook.signature
-
get_notebook(id) -> Notebook
in:i
out:Notebook.signature
-
get_notebook_notes_count(id) -> int
in:i
out:i
-
update_notebook(notebook_struct:Notebook) -> Notebook
in:Notebook.signature
out:Notebook.signature
-
delete_notebook(id) -> bool
in:i
out:b
-
list_tags() -> Tag[]
out:a+Tag.signature
-
create_note(data:Note) -> Note
in:Note.signature
out:Note.signature
-
update_note(note:Note) -> Note
in:Note.signature
out:Note.signature
-
update_note_resources(note:Note, resources:Resource[]) -> bool
in:Note.signature+a+Resource.signature
out:b
-
delete_note(id) -> bool
in:i
out:b
-
create_notebook(name) -> Notebook
in:s
out:Notebook.signature
-
authenticate(token)
in:s
remove_authentication()
-
get_note_resources(note_id) -> Resource[]
in:i
out:a+Resource.signature
-
list_places() -> Place[]
out:a+Place.signature
-
get_status() -> int
out:i
-
get_last_sync() -> str
out:s
sync()
-
set_sync_delay(delay)
in:i
-
get_sync_delay() -> int
out:i
-
is_first_synced() -> bool
out:b
-
get_api_version() -> int
out:i
kill()
###Pad
-
open(id)
in:i
-
open_with_search_term(id, search_term)
in:is
create()
-
create_wit_attach(name)
in:s
settings()
kill()
##Signals ###Provider
-
sync_state_changed(state)
signature:i
data_changed()