File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed
Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change 1111from util import par_dir , mkdir_p
1212from leetcode import Leetcode
1313from lintcode import Lintcode
14+ from summary import update_summary
1415from ojhtml2markdown import problem2md
1516
1617BASEDIR = 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 )
You can’t perform that action at this time.
0 commit comments