Web · Wiki · Activities · Blog · Lists · Chat · Meeting · Bugs · Git · Translate · Archive · People · Donate
1
# -*- coding: utf-8 -*-
2
# Copyright (C) 2012, Sebastian Silva 
3
#
4
# This program is free software: you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation, either version 3 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17
from sugar_network import Client
18
19
client = Client('/')
20
offline_client = Client('~')
21
22
Contexts = client.Context.cursor(
23
    reply=['guid', 'type', 'title', 'author', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime')
24
Activities = client.Context.cursor(type='activity',
25
    reply=['guid', 'type', 'title', 'author', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime')
26
Projects = client.Context.cursor(type='project',
27
    reply=['guid', 'type', 'title', 'author', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime')
28
autocomplete_Contexts = client.Context.cursor(
29
    reply=['guid', 'title'], order_by='-mtime')
30
Questions = client.Feedback.cursor(type="question",
31
    reply=['guid', 'type', 'title', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime')
32
Problems = client.Problem.cursor(type="problem",
33
    reply=['guid', 'type', 'title', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime')
34
Ideas = client.Idea.cursor(type="idea",
35
    reply=['guid', 'type', 'title', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime')
36
Solutions = client.Solution.cursor(
37
    reply=['guid', 'content', 'parent', 'author', 'user', 'tags', 'mtime'], order_by='-mtime')
38
Comments = client.Comment.cursor(
39
    reply=['guid', 'message', 'tags', 'author', 'user' ,'parent', 'parent_resource', 'mtime'])
40
Reviews = client.Review.cursor(type="review",
41
    reply=['guid', 'type', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime')
42
Resources = client.Feedback.cursor(
43
    reply=['guid', 'type', 'title', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime')
44
45
offline_Contexts = offline_client.Context.cursor(keep_impl=2,
46
    reply=['guid', 'type', 'title', 'author', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime')
47
autocomplete_offline_Contexts = offline_client.Context.cursor(keep_impl=2,
48
    reply=['guid', 'title'], order_by='-mtime')
49
offline_Projects = offline_client.Context.cursor(type='project', keep_impl=2,
50
    reply=['guid', 'type', 'title', 'author', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime')
51
offline_Activities = offline_client.Context.cursor(type='activity', keep_impl=2,
52
    reply=['guid', 'type', 'title', 'author', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime')
53
54
class Custom_Mount:
55
    def __init__(self, mountpoint):
56
        self.client = Client(mountpoint)
57
58
        self.Contexts = self.client.Context.cursor(
59
            reply=['guid', 'type', 'title', 'author', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime')
60
        self.autocomplete_Contexts = self.client.Context.cursor(
61
            reply=['guid', 'title'], order_by='-mtime')
62
        self.Projects = self.client.Context.cursor(type='project',
63
            reply=['guid', 'type', 'title', 'author', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime')
64
        self.Activities = self.client.Context.cursor(type='activity',
65
        reply=['guid', 'type', 'title', 'author', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime')