ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/pystatgrab/statgrab.py
Revision: 1.8
Committed: Fri Jul 13 22:19:56 2007 UTC (16 years, 7 months ago) by tdb
Content type: text/x-python
Branch: MAIN
CVS Tags: PYSTATGRAB_0_5, HEAD
Changes since 1.7: +5 -1 lines
Log Message:
Chase two additional functions in libstatgrab 0.13 - sg_snapshot and
sg_shutdown. Both are null operations on non-Windows platforms, but
Python can run on Windows so we should support them. Consequently we
now need at least libstatgrab 0.13.

File Contents

# User Rev Content
1 tdb 1.1 #
2 tdb 1.3 # i-scream pystatgrab
3 tdb 1.7 # http://www.i-scream.org/pystatgrab/
4 tdb 1.1 # Copyright (C) 2000-2004 i-scream
5     #
6     # This program is free software; you can redistribute it and/or
7     # modify it under the terms of the GNU General Public License
8     # as published by the Free Software Foundation; either version 2
9     # of the License, or (at your option) any later version.
10     #
11     # This program is distributed in the hope that it will be useful,
12     # but WITHOUT ANY WARRANTY; without even the implied warranty of
13     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     # GNU General Public License for more details.
15     #
16     # You should have received a copy of the GNU General Public License
17     # along with this program; if not, write to the Free Software
18     # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19     #
20 tdb 1.8 # $Id: statgrab.py,v 1.7 2004/08/24 20:43:47 tdb Exp $
21 tdb 1.1 #
22    
23     import _statgrab
24    
25 tdb 1.5 def sg_init():
26     return _statgrab.py_sg_init()
27 tdb 1.8 def sg_snapshot():
28     return _statgrab.py_sg_snapshot()
29     def sg_shutdown():
30     return _statgrab.py_sg_shutdown()
31 tdb 1.5 def sg_drop_privileges():
32     return _statgrab.py_sg_drop_privileges()
33 tdb 1.6 def sg_set_error(code, arg=''):
34     return _statgrab.py_sg_set_error(code, arg)
35 tdb 1.7 def sg_set_error_with_errno(code, arg=''):
36     return _statgrab.py_sg_set_error_with_errno(code, arg)
37 tdb 1.6 def sg_get_error():
38     return _statgrab.py_sg_get_error()
39     def sg_get_error_arg():
40     return _statgrab.py_sg_get_error_arg()
41 tdb 1.7 def sg_get_error_errno():
42     return _statgrab.py_sg_get_error_errno()
43 tdb 1.6 def sg_str_error(code):
44     return _statgrab.py_sg_str_error(code)
45 tdb 1.5 def sg_get_host_info():
46     return _statgrab.py_sg_get_host_info()
47 tdb 1.4 def sg_get_cpu_stats():
48     return _statgrab.py_sg_get_cpu_stats()
49     def sg_get_cpu_stats_diff():
50     return _statgrab.py_sg_get_cpu_stats_diff()
51     def sg_get_cpu_percents():
52     return _statgrab.py_sg_get_cpu_percents()
53     def sg_get_mem_stats():
54     return _statgrab.py_sg_get_mem_stats()
55     def sg_get_load_stats():
56     return _statgrab.py_sg_get_load_stats()
57     def sg_get_user_stats():
58     return _statgrab.py_sg_get_user_stats()
59     def sg_get_swap_stats():
60     return _statgrab.py_sg_get_swap_stats()
61     def sg_get_fs_stats():
62     return _statgrab.py_sg_get_fs_stats()
63     def sg_get_disk_io_stats():
64     return _statgrab.py_sg_get_disk_io_stats()
65     def sg_get_disk_io_stats_diff():
66     return _statgrab.py_sg_get_disk_io_stats_diff()
67     def sg_get_network_io_stats():
68     return _statgrab.py_sg_get_network_io_stats()
69     def sg_get_network_io_stats_diff():
70     return _statgrab.py_sg_get_network_io_stats_diff()
71     def sg_get_network_iface_stats():
72     return _statgrab.py_sg_get_network_iface_stats()
73     def sg_get_page_stats():
74     return _statgrab.py_sg_get_page_stats()
75     def sg_get_page_stats_diff():
76     return _statgrab.py_sg_get_page_stats_diff()
77 tdb 1.6 def sg_get_process_stats():
78     return _statgrab.py_sg_get_process_stats()
79 tdb 1.5 def sg_get_process_count():
80     return _statgrab.py_sg_get_process_count()
81 tdb 1.2
82 tdb 1.6 SG_ERROR_NONE = _statgrab.py_SG_ERROR_NONE
83     SG_ERROR_ASPRINTF = _statgrab.py_SG_ERROR_ASPRINTF
84     SG_ERROR_DEVSTAT_GETDEVS = _statgrab.py_SG_ERROR_DEVSTAT_GETDEVS
85     SG_ERROR_DEVSTAT_SELECTDEVS = _statgrab.py_SG_ERROR_DEVSTAT_SELECTDEVS
86     SG_ERROR_ENOENT = _statgrab.py_SG_ERROR_ENOENT
87     SG_ERROR_GETIFADDRS = _statgrab.py_SG_ERROR_GETIFADDRS
88     SG_ERROR_GETMNTINFO = _statgrab.py_SG_ERROR_GETMNTINFO
89     SG_ERROR_GETPAGESIZE = _statgrab.py_SG_ERROR_GETPAGESIZE
90     SG_ERROR_KSTAT_DATA_LOOKUP = _statgrab.py_SG_ERROR_KSTAT_DATA_LOOKUP
91     SG_ERROR_KSTAT_LOOKUP = _statgrab.py_SG_ERROR_KSTAT_LOOKUP
92     SG_ERROR_KSTAT_OPEN = _statgrab.py_SG_ERROR_KSTAT_OPEN
93     SG_ERROR_KSTAT_READ = _statgrab.py_SG_ERROR_KSTAT_READ
94     SG_ERROR_KVM_GETSWAPINFO = _statgrab.py_SG_ERROR_KVM_GETSWAPINFO
95     SG_ERROR_KVM_OPENFILES = _statgrab.py_SG_ERROR_KVM_OPENFILES
96     SG_ERROR_MALLOC = _statgrab.py_SG_ERROR_MALLOC
97     SG_ERROR_OPEN = _statgrab.py_SG_ERROR_OPEN
98     SG_ERROR_OPENDIR = _statgrab.py_SG_ERROR_OPENDIR
99     SG_ERROR_PARSE = _statgrab.py_SG_ERROR_PARSE
100     SG_ERROR_SETEGID = _statgrab.py_SG_ERROR_SETEGID
101     SG_ERROR_SETEUID = _statgrab.py_SG_ERROR_SETEUID
102     SG_ERROR_SETMNTENT = _statgrab.py_SG_ERROR_SETMNTENT
103     SG_ERROR_SOCKET = _statgrab.py_SG_ERROR_SOCKET
104     SG_ERROR_SWAPCTL = _statgrab.py_SG_ERROR_SWAPCTL
105     SG_ERROR_SYSCONF = _statgrab.py_SG_ERROR_SYSCONF
106     SG_ERROR_SYSCTL = _statgrab.py_SG_ERROR_SYSCTL
107     SG_ERROR_SYSCTLBYNAME = _statgrab.py_SG_ERROR_SYSCTLBYNAME
108     SG_ERROR_SYSCTLNAMETOMIB = _statgrab.py_SG_ERROR_SYSCTLNAMETOMIB
109     SG_ERROR_UNAME = _statgrab.py_SG_ERROR_UNAME
110     SG_ERROR_UNSUPPORTED = _statgrab.py_SG_ERROR_UNSUPPORTED
111     SG_ERROR_XSW_VER_MISMATCH = _statgrab.py_SG_ERROR_XSW_VER_MISMATCH
112    
113 tdb 1.4 SG_IFACE_DUPLEX_FULL = _statgrab.py_SG_IFACE_DUPLEX_FULL
114     SG_IFACE_DUPLEX_HALF = _statgrab.py_SG_IFACE_DUPLEX_HALF
115     SG_IFACE_DUPLEX_UNKNOWN = _statgrab.py_SG_IFACE_DUPLEX_UNKNOWN
116 tdb 1.6
117     SG_PROCESS_STATE_RUNNING = _statgrab.py_SG_PROCESS_STATE_RUNNING
118     SG_PROCESS_STATE_SLEEPING = _statgrab.py_SG_PROCESS_STATE_SLEEPING
119     SG_PROCESS_STATE_STOPPED = _statgrab.py_SG_PROCESS_STATE_STOPPED
120     SG_PROCESS_STATE_ZOMBIE = _statgrab.py_SG_PROCESS_STATE_ZOMBIE
121     SG_PROCESS_STATE_UNKNOWN = _statgrab.py_SG_PROCESS_STATE_UNKNOWN