kiranvizru / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Turn get_connections() 'status' strings into constants #367

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Same as we to for IOPRIO_* and STATUS_* constants:
https://code.google.com/p/psutil/wiki/Documentation#Constants

As of now we have:

>>> p.get_connections()
[connection(fd=115, family=2, type=1, local_address=('10.0.0.1', 48776),
            remote_address=('93.186.135.91', 80), status='ESTABLISHED'),

'status' field should return a constant object [1] which defaults to int but 
can be nicely represented via str as in:

>>> p.get_connections()[0].status
0
>>> str(p.get_connections()[0].status)
'ESTABLISHED'
>>>

[1] 
https://code.google.com/p/psutil/source/browse/psutil/_common.py?spec=svnc6127ff
ef817129b411f84249b7496e803887dad&r=563562aba003010d4a6612a101f0855d75d80cf9#33

Original issue reported on code.google.com by g.rodola on 12 Apr 2013 at 6:25

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 24 Apr 2013 at 12:59

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 24 Apr 2013 at 1:03

GoogleCodeExporter commented 9 years ago
Fixed in fca2d639ecd1.

Original comment by g.rodola on 31 May 2013 at 2:36

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 8 Jun 2013 at 12:23

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 11 Jul 2013 at 8:54