Skip to content

Commit

Permalink
better name: desub
Browse files Browse the repository at this point in the history
  • Loading branch information
kumar303 committed Aug 12, 2012
1 parent a667342 commit d081765
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions README.rst
@@ -1,8 +1,8 @@
subd is a Python module to work with a detached subprocess.
desub is a Python module to work with a detached subprocess.

This is useful for making a web interface (or whatever) to monitor a
process running in the background. You can start a
process from a web request and serve subsequent requests
to report status on and show output for the process you started earlier.

Full documentation: http://subd.readthedocs.org/en/latest/
Full documentation: http://desub.readthedocs.org/en/latest/
1 change: 1 addition & 0 deletions desub/__init__.py
@@ -0,0 +1 @@
from desub import *
10 changes: 5 additions & 5 deletions subd/subd.py → desub/desub.py
Expand Up @@ -18,12 +18,12 @@ def join(cmd_args, **kw):
"""
Join a subprocess or start one if it's not running.
The return value is a :class:`subd.Subd` object.
The return value is a :class:`desub.Subd` object.
Example::
>>> import subd
>>> proc = subd.join(['python', 'tests/cmd/loop.py'])
>>> import desub
>>> proc = desub.join(['python', 'tests/cmd/loop.py'])
>>> proc.pid
1987
>>> proc.stdout.read()
Expand Down Expand Up @@ -56,7 +56,7 @@ class Subd:
**root**
The root directory to store subprocess artifacts like a PID file
and stdout/stderr logs.
By default this is ``~/.subd``.
By default this is ``~/.desub``.
Members
"""
Expand All @@ -67,7 +67,7 @@ def __init__(self, cmd_args, **kw):
self.kw = kw
root = kw.pop('root', None)
if not root:
root = os.path.join(os.path.expanduser('~'), '.subd')
root = os.path.join(os.path.expanduser('~'), '.desub')
self.root = os.path.join(root, self.name)
if not os.path.exists(self.root):
os.makedirs(self.root)
Expand Down
8 changes: 4 additions & 4 deletions docs/Makefile
Expand Up @@ -77,17 +77,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/subd.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/desub.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/subd.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/desub.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/subd"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/subd"
@echo "# mkdir -p $$HOME/.local/share/devhelp/desub"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/desub"
@echo "# devhelp"

epub:
Expand Down
14 changes: 7 additions & 7 deletions docs/conf.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# subd documentation build configuration file, created by
# desub documentation build configuration file, created by
# sphinx-quickstart on Sat Aug 11 18:39:45 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
Expand Down Expand Up @@ -40,7 +40,7 @@
master_doc = 'index'

# General information about the project.
project = u'subd'
project = u'desub'
copyright = u'2012, Kumar McMillan and contributors'

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -164,7 +164,7 @@
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'subddoc'
htmlhelp_basename = 'desubdoc'


# -- Options for LaTeX output --------------------------------------------------
Expand All @@ -183,7 +183,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'subd.tex', u'subd Documentation',
('index', 'desub.tex', u'desub Documentation',
u'Kumar McMillan and contributors', 'manual'),
]

Expand Down Expand Up @@ -213,7 +213,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'subd', u'subd Documentation',
('index', 'desub', u'desub Documentation',
[u'Kumar McMillan and contributors'], 1)
]

Expand All @@ -227,8 +227,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'subd', u'subd Documentation',
u'Kumar McMillan and contributors', 'subd', 'One line description of project.',
('index', 'desub', u'desub Documentation',
u'Kumar McMillan and contributors', 'desub', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
12 changes: 6 additions & 6 deletions docs/index.rst
@@ -1,11 +1,11 @@
====
subd
desub
====

.. highlight:: python


subd is a Python module to work with a detached `subprocess`_.
desub is a Python module to work with a detached `subprocess`_.

This is useful for making a web interface (or whatever) to monitor a
process running in the background. You can start a
Expand All @@ -22,7 +22,7 @@ Installation

::

pip install subd
pip install desub

This pulls in `psutil`_ as a requirement.

Expand All @@ -31,9 +31,9 @@ This pulls in `psutil`_ as a requirement.
API
===

.. autofunction:: subd.join
.. autofunction:: desub.join

.. autoclass:: subd.Subd
.. autoclass:: desub.Subd
:members: pid, stdout, stderr, stop, is_running

Developers
Expand All @@ -54,7 +54,7 @@ To the build the docs run::

The issue tracker can be found on github.

.. _`source from git`: https://github.com/kumar303/subd
.. _`source from git`: https://github.com/kumar303/desub
.. _tox: http://tox.testrun.org/latest/


Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -7,14 +7,14 @@ def path(name):
return open(os.path.join(os.path.dirname(__file__), name))


setup(name='subd',
setup(name='desub',
version='1.0',
description='Work with a detached subprocess.',
long_description=path('README.rst').read(),
author='Kumar McMillan',
author_email='kumar.mcmillan@gmail.com',
license='MIT',
url='https://github.com/kumar303/subd',
url='https://github.com/kumar303/desub',
include_package_data=True,
classifiers=[],
packages=find_packages(exclude=['tests']),
Expand Down
1 change: 0 additions & 1 deletion subd/__init__.py

This file was deleted.

8 changes: 4 additions & 4 deletions tests/test.py
Expand Up @@ -8,7 +8,7 @@
from nose.tools import eq_, raises
import psutil

import subd
import desub


class Test(unittest.TestCase):
Expand All @@ -22,8 +22,8 @@ def tearDown(self):
shutil.rmtree(self.tmp)

def join(self):
return subd.join([sys.executable,
self.cmd('loop.py')], root=self.tmp)
return desub.join([sys.executable,
self.cmd('loop.py')], root=self.tmp)

def cmd(self, name):
return os.path.join(os.path.dirname(__file__), 'cmd', name)
Expand Down Expand Up @@ -52,7 +52,7 @@ def test_join(self):
eq_(self.proc.pid, proc2.pid)

def test_default_root(self):
pr = subd.join([sys.executable, self.cmd('loop.py')])
pr = desub.join([sys.executable, self.cmd('loop.py')])
self.addCleanup(lambda: shutil.rmtree(pr.root))
assert pr.pid != self.proc.pid, (
'new root should make separate procs')

0 comments on commit d081765

Please sign in to comment.