Skip to content

Commit

Permalink
update setup.py and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
roybs2 committed Feb 23, 2019
1 parent 244f222 commit b206832
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You have 3 methods you can use:
You can install the watermark-image from PyPI:

```sh
$ pip install watermark-image
$ pip install watermarkImage
```

You have 3 methods you can use:
Expand Down
15 changes: 6 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,22 @@

# This call to setup() does all the work
setup(
name="watermark-image",
name="watermarkImage",
version="1.0.0",
description="Watermark batch of images",
long_description=README,
long_description_content_type="text/markdown",
url="",
download_url="https://github.com/roybs2/watermark-image/archive/v1.0.0.tar.gz",
url="https://github.com/roybs2/watermark-image",
author="Roy Ben Shlomo",
license="MIT",
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5.4",
"Programming Language :: Python :: 3.5",
],
packages=["watermark-image"],
packages=["watermarkImage"],
include_package_data=True,
install_requires=["pillow"],
entry_points={
"console_scripts": [
"watermark-image=watermark-image.__main__:main",
]
},
entry_points={"console_scripts": ["watermarkImage=watermarkImage.Logic:main"]},
)
31 changes: 29 additions & 2 deletions watermarkImage/WatermarkLogic.py → watermarkImage/Logic.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PIL
from PIL import Image
import os
from watermark.Position import Position
from watermarkImage.Position import Position


def changeOpacity(logoImage, opacityNumber):
Expand Down Expand Up @@ -117,4 +117,31 @@ def watermarkList(listOfImages, logo, position=Position.BOTTOM_RIGHT, opacity=5,
return listOfNewImages
except Exception as e:
print('Something went wrong.')
print(e.args)
print(e.args)


def main(dirToSearch, logo, opacity, size):
watermarkDir(dirToSearch, logo,)



if __name__ == "__main__":
import argparse
print('here')
parser = argparse.ArgumentParser(description='Watermark logo image')
parser.add_argument('-dir', action="store", dest='dir', default=0)
parser.add_argument('-logo', action="store", dest='logo', default=0)
parser.add_argument('-opacity', action="store", dest='opacity', default=5)
parser.add_argument('-size', action="store", dest='size', default=2)
parser.add_argument('-position', action="store", dest='position', default=4)
parser.add_argument('-newPath', action="store", dest='newPath', default=os.getcwd()+'\\new')
args = parser.parse_args()
print(args)
dir = args.dir
logo = Image.open(args.logo)
opacity = args.opacity
size = args.size
position = args.position

list = watermarkDir(dir, logo, position, opacity, size)
saveImages(list, args.newPath)

0 comments on commit b206832

Please sign in to comment.