Commit b0033986 authored by Dave Lane's avatar Dave Lane
Browse files

fix option handling to make all optional

parent 6fe3789d
......@@ -7,11 +7,10 @@ from email.mime.text import MIMEText
import subprocess
import MySQLdb
#node = '/home/ubuntu/.nvm/versions/node/v4.2.1/bin/node'
node = '/usr/bin/nodejs'
weurl = 'https://wikieducator.org'
#weurl = 'https://c.wikieducator.org'
osdir = '/home/data/wikieducator.org/course-snapshot/src'
#weurl = 'https://c.wikieducator.org'
#osdir = '/home/data/c.wikieducator.org/course-snapshot/src'
debug = 0;
......@@ -101,32 +100,52 @@ elif opt['type'] == 'fs':
else:
result = 102
errmsg = 'Unknown snapshot type requested'
# brand info
if 'logo' in opt and opt['logo']:
args.extend(['--logo', opt['logo'],
'--link', opt['link'],
'--caption', opt['caption'],
'--name', opt['name']])
args.extend(['--logo', opt['logo']])
if 'link' in opt and opt['link']:
args.extend(['--link', opt['link']])
if 'caption' in opt and opt['caption']:
args.extend(['--caption', opt['caption']])
if 'name' in opt and opt['name']:
args.extend(['--name', opt['name']])
# brand 2
if 'logo2' in opt and opt['logo2']:
args.extend(['--logo2', opt['logo2'],
'--link2', opt['link2'],
'--caption2', opt['caption2'],
'--name2', opt['name2']])
args.extend(['--logo2', opt['logo2']])
if 'link2' in opt and opt['link2']:
args.extend(['--link2', opt['link2']])
if 'caption2' in opt and opt['caption2']:
args.extend(['--caption2', opt['caption2']])
if 'name2' in opt and opt['name2']:
args.extend(['--name2', opt['name2']])
# brand 3
if 'logo3' in opt and opt['logo3']:
args.extend(['--logo3', opt['logo3'],
'--link3', opt['link3'],
'--caption3', opt['caption3'],
'--name3', opt['name3']])
args.extend(['--logo3', opt['logo3']])
if 'link3' in opt and opt['link3']:
args.extend(['--link3', opt['link3']])
if 'caption3' in opt and opt['caption3']:
args.extend(['--caption3', opt['caption3']])
if 'name3' in opt and opt['name3']:
args.extend(['--name3', opt['name3']])
# brand 4
if 'logo4' in opt and opt['logo4']:
args.extend(['--logo4', opt['logo4'],
'--link4', opt['link4'],
'--caption4', opt['caption4'],
'--name4', opt['name4']])
args.extend(['--logo4', opt['logo4']])
if 'link4' in opt and opt['link4']:
args.extend(['--link', opt['link']])
if 'caption4' in opt and opt['caption4']:
args.extend(['--caption4', opt['caption4']])
if 'name4' in opt and opt['name4']:
args.extend(['--name4', opt['name4']])
# brand 5
if 'logo5' in opt and opt['logo5']:
args.extend(['--logo5', opt['logo5'],
'--link5', opt['link5'],
'--caption5', opt['caption5'],
'--name5', opt['name5']])
args.extend(['--logo5', opt['logo5']])
if 'link5' in opt and opt['link5']:
args.extend(['--link5', opt['link5']])
if 'caption5' in opt and opt['caption5']:
args.extend(['--caption5', opt['caption5']])
if 'name5' in opt and opt['name5']:
args.extend(['--name5', opt['name5']])
# other options
if 'previous' in opt and opt['previous']:
args.extend(['--previous', opt['previous']])
if 'next' in opt and opt['next']:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment