tehmaze / getent Goto Github PK
View Code? Open in Web Editor NEWPython interface to the POSIX getent family of commands (getpwent, getgrent, getnetent, etc.)
Python interface to the POSIX getent family of commands (getpwent, getgrent, getnetent, etc.)
With Python 3:
$ python setup.py develop
Traceback (most recent call last):
File "setup.py", line 9, in <module>
long_description = file('README.rst').read(),
NameError: name 'file' is not defined
Hi,
netgroup support is missing.
This is not very trivial because contents is not set in netgroups.
<getent.libc.LP_NetgroupStruct object at 0x7f20563ff9e0>
<class 'getent.libc.LP_NetgroupStruct'>
<built-in method ctypes_from_outparam of LP_NetgroupStruct object at 0x7f20563ff9e0>
<method-wrapper 'delattr' of LP_NetgroupStruct object at 0x7f20563ff9e0>
<method-wrapper 'delitem' of LP_NetgroupStruct object at 0x7f20563ff9e0>
{}
None
<built-in method format of LP_NetgroupStruct object at 0x7f20563ff9e0>
<method-wrapper 'getattribute' of LP_NetgroupStruct object at 0x7f20563ff9e0>
<method-wrapper 'getitem' of LP_NetgroupStruct object at 0x7f20563ff9e0>
<method-wrapper 'getslice' of LP_NetgroupStruct object at 0x7f20563ff9e0>
<method-wrapper 'hash' of LP_NetgroupStruct object at 0x7f20563ff9e0>
<method-wrapper 'init' of LP_NetgroupStruct object at 0x7f20563ff9e0>
'getent.libc'
<built-in method new of _ctypes.PyCPointerType object at 0x7f2054ba8e40>
<method-wrapper 'nonzero' of LP_NetgroupStruct object at 0x7f20563ff9e0>
<built-in method reduce of LP_NetgroupStruct object at 0x7f20563ff9e0>
<built-in method reduce_ex of LP_NetgroupStruct object at 0x7f20563ff9e0>
<method-wrapper 'repr' of LP_NetgroupStruct object at 0x7f20563ff9e0>
<method-wrapper 'setattr' of LP_NetgroupStruct object at 0x7f20563ff9e0>
<method-wrapper 'setitem' of LP_NetgroupStruct object at 0x7f20563ff9e0>
<built-in method setstate of LP_NetgroupStruct object at 0x7f20563ff9e0>
<built-in method sizeof of LP_NetgroupStruct object at 0x7f20563ff9e0>
<method-wrapper 'str' of LP_NetgroupStruct object at 0x7f20563ff9e0>
<built-in method subclasshook of _ctypes.PyCPointerType object at 0x106b340>
from the command line utility provided by libc, getent --help
:
Supported databases:
ahosts ahostsv4 ahostsv6 aliases ethers group gshadow hosts initgroups
netgroup networks passwd protocols rpc services shadow
many of these are different names than the ones found in this library:
__all__ = (
'alias', 'group', 'host', 'network', 'passwd', 'proto', 'rpc', 'service',
'shadow', 'netgroup'
)
for consistency, it would be good if these used the same database names as the library itself. I found the remapping of hosts -> host
and services -> service
particularly confusing since they don't even match up to the name in /etc/
when nsswitch is using files
as the backend.
Hi
The following change is requirement for python3.
But, it has not been released to pypi.
Would it be possible to make a new release?
thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.