File: zone.py

package info (click to toggle)
python-irodsclient 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,352 kB
  • sloc: python: 16,650; xml: 525; sh: 104; awk: 5; sql: 3; makefile: 3
file content (19 lines) | stat: -rw-r--r-- 554 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from irods.models import Zone


class iRODSZone:

    def __init__(self, manager, result=None):
        """Construct an iRODSZone object."""
        self.manager = manager
        if result:
            self.id = result[Zone.id]
            self.name = result[Zone.name]
            self.type = result[Zone.type]

    def remove(self):
        self.manager.remove(self.name)

    def __repr__(self):
        """Render a user-friendly string representation for the iRODSZone object."""
        return "<iRODSZone {id} {name} {type}>".format(**vars(self))