How to use the cog.RunCogInFiles function in cog

To help you get started, weโ€™ve selected a few cog examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fabioz / LiClipseText / plugins / org.brainwy.liclipsetext.editor / install.py View on Github external
with file(plugin_file, 'r') as f:
        for line in f.readlines():
            if line.strip().startswith('EDITORS_LST = '):
                found = True
                line = '    EDITORS_LST = %s\n' % (lst,)
            new_lines.append(line)
    assert found
    with file(plugin_file, 'w') as f:
        f.write(''.join(new_lines))

    cog.RunCogInFiles([plugin_file])
    cog.RunCogInFiles([
        os.path.join(parent_dir, 'src', 'org', 'brainwy', 'liclipsetext', 'editor', 'common',
            'partitioning', 'rules', 'RulesFactory.java')])
    cog.RunCogInFiles([os.path.join(parent_dir, 'languages', 'html.liclipse')])
    cog.RunCogInFiles([os.path.join(parent_dir, 'languages', 'dart.liclipse')])


    base_compare = os.path.join(parent_dir, 'src', 'org', 'brainwy', 'liclipsetext', 'editor', 'compare')


    for x in lst:
        x['kind_upper'] = x['kind'].title().replace(' ', '').replace('.', '')

        template = '''// Automatically Generated in install.py
package org.brainwy.liclipsetext.editor.compare;

public class %(kind_upper)sContentViewerCreator extends AbstractContentViewerCreator {

    public %(kind_upper)sContentViewerCreator() {
        super("%(kind)s");
    }
github fabioz / LiClipseText / plugins / org.brainwy.liclipsetext.editor / install.py View on Github external
]

    plugin_file = os.path.join(parent_dir, 'plugin.xml')
    new_lines = []
    found = False
    with file(plugin_file, 'r') as f:
        for line in f.readlines():
            if line.strip().startswith('EDITORS_LST = '):
                found = True
                line = '    EDITORS_LST = %s\n' % (lst,)
            new_lines.append(line)
    assert found
    with file(plugin_file, 'w') as f:
        f.write(''.join(new_lines))

    cog.RunCogInFiles([plugin_file])
    cog.RunCogInFiles([
        os.path.join(parent_dir, 'src', 'org', 'brainwy', 'liclipsetext', 'editor', 'common',
            'partitioning', 'rules', 'RulesFactory.java')])
    cog.RunCogInFiles([os.path.join(parent_dir, 'languages', 'html.liclipse')])
    cog.RunCogInFiles([os.path.join(parent_dir, 'languages', 'dart.liclipse')])


    base_compare = os.path.join(parent_dir, 'src', 'org', 'brainwy', 'liclipsetext', 'editor', 'compare')


    for x in lst:
        x['kind_upper'] = x['kind'].title().replace(' ', '').replace('.', '')

        template = '''// Automatically Generated in install.py
package org.brainwy.liclipsetext.editor.compare;
github fabioz / Pydev / builders / org.python.pydev.build / install.py View on Github external
def RunCog():
    #Add cog to the pythonpath
    cog_dir = parent_dir[:parent_dir.index('builders')]
    cog_src_dir = os.path.join(cog_dir, 'builders', 'org.python.pydev.build', 'cog_src')
    assert os.path.exists(cog_src_dir), '%s does not exist' % (cog_src_dir,)
    sys.path.append(cog_src_dir)

    import cog
    cog.RunCogInFiles([os.path.join(parent_dir, 'customTargets.xml')])
github fabioz / Pydev / plugins / org.python.pydev.django_templates / install.py View on Github external
def RunCog():
    #Add cog to the pythonpath
    cog_dir = parent_dir[:parent_dir.index('plugins')]
    cog_src_dir = os.path.join(cog_dir, 'builders', 'org.python.pydev.build', 'cog_src')
    assert os.path.exists(cog_src_dir), '%s does not exist' % (cog_src_dir,)
    sys.path.append(cog_src_dir)
    
    import cog
    cog.RunCogInFiles([
        os.path.join(parent_dir, 'templates', 'default-templates-tags.xml'),
        os.path.join(parent_dir, 'templates', 'default-templates-filters.xml'),
    ])