Skip to content

Commit

Permalink
Update the version to 2.0.0 and update readmes, changelog, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
kata198 committed Feb 28, 2017
1 parent 0ce0d85 commit bcca212
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
* 2.0.0 - Feb 28 2017
- Add the "--peek" option to all of the pop* commands and the module (as "saveChanges" argument, default True).
This can be used to just pull the lines without modifying the source file (i.e. instead of a queue, you can use it for simple extraction)
- Add the "--ordered" option (and keepOrdered in module) to the "popRandom" command. When this is present, the output lines will still be picked at random, but they will be output in the order they appear in the file. By default, the old behaviour is retained, and random lines will be output in random order.

* 1.1.1 - Feb 28 2017
- Add missing scripts to setup.py

Expand Down
4 changes: 2 additions & 2 deletions PopLines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
# these - Remove specific lines, 0-origin. numLines is an array of 0-origin line numbers to remove.
POP_TYPES = ('head', 'tail', 'random', 'range', 'these')

__version__ = '1.1.1'
__version_tuple__ = (1, 1, 1)
__version__ = '2.0.0'
__version_tuple__ = (2, 0, 0)

__all__ = ('POP_TYPES', 'popLines', 'popHead', 'popTail', 'popRandom', 'popRange', 'popThese')

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,23 @@ The followings modes and their associated command name are given:

**Random** - popRandom \[numLines\] \[filename\] - Removes "numLines" from random positions within provided "filename", and prints to stdout in a random order.


You can pass the --ordered flag, and the randomly-selected lines will be output in the same order they appear in the file. By default, the random lines will be output in random order.


**Range** - popRange \[start\] \[stop\] (optional: \[step\]) \[filename\] - Removes lines using inclusive 1-origin start, stop, and optional step, and prints to stdout. Negative numbers are supported to mean "from the end", -1 is last line, -2 is second-to-last line.

**These** - popThese \[line1\] \[...lineN\] \[filename\] - Removes specific lines given 1-origin numbers. If numbers are out of range, that number will be ommited. Lines are returned in provided order, and duplicates are allowed. Negative numbers are supported to mean "from the end".


Peeking
-------

By default, the pop\* commands are designed to implement queues, and thus they perform real "pops" and remove the elements extracted from the source file.

If you'd just like to "peek" (extract lines but keep them in the source), add "--peek" when invoking any of the pop\* commands.


Module
------

Expand Down
10 changes: 10 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,22 @@ The followings modes and their associated command name are given:
**Random** - popRandom [numLines] [filename] - Removes "numLines" from random positions within provided "filename", and prints to stdout in a random order.


You can pass the --ordered flag, and the randomly-selected lines will be output in the same order they appear in the file. By default, the random lines will be output in random order.


**Range** - popRange [start] [stop] (optional: [step]) [filename] - Removes lines using inclusive 1-origin start, stop, and optional step, and prints to stdout. Negative numbers are supported to mean "from the end", -1 is last line, -2 is second-to-last line.


**These** - popThese [line1] [...lineN] [filename] - Removes specific lines given 1-origin numbers. If numbers are out of range, that number will be ommited. Lines are returned in provided order, and duplicates are allowed. Negative numbers are supported to mean "from the end".


Peeking
-------

By default, the pop\* commands are designed to implement queues, and thus they perform real "pops" and remove the elements extracted from the source file.

If you'd just like to "peek" (extract lines but keep them in the source), add "--peek" when invoking any of the pop\* commands.


Module
------
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
long_description = summary

setup(name='popLines',
version='1.1.1',
version='2.0.0',
scripts=['popHead', 'popTail', 'popRandom', 'popRange', 'popThese'],
modules=['PopLines'],
packages=['PopLines'],
provides=['PopLines'],
keywords=['popLines', 'file', 'head', 'tail', 'random', 'queue', 'pop', 'lines', 'text', 'popHead', 'popTail', 'popRandom' ],
keywords=['popLines', 'file', 'head', 'tail', 'random', 'queue', 'pop', 'lines', 'peek', 'extract', 'text', 'popHead', 'popTail', 'popRandom' ],
url='https://github.com/kata198/popLines',
long_description=long_description,
author='Tim Savannah',
Expand Down

0 comments on commit bcca212

Please sign in to comment.