Esempio n. 1
0
    def __init__(self, home_volume):
        self.opened = coroutine.Event()
        self._subscriptions = {}
        self._lang = ad.default_lang()
        self._jobs = coroutine.Pool()
        self._servers = coroutine.Pool()

        dict.__init__(self)
        ad.CommandsProcessor.__init__(self)
        SyncCommands.__init__(self, client.path('sync'))
        Commands.__init__(self)
        journal.Commands.__init__(self)
        self.volume = home_volume
Esempio n. 2
0
    def __init__(self, contexts):
        Inotify.__init__(self)

        self._contexts = contexts
        self._roots = []
        self._jobs = coroutine.Pool()

        xdg_data_home = os.environ.get('XDG_DATA_HOME') or \
                join(os.environ['HOME'], '.local', 'share')
        self._icons_dir = join(xdg_data_home,
                'icons', 'sugar', 'scalable', 'mimetypes')
        self._mime_dir = join(xdg_data_home, 'mime')
Esempio n. 3
0
    def __init__(self, home_volume, listen_events=True):
        ad.CommandsProcessor.__init__(self)
        _Mount.__init__(self)
        _ProxyCommands.__init__(self, home_volume)

        self._listen_events = listen_events
        self._client = None
        self._remote_volume_guid = None
        self._url = None
        self._api_urls = []
        if client.api_url.value:
            self._api_urls.append(client.api_url.value)
        self._connections = coroutine.Pool()
Esempio n. 4
0
    def __init__(self, sequences_path):
        self._sync = coroutine.Pool()
        self._sync_mounts = MutableStack()
        self._file_syncs = \
                files_sync.Leechers(node.sync_dirs.value, sequences_path)
        self._sync_session = None
        self._push_seq = PersistentSequence(join(sequences_path, 'push'),
                                            [1, None])
        self._pull_seq = PersistentSequence(join(sequences_path, 'pull'),
                                            [1, None])
        self._sync_script = join(dirname(sys.argv[0]), 'sugar-network-sync')
        self._mount = None

        mountpoints.connect(_SYNC_DIRNAME, self.__found_mountcb,
                            self.__lost_mount_cb)
Esempio n. 5
0
 def __init__(self, root, document_classes=None, lazy_open=False):
     if document_classes is None:
         document_classes = Volume.RESOURCES
     self._downloader = None
     self._populators = coroutine.Pool()
     ad.SingleVolume.__init__(self, root, document_classes, lazy_open)