1
# -*- coding: utf-8 -*-
3
# Licensed under the MIT license
4
# http://opensource.org/licenses/mit-license.php
6
# Copyright 2007, Frank Scholz <coherence@beebits.net>
8
from coherence.extern.simple_plugin import Plugin
10
from coherence import log
13
class BackendItem(log.Loggable):
15
""" the base class for all backend store items
18
logCategory = 'backend_item'
21
class BackendStore(log.Loggable,Plugin):
23
""" the base class for all backend store items
26
logCategory = 'backend_store'
27
wmc_mapping = {'4':'4', '5':'5', '6':'6','7':'7','14':'14','F':'F',
28
'11':'11','16':'16','B':'B','C':'C','D':'D',
30
'8':'8', '9':'9', '10':'10', '15':'15', 'A':'A', 'E':'E'}
33
self.wmc_mapping.update({'4':lambda: self._get_all_items(0),
34
'8':lambda: self._get_all_items(0),
35
'B':lambda: self._get_all_items(0),
38
def _get_all_items(self,id):
40
item = self.get_by_id(id)
43
while len(containers)>0:
44
container = containers.pop()
45
if container.mimetype not in ['root', 'directory']:
47
for child in container.get_children(0,0):
48
if child.mimetype in ['root', 'directory']:
49
containers.append(child)
b'\\ No newline at end of file'