mirror of
https://source.perfectable.org/nivertius/napi.git
synced 2025-07-01 21:15:21 +02:00
command line option for language
This commit is contained in:
parent
c467260b65
commit
4e587aec00
1 changed files with 12 additions and 4 deletions
16
napi
16
napi
|
@ -27,14 +27,22 @@ base_url = "http://napiprojekt.pl/api/api-napiprojekt3.php"
|
|||
password = "iBlm8NTigvru0Jr0"
|
||||
input_filename = '/tmp/napi-temp-file'
|
||||
|
||||
from getopt import getopt
|
||||
|
||||
opts, args = getopt(sys.argv[1:], '', ['language='])
|
||||
|
||||
language = "PL"
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print "usage: %s <movie>" % sys.argv[0]
|
||||
sys.exit(2)
|
||||
for optname, optvalue in opts:
|
||||
if optname == '--language':
|
||||
language = optvalue
|
||||
|
||||
if len(args) < 1:
|
||||
print "usage: %s <movie>" % (sys.argv[0],)
|
||||
sys.exit(0)
|
||||
|
||||
d = md5.new()
|
||||
movie_filename = sys.argv[1]
|
||||
movie_filename = args[0]
|
||||
try:
|
||||
with open(movie_filename, "r") as movie_file:
|
||||
d.update(movie_file.read(10485760))
|
||||
|
|
Loading…
Add table
Reference in a new issue