1
1
# -*- coding: utf-8 -*-
2
-
2
+ from __future__ import absolute_import , division , print_function
3
3
import sys
4
4
import time
5
5
import datetime
@@ -559,7 +559,10 @@ def ask_user(d):
559
559
print (bold ('Selected root path: %s' % d ['path' ]))
560
560
else :
561
561
print ('Enter the root path for your blog project.' )
562
- do_prompt (d , 'path' , 'Root path for your project' , '.' , is_path )
562
+ if SPHINX_LT_17 :
563
+ do_prompt (d , 'path' , 'Root path for your project' , '.' , is_path )
564
+ else :
565
+ d ['path' ] = do_prompt ('Root path for your project' , '.' , is_path )
563
566
564
567
while path .isfile (path .join (d ['path' ], 'conf.py' )) or \
565
568
path .isfile (path .join (d ['path' ], 'source' , 'conf.py' )):
@@ -568,8 +571,10 @@ def ask_user(d):
568
571
'selected root path.' )))
569
572
print ('ablog start will not overwrite existing Sphinx projects.' )
570
573
print ('' )
571
- do_prompt (d , 'path' ,
572
- 'Please enter a new root path (or just Enter to exit)' , '' , is_path )
574
+ if SPHINX_LT_17 :
575
+ do_prompt (d , 'path' ,'Please enter a new root path (or just Enter to exit)' , '' , is_path )
576
+ else :
577
+ d ['path' ] = do_prompt ('Please enter a new root path (or just Enter to exit)' , '' , is_path )
573
578
if not d ['path' ]:
574
579
sys .exit (1 )
575
580
@@ -579,14 +584,20 @@ def ask_user(d):
579
584
'including blog archive pages and atom feeds. Later, you can '
580
585
'set separate names for different parts of the website in '
581
586
'configuration file.' ))
582
- do_prompt (d , 'project' , 'Project name' )
587
+ if SPHINX_LT_17 :
588
+ do_prompt (d , 'project' , 'Project name' )
589
+ else :
590
+ d ['project' ] = do_prompt ('Project name' )
583
591
584
592
if 'author' not in d :
585
593
print (w ('This of author as the copyright holder of the content. '
586
594
'If your blog has multiple authors, you might want to enter '
587
595
'a team name here. Later, you can specify individual authors '
588
596
'using `blog_authors` configuration option.' ))
589
- do_prompt (d , 'author' , 'Author name(s)' )
597
+ if SPHINX_LT_17 :
598
+ do_prompt (d , 'author' , 'Author name(s)' )
599
+ else :
600
+ d ['author' ] = do_prompt ('Author name(s)' )
590
601
591
602
d ['release' ] = d ['version' ] = ''
592
603
@@ -597,16 +608,22 @@ def ask_user(d):
597
608
'selected root path.' % (d ['master' ] + d ['suffix' ]))))
598
609
print ('ablog-start will not overwrite the existing file.' )
599
610
print ('' )
600
- do_prompt (d , 'master' , w ('Please enter a new file name, or rename the '
601
- 'existing file and press Enter' ), d ['master' ])
611
+ if SPHINX_LT_17 :
612
+ do_prompt (d , 'master' , w ('Please enter a new file name, or rename the '
613
+ 'existing file and press Enter' ), d ['master' ])
614
+ else :
615
+ d ['master' ] = do_prompt (w ('Please enter a new file name, or rename the '
616
+ 'existing file and press Enter' ), d ['master' ])
602
617
603
618
if 'blog_baseurl' not in d :
604
619
print ('' )
605
620
print (w ('Please enter the base URL for your project. Blog feeds will '
606
621
'be generated relative to this URL. If you don\' t have one yet, '
607
622
'you can set it in configuration file later.' ))
608
- do_prompt (d , 'blog_baseurl' , 'Base URL for your project' ,
609
- None , lambda x : True )
623
+ if SPHINX_LT_17 :
624
+ do_prompt (d , 'blog_baseurl' , 'Base URL for your project' , None , lambda x : True )
625
+ else :
626
+ d ['blog_baseurl' ] = do_prompt ('Base URL for your project' , None , lambda x : True )
610
627
611
628
print ('' )
612
629
0 commit comments