Giter Club home page Giter Club logo

cgroupspy's People

Contributors

cs-cruz avatar gcbirzan avatar henning-schild avatar hg-cs avatar islavov avatar jjlopez avatar kevinyang21 avatar miguel-cs avatar paulsd avatar skamander avatar vorot93 avatar vpetersson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cgroupspy's Issues

delete_cgroup requires binary parameter. is this intended behaviour?

hi,

don't really have experience with python, but since I'm browsing cgroup libraries at the moment I noticed the following: if I create a cgroup I can pass a string as the group name to the create_cgroup function, and the name is encoded before it's used, but if I want to delete the same cgroup later with delete_cgroup I need to pass it a binary string b"..." otherwise I get a TypeError (can't mix strings and bytes in path components).

Is this intended behaviour or a missing encode before join?

EDIT: it's the same error as in this commit: 9baa994

Example

from cgroupspy import trees

t = trees.Tree()
# passing a string works
t.root.create_cgroup("testcgroupspy")

# type error
t.root.delete_cgroup("testcgroupspy")

# works
t.root.delete_cgroup(b"testcgroupspy")

it does't work to bind a pid to node

it seems that this library didn't support bind a process to some created node.
I did something like following, it turns out had none effect and node.controller.procs kept empty.
node.controller.procs.append(2341)

push 0.1.3 to pypi

It looks like only 0.1.2 is available via pip but 0.1.3 is latest version in GH.

Python 3.10 compatibility

Hi,

It seems cgroupspy is not working with python 3.10 with this kind of error:

ImportError: cannot import name 'Iterable' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py)

As per Python collections documentation, Iterable has been moved to collections.abc since 3.3 and left for compatibility until 3.9 included: https://docs.python.org/3.9/library/collections.html.

A suggestion for cgroupspy/interfaces.py:

Replace

from collections import Iterable

By

if sys.version_info.major == 3 and sys.version_info.minor >= 3:
    from collections.abc import Iterable
else:
    from collections import Iterable

or equivalent in order to have a distinction between Python 3.3 and older.

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.