Logo Search packages:      
Sourcecode: magicicada version File versions  Download package

def magicicada::dbusiface::DBusInterface::_parse_mq (   self,
  data 
) [private]

Parse MetaQueue string to extract its data.

Definition at line 217 of file dbusiface.py.

00217                              :
        """Parse MetaQueue string to extract its data."""
        if data in ('AccountInquiry', 'FreeSpaceInquiry', 'GetPublicFiles',
                    'ListShares', 'ListVolumes', 'Query'):
            return QueueData(operation=data, path=None, node=None, share=None)

        m = RE_OP_LISTDIR.match(data)
        if m:
            op, share, node = m.groups()
            path = '?' # we should get the real path, no API now
            return QueueData(operation=op, path=path, node=node, share=share)

        m = RE_OP_MAKEFILE.match(data)
        if m:
            op, share, parent, name = m.groups()
            path = '/?.../' + name # we should get the real path, no API now
            return QueueData(operation=op, path=path, node=None, share=share)

        m = RE_OP_MAKEDIR.match(data)
        if m:
            op, share, parent, name = m.groups()
            path = '/?.../' + name # we should get the real path, no API now
            return QueueData(operation=op, path=path, node=None, share=share)

        m = RE_OP_UNLINK.match(data)
        if m:
            op, share, node, = m.groups()
            path = '?' # we should get the real path, no API now
            return QueueData(operation=op, path=path, node=node, share=share)

        m = RE_OP_MOVE.match(data)
        if m:
            op, share, node, old_parent, new_parent, new_name, = m.groups()

            # we should get the real info, no API now
            old_path = '/?...'
            old_name = '?'
            new_path = '/?...'
            composed_path = "%s/%s -> %s/%s" % (old_path, old_name,
                                                new_path, new_name)
            return QueueData(operation=op, path=composed_path,
                             node=node, share=share)

        raise ValueError("Not supported MetaQueue data: %r" % data)

    @retryable
    def get_meta_queue(self):


Generated by  Doxygen 1.6.0   Back to index