~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to config/pandora-plugin

  • Committer: Joseph Daly
  • Date: 2010-09-28 01:43:36 UTC
  • mfrom: (1799 staging)
  • mto: (1799.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1800.
  • Revision ID: jdaly@rx7-20100928014336-wxjexq5c8js3cs8v
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
plugin_am_file=None
27
27
plugin_ac_file=None
 
28
plugin_doc_index=None
28
29
 
29
30
class ChangeProtectedFile(object):
30
31
 
191
192
 
192
193
  write_plugin_ac(plugin, plugin_ac_file)
193
194
  write_plugin_am(plugin, plugin_am_file)
 
195
  write_plugin_docs(plugin, plugin_doc_index)
194
196
  plugin['writing_status'] = 'done'
195
197
 
 
198
def write_plugin_docs(plugin, doc_index):
 
199
  if plugin['docs'] is not None and os.path.isdir("docs/plugins"):
 
200
    if not os.path.exists(os.path.join("docs/plugins",plugin["name"])):
 
201
      os.symlink(os.path.abspath(plugin["docs"]), os.path.join("docs/plugins",plugin["name"]))
 
202
    doc_index.write("""
 
203
   %(name)s/index""" % plugin)
 
204
 
196
205
def write_plugin_ac(plugin, plugin_ac):
197
206
  #
198
207
  # Write plugin config instructions into plugin.ac file.
351
360
    return ""
352
361
  return None
353
362
 
 
363
def find_docs(plugin_dir):
 
364
  if os.path.isfile(os.path.join(plugin_dir, "docs", "index.rst")):
 
365
    return os.path.join(plugin_dir, "docs")
 
366
 
354
367
def read_plugin_ini(plugin_dir):
355
368
    if plugin_dir == ".":
356
369
      plugin_name="**OUT-OF-TREE**"
420
433
        plugin['testsuite']=True
421
434
      else:
422
435
        plugin['testsuite']=False
 
436
    plugin['docs']= find_docs(plugin_dir)
423
437
 
424
438
    plugin['cflags']+= ' ' + config['extra_cflags']
425
439
    plugin['cppflags']+= ' ' + config['extra_cppflags']
485
499
      plugin_am.write("EXTRA_DIST += %(rel_path)s/%(testsuitedir)s\n" % plugin)
486
500
  if plugin.has_key('dist_testsuite') and plugin['dist_testsuite'] != "":
487
501
    plugin_am.write("EXTRA_DIST += %(rel_path)s/%(dist_testsuite)s\n" % plugin)
 
502
  if plugin['docs'] is not None:
 
503
    plugin_am.write("EXTRA_DIST += ${top_srcdir}/%(rel_path)s/docs/*.rst\n" % plugin)
488
504
  if plugin['static']:
489
505
    plugin_am.write("""
490
506
%(root_plugin_dir)s_%(plugin_prefix)s%(name)s_dir=${top_srcdir}/%(rel_path)s
600
616
             accumulate_plugins,
601
617
             plugin_list)
602
618
 
603
 
 
604
619
if not os.path.exists("config/pandora-plugin.am") or "write" in actions:
605
620
  plugin_am_file = ChangeProtectedFile(os.path.join('config', 'pandora-plugin.am'))
606
621
  plugin_am_file.write("""
631
646
  plugin_ac_file = ChangeProtectedFile(os.path.join('config', 'pandora-plugin.ac'))
632
647
  plugin_ac_file.write("dnl Generated file, run make to rebuild\n")
633
648
 
 
649
if os.path.exists("docs/plugins"):
 
650
  if not os.path.exists("docs/plugins/list.rst") or "write" in actions:
 
651
    plugin_doc_index = ChangeProtectedFile("docs/plugins/list.rst")
 
652
    plugin_doc_index.write("""
 
653
Plugin Documentation
 
654
====================
 
655
 
 
656
.. toctree::
 
657
   :maxdepth: 2
 
658
""")
 
659
 
634
660
 
635
661
if os.path.exists('plugin.ini'):
636
662
  # Are we in a plugin dir which wants to have a self-sufficient build system?
672
698
  plugin_am_file.close()
673
699
if plugin_ac_file is not None:
674
700
  plugin_ac_file.close()
 
701
if plugin_doc_index is not None:
 
702
  plugin_doc_index.close()