Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yashLadha authored and meets2tarun committed Nov 25, 2017
1 parent 0770350 commit 92c05d4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ rpm -i pdftk-2.02-1.el6.x86_64.rpm
exit
```

For Arch based package managers:
```
sudo pacman -S python-cairosvg
sudo pacman -S python-lxml
sudo yaourt -S pdftk
```

Installation
--------------
Badgeyay can be easily deployed on a variety of platforms. Currently it can be deployed in following ways.
Expand Down
3 changes: 2 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def index():
def generate_badges(_pdf=True):
os.system('python3 ' + APP_ROOT + '/merge_badges.py -p')


def empty_directory():
"""
Function to check for empty directory existence
Expand Down Expand Up @@ -71,7 +72,7 @@ def upload():

# If default background is selected
if img != '':
if(img == 'user_defined.png'):
if (img == 'user_defined.png'):
bg_color = request.form['bg_color']
text_on_image = request.form['text_on_image']
do_svg2png(img, 1, bg_color, text_on_image)
Expand Down
3 changes: 1 addition & 2 deletions app/merge_badges.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
arguments = parser.parse_args()
_pdf = arguments.pdf


if subprocess.call(['which', 'python3']) != 0:
raise PackageNotFoundError("Package python3 not found")
if subprocess.call(['which', 'pdftk']) != 0:
Expand Down Expand Up @@ -41,6 +40,7 @@ def generate_pdfs(folder_path):
except Exception as e:
pass


# Generating PDF files from svg.
if _pdf:
for folder in input_folders:
Expand All @@ -60,4 +60,3 @@ def generate_pdfs(folder_path):

final_path = os.path.join(BADGES_FOLDER, 'all-badges.pdf')
subprocess.call('pdftk ' + BADGES_FOLDER + '/*.pdf cat output ' + final_path, shell=True)

0 comments on commit 92c05d4

Please sign in to comment.