util.py (14843421) | util.py (e4d060fb) |
---|---|
1#! /usr/bin/python2.4 2# 3# CDDL HEADER START 4# 5# The contents of this file are subject to the terms of the 6# Common Development and Distribution License (the "License"). 7# You may not use this file except in compliance with the License. 8# --- 5 unchanged lines hidden (view full) --- 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# | 1#! /usr/bin/python2.4 2# 3# CDDL HEADER START 4# 5# The contents of this file are subject to the terms of the 6# Common Development and Distribution License (the "License"). 7# You may not use this file except in compliance with the License. 8# --- 5 unchanged lines hidden (view full) --- 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# |
22# Copyright 2009 Sun Microsystems, Inc. All rights reserved. | 22# Copyright 2010 Sun Microsystems, Inc. All rights reserved. |
23# Use is subject to license terms. 24# 25 26"""This module provides utility functions for ZFS. 27zfs.util.dev -- a file object of /dev/zfs """ 28 29import gettext 30import errno 31import os | 23# Use is subject to license terms. 24# 25 26"""This module provides utility functions for ZFS. 27zfs.util.dev -- a file object of /dev/zfs """ 28 29import gettext 30import errno 31import os |
32import solaris.misc |
|
32# Note: this module (zfs.util) should not import zfs.ioctl, because that 33# would introduce a circular dependency 34 35errno.ECANCELED = 47 36errno.ENOTSUP = 48 37 38dev = open("/dev/zfs", "w") 39 | 33# Note: this module (zfs.util) should not import zfs.ioctl, because that 34# would introduce a circular dependency 35 36errno.ECANCELED = 47 37errno.ENOTSUP = 48 38 39dev = open("/dev/zfs", "w") 40 |
40_ = gettext.translation("SUNW_OST_OSLIB", "/usr/lib/locale", 41 fallback=True).gettext | 41try: 42 _ = gettext.translation("SUNW_OST_OSLIB", "/usr/lib/locale", 43 fallback=True).gettext 44except: 45 _ = solaris.misc.gettext |
42 43def default_repr(self): 44 """A simple __repr__ function.""" 45 if self.__slots__: 46 str = "<" + self.__class__.__name__ 47 for v in self.__slots__: 48 str += " %s: %r" % (v, getattr(self, v)) 49 return str + ">" --- 89 unchanged lines hidden --- | 46 47def default_repr(self): 48 """A simple __repr__ function.""" 49 if self.__slots__: 50 str = "<" + self.__class__.__name__ 51 for v in self.__slots__: 52 str += " %s: %r" % (v, getattr(self, v)) 53 return str + ">" --- 89 unchanged lines hidden --- |