Skip to content

Commit b5c1c1f

Browse files
committed
- Moved to github
- Changed license to MIT - Modernizing
1 parent bb01da6 commit b5c1c1f

File tree

6 files changed

+141
-76
lines changed

6 files changed

+141
-76
lines changed

LICENSE

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright (c) 2012 Mike Thornton
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.rst

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
======
2+
Tailer
3+
======
4+
5+
Python tail is a simple implementation of GNU tail and head.
6+
7+
It provides 3 main functions that can be performed on any file-like object that supports ``seek()`` and ``tell()``.
8+
9+
* ``tail`` - read lines from the end of a file
10+
* ``head`` - read lines from the top of a file
11+
* ``follow`` - read lines as a file grows
12+
13+
It also comes with ``pytail``, a command line version offering the same functionality as GNU tail. This can be particularly useful on Windows systems that have no tail equivalent.
14+
15+
- `Tailer on GitHub <http://github.com/six8/pytailer>`_
16+
- `Tailer on Pypi <http://pypi.python.org/pypi/tailer>`_
17+
18+
Installation
19+
============
20+
21+
Install with ``pip`` or ``easy_install``.
22+
23+
::
24+
25+
pip install tailer
26+
27+
Examples
28+
========
29+
30+
::
31+
32+
import tailer
33+
f = open('test.txt', 'w')
34+
for i in range(11):
35+
f.write('Line %d\\n' % (i + 1))
36+
f.close()
37+
38+
Tail
39+
----
40+
::
41+
42+
# Get the last 3 lines of the file
43+
tailer.tail(open('test.txt'), 3)
44+
# ['Line 9', 'Line 10', 'Line 11']
45+
46+
Head
47+
----
48+
::
49+
50+
# Get the first 3 lines of the file
51+
tailer.head(open('test.txt'), 3)
52+
# ['Line 1', 'Line 2', 'Line 3']
53+
54+
Follow
55+
------
56+
::
57+
58+
# Follow the file as it grows
59+
for line in tailer.follow(open('test.txt')):
60+
print line

VERSION.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.3

fabfile.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from fabric.api import local, task, abort, settings
2+
from clom import clom
3+
4+
@task
5+
def release():
6+
"""
7+
Release current version to pypi
8+
"""
9+
10+
with settings(warn_only=True):
11+
r = local(clom.git['diff-files']('--quiet', '--ignore-submodules', '--'))
12+
13+
if r.return_code != 0:
14+
abort('There are uncommitted changes, commit or stash them before releasing')
15+
16+
version = open('VERSION.txt').read().strip()
17+
18+
print('Releasing %s...' % version)
19+
local(clom.git.tag(version, a=True, m='Release %s' % version))
20+
local(clom.git.push('origin', 'HEAD'))
21+
local(clom.git.push('origin', version))
22+
local(clom.python('setup.py', 'sdist', 'upload'))

setup.py

+40-76
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,41 @@
1-
from setuptools import setup, find_packages
2-
setup(
3-
name = "tailer",
4-
version = "0.2",
5-
packages = find_packages(),
6-
7-
# metadata for upload to PyPI
8-
author = "Michael Thornton",
9-
author_email = "[email protected]",
10-
description = "Python tail is a simple implementation of GNU tail and head.",
11-
long_description = """\
12-
======
13-
Tailer
14-
======
15-
Python tail is a simple implementation of GNU tail and head.
16-
17-
It provides 3 main functions that can be performed on any file-like object that
18-
supports seek() and tell().
19-
20-
* tail - read lines from the end of a file
21-
* head - read lines from the top of a file
22-
* follow - read lines as a file grows
23-
24-
It also comes with pytail, a command line version offering the same
25-
functionality as GNU tail. This can be particularly useful on Windows systems
26-
that have no tail equivalent.
27-
28-
29-
::
30-
31-
import tailer
32-
f = open('test.txt', 'w')
33-
for i in range(11):
34-
f.write('Line %d\\n' % (i + 1))
35-
f.close()
36-
37-
Tail
38-
----
39-
::
40-
41-
# Get the last 3 lines of the file
42-
tailer.tail(open('test.txt'), 3)
43-
# ['Line 9', 'Line 10', 'Line 11']
44-
45-
Head
46-
----
47-
::
48-
49-
# Get the first 3 lines of the file
50-
tailer.head(open('test.txt'), 3)
51-
# ['Line 1', 'Line 2', 'Line 3']
52-
53-
Follow
54-
------
55-
::
56-
57-
# Follow the file as it grows
58-
for line in tailer.follow(open('test.txt')):
59-
print line
60-
""",
61-
license = "GPL",
62-
keywords = "tail head",
63-
url = "http://code.google.com/p/pytailer/",
64-
65-
entry_points = {
66-
'console_scripts': [
67-
'pytail = tailer:main',
1+
from distutils.core import setup
2+
3+
def main():
4+
5+
setup(
6+
name = 'tailer',
7+
packages=['tailer'],
8+
package_dir = {'':'src'},
9+
version = open('VERSION.txt').read().strip(),
10+
author='Mike Thornton',
11+
author_email='[email protected]',
12+
url='http://github.com/six8/pytailer',
13+
download_url='http://github.com/six8/pytailer',
14+
license='MIT',
15+
keywords=['tail', 'head'],
16+
description='Python tail is a simple implementation of GNU tail and head.',
17+
classifiers = [
18+
"Programming Language :: Python",
19+
"Development Status :: 3 - Alpha",
20+
"Environment :: Console",
21+
"Intended Audience :: Developers",
22+
"Intended Audience :: System Administrators",
23+
"Operating System :: POSIX",
24+
"License :: OSI Approved :: MIT License",
25+
"Natural Language :: English",
26+
'Topic :: System :: Logging',
27+
'Topic :: Text Processing',
28+
"Topic :: Software Development :: Libraries :: Python Modules",
29+
"Topic :: System :: System Shells",
30+
"Topic :: System :: Systems Administration",
6831
],
69-
},
70-
classifiers = [
71-
'Environment :: Console',
72-
'License :: OSI Approved :: GNU General Public License (GPL)',
73-
'Programming Language :: Python',
74-
'Topic :: System :: Logging',
75-
'Topic :: Text Processing'
76-
]
77-
)
32+
long_description=open('README.rst').read(),
33+
entry_points = {
34+
'console_scripts': [
35+
'pytail = tailer:main',
36+
],
37+
},
38+
)
39+
40+
if __name__ == '__main__':
41+
main()
File renamed without changes.

0 commit comments

Comments
 (0)