Git Product home page Git Product logo

pyutmp's Introduction

This is pyutmp, a Python interface to the Unix utmp file.

To install pyutmp in the default location, type:

python setup.py install

To install it somewhere else (e.g., your home directory) type:

python setup.py install --prefix=$HOME

pyutmp is released under a new BSD license. See the accompanying license file for details.

pyutmp's People

Contributors

bmc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyutmp's Issues

'KeyError: 0' in 'pyutmp_linux.pyx:96'

This diff should fix the issue:

--- a/pyutmp/pyutmp_linux.pyx   2014-08-11 10:55:15.177622103 +0200
+++ b/pyutmp/pyutmp_linux.pyx   2014-08-11 10:55:24.025674269 +0200
@@ -49,7 +49,8 @@
     utmp *getutline(utmp *u)
     void utmpname(char *path)

-_TYPE_MAP = {RUN_LVL: 'RUN_LVL',
+_TYPE_MAP = {UT_UNKNOWN: 'UT_UNKNOWN',
+             RUN_LVL: 'RUN_LVL',
              BOOT_TIME: 'BOOT_TIME',
              NEW_TIME: 'NEW_TIME',
              OLD_TIME: 'OLD_TIME',

Deprecated?

Is there any plan to update this package to Python 3?
It seems to be the best utmp wrapper out there, so it would be great to update if possible.

I tried forking, editing with minor changes (mainly with print and raise), and it seems to build fine.
Installation with python setup.py install works too, but then importing pyutmp yields the following errror:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/path/to/pyutmp/pyutmp/__init__.py", line 306, in <module>
    exec('import pyutmp_%s as _pyutmp' % _get_platform())
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pyutmp_bsd'

I assume this has to do with the setup.py file somehow, but I am still relatively new to python, and never made a package before, so I would need a bit of help. FYI the fork can be found here.

Does not compile with python 2.6 on OS X mavericks

~ > pip2.6 install pyutmp
Downloading/unpacking pyutmp
  Downloading pyutmp-0.2.1.tar.gz
  Running setup.py (path:/private/var/folders/kd/fkybt4cs19xgrbg2jtxzxkbh0000gn/T/pip_build_kormoc/pyutmp/setup.py) egg_info for package pyutmp
    file pyutmp.py (for module pyutmp) not found
Installing collected packages: pyutmp
  Running setup.py install for pyutmp
    file pyutmp.py (for module pyutmp) not found
    file pyutmp.py (for module pyutmp) not found
    building 'pyutmp/pyutmp_bsd' extension
    /usr/bin/gcc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c pyutmp/pyutmp_bsd.c -o build/temp.macosx-10.9-intel-2.6/pyutmp/pyutmp_bsd.o
    clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
    clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
    error: command '/usr/bin/gcc' failed with exit status 1
    Complete output from command /System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, tokenize;__file__='/private/var/folders/kd/fkybt4cs19xgrbg2jtxzxkbh0000gn/T/pip_build_kormoc/pyutmp/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/kd/fkybt4cs19xgrbg2jtxzxkbh0000gn/T/pip-M5hrMu-record/install-record.txt --single-version-externally-managed --compile:
    running install
running build
running build_py
file pyutmp.py (for module pyutmp) not found
creating build
creating build/lib.macosx-10.9-intel-2.6
creating build/lib.macosx-10.9-intel-2.6/pyutmp
copying pyutmp/__init__.py -> build/lib.macosx-10.9-intel-2.6/pyutmp
file pyutmp.py (for module pyutmp) not found
running build_ext
building 'pyutmp/pyutmp_bsd' extension
creating build/temp.macosx-10.9-intel-2.6
creating build/temp.macosx-10.9-intel-2.6/pyutmp
/usr/bin/gcc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c pyutmp/pyutmp_bsd.c -o build/temp.macosx-10.9-intel-2.6/pyutmp/pyutmp_bsd.o
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command '/usr/bin/gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, tokenize;__file__='/private/var/folders/kd/fkybt4cs19xgrbg2jtxzxkbh0000gn/T/pip_build_kormoc/pyutmp/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/kd/fkybt4cs19xgrbg2jtxzxkbh0000gn/T/pip-M5hrMu-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/kd/fkybt4cs19xgrbg2jtxzxkbh0000gn/T/pip_build_kormoc/pyutmp
Storing debug log for failure in /Users/kormoc/Library/Logs/pip.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.