mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Resolve some conflicts
This commit is contained in:
parent
e7293f1dee
commit
cf25b060e7
@ -88,7 +88,6 @@ def main(argv):
|
|||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(argv[1:], 'ab:t:d:c:CD:A:nNEqQWw:PThvj:',
|
opts, args = getopt.getopt(argv[1:], 'ab:t:d:c:CD:A:nNEqQWw:PThvj:',
|
||||||
['help', 'version'])
|
['help', 'version'])
|
||||||
<<<<<<< local
|
|
||||||
except getopt.error, err:
|
except getopt.error, err:
|
||||||
usage(argv, 'Error: %s' % err)
|
usage(argv, 'Error: %s' % err)
|
||||||
return 1
|
return 1
|
||||||
@ -98,8 +97,9 @@ def main(argv):
|
|||||||
# help and version options
|
# help and version options
|
||||||
if '-h' in allopts or '--help' in allopts:
|
if '-h' in allopts or '--help' in allopts:
|
||||||
usage(argv)
|
usage(argv)
|
||||||
print >>sys.stderr
|
print(file=sys.stderr)
|
||||||
print >>sys.stderr, 'For more information, see <http://sphinx-doc.org/>.'
|
print('For more information, see <http://sphinx-doc.org/>.',
|
||||||
|
file=sys.stderr)
|
||||||
return 0
|
return 0
|
||||||
if '--version' in allopts:
|
if '--version' in allopts:
|
||||||
print 'Sphinx (sphinx-build) %s' % __version__
|
print 'Sphinx (sphinx-build) %s' % __version__
|
||||||
@ -107,18 +107,6 @@ def main(argv):
|
|||||||
|
|
||||||
# get paths (first and second positional argument)
|
# get paths (first and second positional argument)
|
||||||
try:
|
try:
|
||||||
=======
|
|
||||||
allopts = set(opt[0] for opt in opts)
|
|
||||||
if '-h' in allopts or '--help' in allopts:
|
|
||||||
usage(argv)
|
|
||||||
print(file=sys.stderr)
|
|
||||||
print('For more information, see <http://sphinx-doc.org/>.',
|
|
||||||
file=sys.stderr)
|
|
||||||
return 0
|
|
||||||
if '--version' in allopts:
|
|
||||||
print('Sphinx (sphinx-build) %s' % __version__)
|
|
||||||
return 0
|
|
||||||
>>>>>>> other
|
|
||||||
srcdir = confdir = abspath(args[0])
|
srcdir = confdir = abspath(args[0])
|
||||||
if not path.isdir(srcdir):
|
if not path.isdir(srcdir):
|
||||||
print('Error: Cannot find source directory `%s\'.' % srcdir,
|
print('Error: Cannot find source directory `%s\'.' % srcdir,
|
||||||
@ -126,21 +114,10 @@ def main(argv):
|
|||||||
return 1
|
return 1
|
||||||
if not path.isfile(path.join(srcdir, 'conf.py')) and \
|
if not path.isfile(path.join(srcdir, 'conf.py')) and \
|
||||||
'-c' not in allopts and '-C' not in allopts:
|
'-c' not in allopts and '-C' not in allopts:
|
||||||
<<<<<<< local
|
print('Error: Source directory doesn\'t contain a conf.py file.',
|
||||||
print >>sys.stderr, ('Error: Source directory doesn\'t '
|
|
||||||
'contain a conf.py file.')
|
|
||||||
=======
|
|
||||||
print('Error: Source directory doesn\'t contain conf.py file.',
|
|
||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
>>>>>>> other
|
|
||||||
return 1
|
return 1
|
||||||
outdir = abspath(args[1])
|
outdir = abspath(args[1])
|
||||||
<<<<<<< local
|
|
||||||
=======
|
|
||||||
except getopt.error as err:
|
|
||||||
usage(argv, 'Error: %s' % err)
|
|
||||||
return 1
|
|
||||||
>>>>>>> other
|
|
||||||
except IndexError:
|
except IndexError:
|
||||||
usage(argv, 'Error: Insufficient arguments.')
|
usage(argv, 'Error: Insufficient arguments.')
|
||||||
return 1
|
return 1
|
||||||
@ -293,20 +270,15 @@ def main(argv):
|
|||||||
print(red('reST markup error:'), file=error)
|
print(red('reST markup error:'), file=error)
|
||||||
print(terminal_safe(err.args[0]), file=error)
|
print(terminal_safe(err.args[0]), file=error)
|
||||||
elif isinstance(err, SphinxError):
|
elif isinstance(err, SphinxError):
|
||||||
<<<<<<< local
|
|
||||||
print >>error, red('%s:' % err.category)
|
|
||||||
print >>error, terminal_safe(unicode(err))
|
|
||||||
elif isinstance(err, UnicodeError):
|
|
||||||
print >>error, red('Encoding error:')
|
|
||||||
print >>error, terminal_safe(unicode(err))
|
|
||||||
tbpath = save_traceback(app)
|
|
||||||
print >>error, red('The full traceback has been saved '
|
|
||||||
'in %s, if you want to report the '
|
|
||||||
'issue to the developers.' % tbpath)
|
|
||||||
=======
|
|
||||||
print(red('%s:' % err.category), file=error)
|
print(red('%s:' % err.category), file=error)
|
||||||
print(terminal_safe(unicode(err)), file=error)
|
print(terminal_safe(unicode(err)), file=error)
|
||||||
>>>>>>> other
|
elif isinstance(err, UnicodeError):
|
||||||
|
print(red('Encoding error:'), file=error)
|
||||||
|
print(terminal_safe(unicode(err)), file=error)
|
||||||
|
tbpath = save_traceback(app)
|
||||||
|
print(red('The full traceback has been saved in %s, if you want '
|
||||||
|
'to report the issue to the developers.' % tbpath),
|
||||||
|
file=error)
|
||||||
else:
|
else:
|
||||||
print(red('Exception occurred:'), file=error)
|
print(red('Exception occurred:'), file=error)
|
||||||
print(format_exception_cut_frames().rstrip(), file=error)
|
print(format_exception_cut_frames().rstrip(), file=error)
|
||||||
|
@ -618,16 +618,8 @@ class BuildEnvironment:
|
|||||||
pub.process_programmatic_settings(None, self.settings, None)
|
pub.process_programmatic_settings(None, self.settings, None)
|
||||||
pub.set_source(None, src_path.encode(fs_encoding))
|
pub.set_source(None, src_path.encode(fs_encoding))
|
||||||
pub.set_destination(None, None)
|
pub.set_destination(None, None)
|
||||||
<<<<<<< local
|
|
||||||
pub.publish()
|
pub.publish()
|
||||||
doctree = pub.document
|
doctree = pub.document
|
||||||
=======
|
|
||||||
try:
|
|
||||||
pub.publish()
|
|
||||||
doctree = pub.document
|
|
||||||
except UnicodeError as err:
|
|
||||||
raise SphinxError(str(err))
|
|
||||||
>>>>>>> other
|
|
||||||
|
|
||||||
# post-processing
|
# post-processing
|
||||||
self.filter_messages(doctree)
|
self.filter_messages(doctree)
|
||||||
|
Loading…
Reference in New Issue
Block a user