Skip to content

Commit

Permalink
Fix links and style issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Aug 28, 2017
1 parent 49fb4fd commit b0c6706
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
7 changes: 3 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ waiting for a connection).

Access to the socket is restricted to the application's effective user id or root.

This is just like Twisted's `manhole <http://twistedmatrix.com/documents/current/api/twisted.manhole.html>`__.
This is just like Twisted's `manhole <http://twistedmatrix.com/documents/current/api/twisted.conch.manhole.html>`__.
It's simpler (no dependencies), it only runs on Unix domain sockets (in contrast to Twisted's manhole which
can run on telnet or ssh) and it integrates well with various types of applications.

Expand Down Expand Up @@ -315,9 +315,8 @@ Requirements
Similar projects
================

* Twisted's `old manhole <http://twistedmatrix.com/documents/current/api/twisted.manhole.html>`__ and the `newer
implementation <http://twistedmatrix.com/documents/current/api/twisted.conch.manhole.html>`__ (colors, serverside
history).
* Twisted's `manhole <http://twistedmatrix.com/documents/current/api/twisted.conch.manhole.html>`__ - it has colors and
server-side history.
* `wsgi-shell <https://github.com/GrahamDumpleton/wsgi-shell>`_ - spawns a thread.
* `pyrasite <https://github.com/lmacken/pyrasite>`_ - uses gdb to inject code.
* `pydbattach <https://github.com/albertz/pydbattach>`_ - uses gdb to inject code.
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import, print_function
from __future__ import absolute_import
from __future__ import print_function

import io
from itertools import chain
import re
from distutils.command.build import build
from glob import glob
from itertools import chain
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from distutils.command.build import build

from setuptools import Command
from setuptools import find_packages
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install_lib import install_lib
from setuptools.command.easy_install import easy_install
from setuptools.command.install_lib import install_lib


def read(*names, **kwargs):
Expand Down
9 changes: 6 additions & 3 deletions src/manhole.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ def _get_original(mod, name):
_pthread_setname_np = libpthread.pthread_setname_np
_pthread_setname_np.argtypes = [ctypes.c_void_p, ctypes.c_char_p]
_pthread_setname_np.restype = ctypes.c_int
pthread_setname_np = lambda ident, name: _pthread_setname_np(ident, name[:15].encode('utf8'))

def pthread_setname_np(ident, name):
_pthread_setname_np(ident, name[:15].encode('utf8'))
except ImportError:
pthread_setname_np = lambda ident, name: None
def pthread_setname_np(ident, name):
pass

if sys.platform == 'darwin' or sys.platform.startswith("freebsd"):
_PEERCRED_LEVEL = getattr(socket, 'SOL_LOCAL', 0)
Expand Down Expand Up @@ -567,7 +570,7 @@ def install(verbose=True,
locals (dict): Names to add to manhole interactive shell locals.
daemon_connection (bool): The connection thread is daemonic (dies on app exit). Default: ``False``.
redirect_stderr (bool): Redirect output from stderr to manhole console. Default: ``True``.
connection_handler (function): Function that implements the connection handler (warning: this is for advanced
connection_handler (function): Function that implements the connection handler (warning: this is for advanced
users). Default: ``manhole.handle_connection``.
"""
# pylint: disable=W0603
Expand Down
2 changes: 1 addition & 1 deletion tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import atexit
import errno
from functools import partial
import logging
import os
import select
import signal
import sys
import time
from functools import partial

from process_tests import setup_coverage

Expand Down
4 changes: 2 additions & 2 deletions tests/test_manhole_cli.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from __future__ import print_function

import os
import sys
import signal
import sys

import pytest
from process_tests import dump_on_error
from process_tests import TestProcess
from process_tests import dump_on_error
from process_tests import wait_for_strings

try:
Expand Down
4 changes: 3 additions & 1 deletion tests/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from __future__ import print_function
import sys

import os
import sys

import manhole

stack_dump_file = '/tmp/manhole-pid'
Expand Down

0 comments on commit b0c6706

Please sign in to comment.