Skip to content

Commit

Permalink
Install anishot from pypi
Browse files Browse the repository at this point in the history
Package anishot with openstack-pbr define anishot as a python package.
Introduce dependencies management via requirements.txt.
Move deprecated gflags to abls-py (https://pypi.python.org/pypi/absl-py)
  • Loading branch information
4383 authored and sergey48k committed Jul 1, 2018
1 parent b6fb60e commit 5c83687
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
anishot.egg-info/
build/
*.eggs/
*__pycache__*
build/
.tox/
*.pyc
dist/
*.swa
*.swp
*~
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language: python
cache:
- pip
python:
- '2.7'
- '3.4'
- '3.5'
- 3.5-dev
- '3.6'
- 3.6-dev
before_install:
- pip install -U pip
- pip install -U setuptools
- pip install -U wheel
- pip install -U pbr
script:
- python setup.py install

deploy:
- provider: pypi
user: sourcerer-io
password: your-pypi-password
on:
tags: true
distributions: sdist bdist_wheel
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ Animates a long screenshot into a GIF. Use it to show off long screenshots in yo

![](https://user-images.githubusercontent.com/35666548/41495994-7669ccc8-70e9-11e8-80d4-3253cd0fa963.gif)

## Install

```
$ pip install anishot
```

## Usage
```
$ anishot
Usage:
--h: Window height
(default: '0')
Expand All @@ -25,4 +33,4 @@ Usage:
```

The anishot in this README was generated by:
``python3 anishot.py --in=screenshot.png --h=500 --stops=277,562 --out=anishot.gif --zoom=3 --zoom_frac=.5``
``anishot --in=screenshot.png --h=500 --stops=277,562 --out=anishot.gif --zoom=3 --zoom_frac=.5``
Empty file added anishot/__init__.py
Empty file.
13 changes: 9 additions & 4 deletions anishot.py → anishot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import sys

import gflags
from absl import flags as gflags
import imageio
import numpy

Expand Down Expand Up @@ -78,7 +78,8 @@ def make_scroll(image, frames):
add_frame(frames, image[s1:s1 + F.h, :], 2)


def main(argv):
def main():
argv = sys.argv
try:
F(argv)

Expand All @@ -92,11 +93,15 @@ def main(argv):
imageio.mimwrite(F.out,
map(lambda f: f[0], frames),
duration=list(map(lambda f: f[1], frames)))
except gflags.FlagsError as e:
except TypeError as e:
print('e: ', e)
print('Usage: %s' % F)
return 1
except gflags.Error as e:
print('e: ', e)
print('Usage: %s' % F)
return 1


if __name__ == '__main__':
sys.exit(main(sys.argv))
sys.exit(main())
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
absl-py
imageio
Pillow
36 changes: 36 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[metadata]
name = anishot
home-page = https://github.com/sourcerer-io/anishot
summary = Animate a long screenshot
description-file =
README.md
author = sourcerer-io
author-email = [email protected]
licence = MIT
classifier =
Development Status :: 5 - Production/Stable
Intended Audience :: Information Technology
License :: OSI Approved :: MIT License
Operating System :: POSIX
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6

[files]
packages =
anishot

[extras]
devel=
pbr

[entry_points]
console_scripts =
anishot = anishot.__main__:main

[wheel]
universal = 1
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from setuptools import setup

setup(
requires=['pbd'],
pbr=True,
long_description_content_type="text/markdown",
)

0 comments on commit 5c83687

Please sign in to comment.