Skip to content

Commit 479b8a6

Browse files
committed
Version 0.1.1 — Rename to "in_place"
I could have sworn I had already checked PyPI for name conflicts...
1 parent 26a2dd7 commit 479b8a6

11 files changed

+42
-42
lines changed

README.rst

+15-15
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
.. image:: https://coveralls.io/repos/github/jwodder/inplace/badge.svg?branch=master
1010
:target: https://coveralls.io/github/jwodder/inplace?branch=master
1111

12-
.. image:: https://img.shields.io/pypi/pyversions/inplace.svg
12+
.. image:: https://img.shields.io/pypi/pyversions/in_place.svg
1313

14-
.. image:: https://img.shields.io/github/license/jwodder/inplace.svg?maxAge=2592000
14+
.. image:: https://img.shields.io/github/license/jwodder/in_place.svg?maxAge=2592000
1515
:target: https://opensource.org/licenses/MIT
1616
:alt: MIT License
1717

1818
`GitHub <https://github.com/jwodder/inplace>`_
19-
| `PyPI <https://pypi.python.org/pypi/inplace>`_
19+
| `PyPI <https://pypi.python.org/pypi/in_place>`_
2020
| `Issues <https://github.com/jwodder/inplace/issues>`_
2121
22-
The ``inplace`` module provides Python classes for reading & writing a file
22+
The ``in_place`` module provides Python classes for reading & writing a file
2323
"in-place": data that you write ends up at the same filepath that you read
24-
from, and ``inplace`` takes care of all the necessary mucking about with
24+
from, and ``in_place`` takes care of all the necessary mucking about with
2525
temporary files for you.
2626

2727
For example, given the file ``somefile.txt``::
@@ -33,9 +33,9 @@ For example, given the file ``somefile.txt``::
3333

3434
and the program ``disemvowel.py``::
3535

36-
import inplace
36+
import in_place
3737

38-
with inplace.InPlace('somefile.txt') as fp:
38+
with in_place.InPlace('somefile.txt') as fp:
3939
for line in fp:
4040
fp.write(''.join(c for c in line if c not in 'AEIOUaeiou'))
4141

@@ -51,14 +51,14 @@ and no sign of those pesky vowels remains! If you want a sign of those pesky
5151
vowels to remain, you can instead save the file's original contents in, say,
5252
``somefile.txt~`` by constructing the filehandle with::
5353

54-
inplace.InPlace('somefile.txt', backup_ext='~')
54+
in_place.InPlace('somefile.txt', backup_ext='~')
5555

5656
or save to ``someotherfile.txt`` with::
5757

58-
inplace.InPlace('somefile.txt', backup='someotherfile.txt')
58+
in_place.InPlace('somefile.txt', backup='someotherfile.txt')
5959

6060
Compared to the in-place filtering implemented by the Python standard library's
61-
|fileinput|_ module, ``inplace`` offers the following benefits:
61+
|fileinput|_ module, ``in_place`` offers the following benefits:
6262

6363
- Instead of hijacking ``sys.stdout``, a new filehandle is returned for
6464
writing.
@@ -69,8 +69,8 @@ Compared to the in-place filtering implemented by the Python standard library's
6969
binary mode, and these options apply to both input and output.
7070
- The complete filename of the backup file can be specified; you aren't
7171
constrained to just adding an extension.
72-
- When used as a context manager, ``inplace`` will restore the original file if
73-
an exception occurs.
72+
- When used as a context manager, ``in_place`` will restore the original file
73+
if an exception occurs.
7474
- The creation of temporary files won't silently clobber innocent bystander
7575
files.
7676

@@ -81,14 +81,14 @@ Compared to the in-place filtering implemented by the Python standard library's
8181
Installation
8282
============
8383
Just use `pip <https://pip.pypa.io>`_ (You have pip, right?) to install
84-
``inplace`` and its dependencies::
84+
``in_place`` and its dependencies::
8585

86-
pip install inplace
86+
pip install in_place
8787

8888

8989
Basic Usage
9090
===========
91-
``inplace`` provides two classes: ``InPlace``, for working with text files
91+
``in_place`` provides two classes: ``InPlace``, for working with text files
9292
(reading & writing ``unicode`` objects in Python 2, ``str`` objects in Python
9393
3); and ``InPlaceBytes``, for working with binary files (reading & writing
9494
``str`` objects in Python 2, ``bytes`` objects in Python 3). Both classes'

inplace.py renamed to in_place.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"""
22
In-place file processing
33
4-
The ``inplace`` module provides Python classes for reading & writing a file
4+
The ``in_place`` module provides Python classes for reading & writing a file
55
"in-place": data that you write ends up at the same filepath that you read
6-
from, and ``inplace`` takes care of all the necessary mucking about with
6+
from, and ``in_place`` takes care of all the necessary mucking about with
77
temporary files for you.
88
99
Visit <https://github.com/jwodder/inplace> for more information.
1010
"""
1111

12-
__version__ = '0.1.0'
12+
__version__ = '0.1.1'
1313
__author__ = 'John Thorvald Wodder II'
1414
__author_email__ = '[email protected]'
1515
__license__ = 'MIT'
@@ -123,7 +123,7 @@ def _mktemp(self, filepath):
123123
"""
124124
fd, tmppath = tempfile.mkstemp(
125125
dir=os.path.dirname(filepath),
126-
prefix='._inplace-',
126+
prefix='._in_place-',
127127
)
128128
os.close(fd)
129129
return tmppath

setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import re
33
from setuptools import setup
44

5-
with open(join(dirname(__file__), 'inplace.py')) as fp:
5+
with open(join(dirname(__file__), 'in_place.py')) as fp:
66
for line in fp:
77
m = re.search(r'^\s*__version__\s*=\s*([\'"])([^\'"]+)\1\s*$', line)
88
if m:
@@ -15,9 +15,9 @@
1515
long_desc = fp.read()
1616

1717
setup(
18-
name='inplace',
18+
name='in_place',
1919
version=version,
20-
py_modules=['inplace'],
20+
py_modules=['in_place'],
2121
license='MIT',
2222
author='John Thorvald Wodder II',
2323
author_email='[email protected]',

test/test_bytes.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from six import binary_type
2-
from inplace import InPlaceBytes
3-
from test_inplace_util import UNICODE, pylistdir
1+
from six import binary_type
2+
from in_place import InPlaceBytes
3+
from test_in_place_util import UNICODE, pylistdir
44

55
def test_bytes_iconv_nobackup(tmpdir):
66
assert pylistdir(tmpdir) == []

test/test_encoding.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from unicodedata import normalize
2-
from six import text_type
1+
from unicodedata import normalize
2+
from six import text_type
33
import pytest
4-
from inplace import InPlace
5-
from test_inplace_util import UNICODE, pylistdir
4+
from in_place import InPlace
5+
from test_in_place_util import UNICODE, pylistdir
66

77
def test_utf8_nobackup(tmpdir):
88
assert pylistdir(tmpdir) == []

test/test_general.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from __future__ import print_function
1+
from __future__ import print_function
22
import os
33
import pytest
4-
from inplace import InPlace
5-
from test_inplace_util import TEXT, pylistdir
4+
from in_place import InPlace
5+
from test_in_place_util import TEXT, pylistdir
66

77
def test_nobackup(tmpdir):
88
assert pylistdir(tmpdir) == []
File renamed without changes.

test/test_io_methods.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from __future__ import print_function
2-
from inplace import InPlace, InPlaceBytes
3-
from test_inplace_util import TEXT, UNICODE, pylistdir
1+
from __future__ import print_function
2+
from in_place import InPlace, InPlaceBytes
3+
from test_in_place_util import TEXT, UNICODE, pylistdir
44

55
def test_print_backup(tmpdir):
66
assert pylistdir(tmpdir) == []

test/test_move_first.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from __future__ import print_function
1+
from __future__ import print_function
22
import os
33
import pytest
4-
from inplace import InPlace
5-
from test_inplace_util import TEXT, pylistdir
4+
from in_place import InPlace
5+
from test_in_place_util import TEXT, pylistdir
66

77
def test_move_first_nobackup(tmpdir):
88
assert pylistdir(tmpdir) == []

test/test_py2print.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
import pytest
3-
from inplace import InPlaceBytes
4-
from test_inplace_util import TEXT, pylistdir
3+
from in_place import InPlaceBytes
4+
from test_in_place_util import TEXT, pylistdir
55

66
@pytest.mark.skipif(sys.version_info[0] > 2, reason='Python 2 only')
77
def test_py2print_backup(tmpdir):

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ envlist = py27,py35
55
commands = python setup.py test
66

77
[pytest]
8-
testpaths = inplace.py test
9-
addopts = --cache-clear --cov=inplace --cov-report term-missing --flakes
8+
testpaths = in_place.py test
9+
addopts = --cache-clear --cov=in_place --cov-report term-missing --flakes

0 commit comments

Comments
 (0)