def parse_django_adminopt_node(env, sig, signode):
 try:
  from sphinx.domains.std import option_desc_re
 except ImportError:
  from sphinx.directives.desc import option_desc_re
 count = 0
 firstname = ''
 for m in option_desc_re.finditer(sig):
  (optname, args) = m.groups()
  if count:
   signode += addnodes.desc_addname(', ', ', ')
  signode += addnodes.desc_name(optname, optname)
  signode += addnodes.desc_addname(args, args)
  if (not count):
   firstname = optname
  count += 1
 if (not count):
  for m in simple_option_desc_re.finditer(sig):
   (optname, args) = m.groups()
   if count:
    signode += addnodes.desc_addname(', ', ', ')
   signode += addnodes.desc_name(optname, optname)
   signode += addnodes.desc_addname(args, args)
   if (not count):
    firstname = optname
   count += 1
 if (not firstname):
  raise ValueError
 return firstname

def parse_django_adminopt_node ( env , sig , signode ) : try : from sphinx . domains . std import option_desc_re except ImportError : from sphinx . directives . desc import option_desc_re count = 0 firstname = '' for m in option_desc_re . finditer ( sig ) : ( optname , args ) = m . groups ( ) if count : signode += addnodes . desc_addname ( ', ' , ', ' ) signode += addnodes . desc_name ( optname , optname ) signode += addnodes . desc_addname ( args , args ) if ( not count ) : firstname = optname count += 1 if ( not count ) : for m in simple_option_desc_re . finditer ( sig ) : ( optname , args ) = m . groups ( ) if count : signode += addnodes . desc_addname ( ', ' , ', ' ) signode += addnodes . desc_name ( optname , optname ) signode += addnodes . desc_addname ( args , args ) if ( not count ) : firstname = optname count += 1 if ( not firstname ) : raise ValueError return firstname
a copy of sphinx .