Skip to content

Commit 96c3379

Browse files
author
burkean
committed
Allow for installation of pythonbits via pip.
- Renamed and moved modules into a Python package. - Added an __init__.py to make importing smoother. - Added '.txt' to requirements as per pip's documentation. - Created a setup.py. This needs reviewing! - Generated a package manifest. - Modified the README to give the new installation instructions. (This needs checking after pull request!) - Moved the user-facing script into bin directory so that pip will automagically install it in the correct place and chmod it for use. - Updated the shebang line in bin/pythonbits from 'python' to 'python2' to prevent the wrong interpreter being selected on hipster Linux distributions that ship with python3 as system /usr/bin/python.
1 parent 5d5d9b7 commit 96c3379

File tree

12 files changed

+46
-14
lines changed

12 files changed

+46
-14
lines changed

MANIFEST

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
setup.py
2+
bin/pythonbits
3+
pythonbits/Ffmpeg.py
4+
pythonbits/ImageUploader.py
5+
pythonbits/ImdbParser.py
6+
pythonbits/Screenshots.py
7+
pythonbits/TvdbParser.py
8+
pythonbits/TvdbUnitTests.py
9+
pythonbits/__init__.py

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
#### A Python description generator for movies and TV shows
33

44
## Install
5-
1. Put all files in your $PATH, and make sure pythonbits.py is executable
65

7-
2. Use pip (https://github.com/pypa/pip) to install dependencies: pip install -r requirements
6+
$ [sudo] pip install https://github.com/Ichabond/Pythonbits/archive/master.zip
7+
$ pythonbits --help
8+
9+
Python 2 is required. The correct version of pip may be called `pip2` on some platforms.
810

911
## Usage
10-
Use pythonbits.py --help to get a usage overview
12+
Use `pythonbits --help` to get a usage overview

pythonbits.py renamed to bin/pythonbits

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python2
22
# encoding: utf-8
33
"""
44
Pythonbits2.py
@@ -12,16 +12,10 @@
1212
import sys
1313
import os
1414
import subprocess
15-
16-
import ImdbParser
17-
import TvdbParser
18-
19-
from Screenshots import createScreenshots
20-
21-
from ImageUploader import upload
22-
2315
from optparse import OptionParser
2416

17+
from pythonbits import IMDB, TVDB, createScreenshots, upload
18+
2519

2620
def generateSeriesSummary(summary):
2721
description = "[b]Description[/b] \n"
@@ -127,7 +121,7 @@ def main(argv):
127121
for shot in screenshot:
128122
print shot
129123
elif options.season or options.episode:
130-
tvdb = TvdbParser.TVDB()
124+
tvdb = TVDB()
131125
if options.season:
132126
tvdb.search(search_string, season=options.season)
133127
if options.episode:
@@ -144,7 +138,7 @@ def main(argv):
144138
summary += "[mediainfo]\n%s\n[/mediainfo]" % mediainfo
145139
print summary
146140
else:
147-
imdb = ImdbParser.IMDB()
141+
imdb = IMDB()
148142
imdb.search(search_string)
149143
imdb.movieSelector()
150144
summary = imdb.summary()
File renamed without changes.
File renamed without changes.
File renamed without changes.

pythonbits/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from ImdbParser import IMDB
2+
from TvdbParser import TVDB
3+
from Screenshots import createScreenshots
4+
from ImageUploader import upload
5+
6+
__all__ = ['IMDB', 'TVDB', 'createScreenshots', 'upload']
7+
8+

0 commit comments

Comments
 (0)