You've already forked gnatstudio
mirror of
https://github.com/AdaCore/gnatstudio.git
synced 2026-02-12 12:42:33 -08:00
git-svn-id: svn+ssh://svn.eu/Dev/importfromcvs/trunk@88880 936e1b1b-40f2-da11-902a-00137254ae57
21 lines
708 B
Python
21 lines
708 B
Python
## This file provides a basic implementation for skeletons.
|
|
## Whenever a new file is created, it inserts a skeleton at the beginning
|
|
## of the file.
|
|
|
|
## Possible enhancements: if we knew the type/language of the file, we could
|
|
## insert one skeleton or another
|
|
|
|
import GPS, os.path
|
|
|
|
skeleton="""------------------------------------------------------------------
|
|
-- Demo for a skeleton, see skeleton.py in the GPS installation --
|
|
------------------------------------------------------------------
|
|
"""
|
|
|
|
def add_skeleton (hook_name, file):
|
|
# Only for new files:
|
|
if not os.path.exists (file.name()):
|
|
GPS.Editor.replace_text (file.name(), 1, 1, skeleton)
|
|
|
|
GPS.Hook ("file_edited").add (add_skeleton)
|