ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/extras/python/statgrab.pyx
(Generate patch)

Comparing projects/libstatgrab/extras/python/statgrab.pyx (file contents):
Revision 1.5 by tdb, Fri Feb 13 00:16:20 2004 UTC vs.
Revision 1.7 by tdb, Fri Feb 13 17:53:15 2004 UTC

# Line 100 | Line 100 | cdef extern from "statgrab.h":
100          long long rx
101          time_t systime
102  
103 <    ctypedef enum duplex:
103 >    ctypedef enum statgrab_duplex:
104          FULL_DUPLEX
105          HALF_DUPLEX
106 <        NO_DUPLEX
106 >        UNKNOWN_DUPLEX
107  
108      ctypedef struct network_iface_stat_t:
109          char *interface_name
110          int speed
111 <        duplex dup
111 >        statgrab_duplex dup
112  
113      ctypedef struct page_stat_t:
114          long long pages_pagein
# Line 136 | Line 136 | cdef extern from "statgrab.h":
136      cdef extern int statgrab_drop_privileges()
137  
138  
139 + py_FULL_DUPLEX = FULL_DUPLEX
140 + py_HALF_DUPLEX = HALF_DUPLEX
141 + py_UNKNOWN_DUPLEX = UNKNOWN_DUPLEX
142 +
143 +
144   class Result:
145      def __init__(self, attrs):
146          self.attrs = attrs
# Line 272 | Line 277 | def py_get_disk_stats():
277      s = get_disk_stats(&entries)
278      if s == NULL:
279          raise StatgrabException, 'get_disk_stats() returned NULL'
280 <    list = [entries]
280 >    list = []
281      for i from 0 <= i < entries:
282          list.append(Result(
283              {'device_name': s.device_name,
# Line 295 | Line 300 | def py_get_diskio_stats():
300      s = get_diskio_stats(&entries)
301      if s == NULL:
302          raise StatgrabException, 'get_diskio_stats() returned NULL'
303 <    list = [entries]
303 >    list = []
304      for i from 0 <= i < entries:
305          list.append(Result(
306              {'disk_name': s.disk_name,
# Line 313 | Line 318 | def py_get_diskio_stats_diff():
318      s = get_diskio_stats_diff(&entries)
319      if s == NULL:
320          raise StatgrabException, 'get_diskio_stats_diff() returned NULL'
321 <    list = [entries]
321 >    list = []
322      for i from 0 <= i < entries:
323          list.append(Result(
324              {'disk_name': s.disk_name,
# Line 345 | Line 350 | def py_get_network_stats():
350      s = get_network_stats(&entries)
351      if s == NULL:
352          raise StatgrabException, 'get_network_stats() returned NULL'
353 <    list = [entries]
353 >    list = []
354      for i from 0 <= i < entries:
355          list.append(Result(
356              {'interface_name': s.interface_name,
# Line 363 | Line 368 | def py_get_network_stats_diff():
368      s = get_network_stats_diff(&entries)
369      if s == NULL:
370          raise StatgrabException, 'get_network_stats_diff() returned NULL'
371 <    list = [entries]
371 >    list = []
372      for i from 0 <= i < entries:
373          list.append(Result(
374              {'interface_name': s.interface_name,
# Line 381 | Line 386 | def py_get_network_iface_stats():
386      s = get_network_iface_stats(&entries)
387      if s == NULL:
388          raise StatgrabException, 'get_network_iface_stats() returned NULL'
389 <    list = [entries]
389 >    list = []
390      for i from 0 <= i < entries:
391          list.append(Result(
392              {'interface_name': s.interface_name,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines