Skip to content

Commit 750174b

Browse files
committed
fix none new parameter
1 parent 866bc10 commit 750174b

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

scripts/main.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from util import par_dir, mkdir_p
1212
from leetcode import Leetcode
1313
from lintcode import Lintcode
14+
from summary import update_summary
1415
from ojhtml2markdown import problem2md
1516

1617
BASEDIR = os.path.abspath(os.path.dirname(__file__))
@@ -36,19 +37,20 @@ def curr_time():
3637
print('Called with arguments: {}'.format(args))
3738

3839
ROOTDIR = par_dir(BASEDIR)
39-
raw_url = args.new
40-
problem_md = ''
41-
problem_slug = ''
42-
xxxcode = None
43-
convert_desc = True
44-
if raw_url.startswith('https://leetcode'):
45-
xxxcode = Leetcode()
46-
elif raw_url.startswith('https://www.lintcode.com'):
47-
xxxcode = Lintcode()
48-
convert_desc = False
49-
problem = xxxcode.get_problem_all(raw_url)
50-
problem_slug = slugify(problem['title'], separator="_")
51-
problem_md = problem2md(problem, convert_desc)
40+
if args.new:
41+
raw_url = args.new
42+
problem_md = ''
43+
problem_slug = ''
44+
xxxcode = None
45+
convert_desc = True
46+
if raw_url.startswith('https://leetcode'):
47+
xxxcode = Leetcode()
48+
elif raw_url.startswith('https://www.lintcode.com'):
49+
xxxcode = Lintcode()
50+
convert_desc = False
51+
problem = xxxcode.get_problem_all(raw_url)
52+
problem_slug = slugify(problem['title'], separator="_")
53+
problem_md = problem2md(problem, convert_desc)
5254

5355
if args.dir:
5456
post_dir = os.path.join(ROOTDIR, args.dir)

0 commit comments

Comments
 (0)