parameters: ()
docstring: Main function of caption replacement script.
  
      Parses json-file with plot setups and runs the caption replacement
      for each plot setup.
docstring_summary: Main function of caption replacement script.
docstring_tokens: Main function of caption replacement script .
function: def main():
      """
      Main function of caption replacement script.
  
      Parses json-file with plot setups and runs the caption replacement
      for each plot setup.
      """
  
      if os.path.exists(sys.argv[1]):
          # first argument is the JSON plot definition setup file
          with open(sys.argv[1]) as plotsetup:
              plotdefs = json.load(plotsetup)
      else:
          raise ValueError('No plot definition file entered')
  
      plots = []
      # second argument is the projections documentation directory
      outdir = sys.argv[2]
  
      for i, plotdef in enumerate(plotdefs):
          if plots != [] and plotdef['name'] not in plots:
              continue
  
          print(i, plotdef['projstring'])
          if 'skip' in plotdef.keys():
              print('skipping')
              continue
  
          update_caption(plotdef['name'],
                         plotdef['projstring'],
                         outdir)
function_tokens: def main ( ) : if os . path . exists ( sys . argv [ 1 ] ) : # first argument is the JSON plot definition setup file with open ( sys . argv [ 1 ] ) as plotsetup : plotdefs = json . load ( plotsetup ) else : raise ValueError ( 'No plot definition file entered' ) plots = [ ] # second argument is the projections documentation directory outdir = sys . argv [ 2 ] for i , plotdef in enumerate ( plotdefs ) : if plots != [ ] and plotdef [ 'name' ] not in plots : continue print ( i , plotdef [ 'projstring' ] ) if 'skip' in plotdef . keys ( ) : print ( 'skipping' ) continue update_caption ( plotdef [ 'name' ] , plotdef [ 'projstring' ] , outdir )