Пример #1
0
    def __init__(self, parsed_url):
        backend.Backend.__init__(self, parsed_url)

        global pexpect
        try:
            import pexpect
        except ImportError:
            raise

        self.parsed_url = parsed_url
        try:
            self.redundancy = globals.par2_redundancy
        except AttributeError:
            self.redundancy = 10

        try:
            self.common_options = globals.par2_options + " -q -q"
        except AttributeError:
            self.common_options = "-q -q"

        self.wrapped_backend = backend.get_backend_object(parsed_url.url_string)

        for attr in ['_get', '_put', '_list', '_delete', '_delete_list',
                     '_query', '_query_list', '_retry_cleanup', '_error_code',
                     '_move', '_close']:
            if hasattr(self.wrapped_backend, attr):
                setattr(self, attr, getattr(self, attr[1:]))

        # always declare _delete_list support because _delete queries file
        # list for every call
        self._delete_list = self.delete_list
Пример #2
0
    def __init__(self, parsed_url):
        backend.Backend.__init__(self, parsed_url)

        global pexpect
        try:
            import pexpect
        except ImportError:
            raise

        self.parsed_url = parsed_url
        try:
            self.redundancy = globals.par2_redundancy
        except AttributeError:
            self.redundancy = 10

        try:
            self.common_options = globals.par2_options + u" -q -q"
        except AttributeError:
            self.common_options = u"-q -q"

        self.wrapped_backend = backend.get_backend_object(
            parsed_url.url_string)

        for attr in [
                u'_get', u'_put', u'_list', u'_delete', u'_delete_list',
                u'_query', u'_query_list', u'_retry_cleanup', u'_error_code',
                u'_move', u'_close'
        ]:
            if hasattr(self.wrapped_backend, attr):
                setattr(self, attr, getattr(self, attr[1:]))

        # always declare _delete_list support because _delete queries file
        # list for every call
        self._delete_list = self.delete_list
Пример #3
0
    def __init__(self, parsed_url):
        backend.Backend.__init__(self, parsed_url)
        self.parsed_url = parsed_url
        try:
            self.redundancy = globals.par2_redundancy
        except AttributeError:
            self.redundancy = 10

        try:
            self.common_options = globals.par2_options + "-q -q"
        except AttributeError:
            self.common_options = "-q -q"

        self.wrapped_backend = backend.get_backend_object(parsed_url.url_string)

        for attr in ['_get', '_put', '_list', '_delete', '_delete_list',
                     '_query', '_query_list', '_retry_cleanup', '_error_code',
                     '_move', '_close']:
            if hasattr(self.wrapped_backend, attr):
                setattr(self, attr, getattr(self, attr[1:]))
Пример #4
0
    def __init__(self, parsed_url):
        backend.Backend.__init__(self, parsed_url)
        self.parsed_url = parsed_url
        try:
            self.redundancy = globals.par2_redundancy
        except AttributeError:
            self.redundancy = 10

        try:
            self.common_options = globals.par2_options + "-q -q"
        except AttributeError:
            self.common_options = "-q -q"

        self.wrapped_backend = backend.get_backend_object(
            parsed_url.url_string)

        for attr in [
                '_get', '_put', '_list', '_delete', '_delete_list', '_query',
                '_query_list', '_retry_cleanup', '_error_code', '_move',
                '_close'
        ]:
            if hasattr(self.wrapped_backend, attr):
                setattr(self, attr, getattr(self, attr[1:]))