예제 #1
0
class PyResourceBitmapModel(PythonEditorModels.ModuleModel):
    modelIdentifier = 'PyImgResource'
    bitmap = 'PyResBitmap.png'
    imgIdx = EditorHelper.imgPyResBitmap = EditorHelper.imgIdxRange()

    def updateData(self, data, subImage):
        from wx.tools import img2py
        crunched = StringIO(img2py.crunch_data(data, subImage['zip'])).readlines()
        if subImage['zip']:
            crunched[-1].rstrip()
            crunched[-1] += ' )'+subImage['eol']
        srcLines = self.getDataAsLines()
        srcLines[subImage['start']:subImage['end']] = crunched + [subImage['eol']]

        self.setDataFromLines(srcLines)
        self.modified = True

        subImage['data'] = data
예제 #2
0
import os

import wx
import wx.stc

import Preferences, Utils, Plugins
from Utils import _

import PaletteStore

from Models import Controllers, EditorHelper, EditorModels
from Views import SourceViews, StyledTextCtrls

# Allocate an image index for Java files
EditorHelper.imgJavaModel = EditorHelper.imgIdxRange()

Plugins.registerPreference('JavaSupport', 'jsJavaCompilerPath', "''",
                           ['Path to the compiler'], 'type: filepath')

class JavaModel(EditorModels.SourceModel):
    modelIdentifier = 'Java'
    defaultName = 'java'  # default name given to newly created files
    bitmap = 'Java.png' # this image must exist in Images/Modules
    ext = '.java'
    imgIdx = EditorHelper.imgJavaModel

# get the style definitions file in either the prefs directory or the Boa root
java_cfgfile = os.path.join(Preferences.rcPath, 'stc-java.rc.cfg')
#if not os.path.exists(java_cfgfile):
#    java_cfgfile = Preferences.pyPath +'/Plug-ins/stc-java.rc.cfg'
예제 #3
0
# Define new zope image and a Model for opening in the Editor
from ZopeLib.ZopeEditorModels import addZOAImage, ZOAIcons, ZopeDocumentModel, ZopeController
import Models
from Models import Controllers, EditorHelper
from Models.HTMLSupport import HTMLFileModel, HTMLFileController, HTMLFileView

addZOAImage('Page Template', 'Images/ZOA/ZopePageTemplate.png')
addZOAImage('Filesystem Page Template', 'Images/ZOA/ZopePageTemplate.png')


class ZopePageTemplateModel(ZopeDocumentModel):
    imgIdx = ZOAIcons['Page Template']


EditorHelper.imgZopePTFSModel = EditorHelper.imgIdxRange()


class ZopePageTemplateFSModel(HTMLFileModel):
    modelIdentifier = 'PageTemplateHTML'
    defaultName = 'pagetemplate'
    bitmap = 'ZopePageTemplate_s.png'
    imgIdx = EditorHelper.imgZopePTFSModel
    ext = '.pt'


EditorHelper.modelReg[
    ZopePageTemplateFSModel.modelIdentifier] = ZopePageTemplateFSModel
EditorHelper.extMap['.pt'] = ZopePageTemplateFSModel
EditorHelper.extMap['.zpt'] = ZopePageTemplateFSModel
import os

import wx
import wx.stc

import Preferences, Utils, Plugins
from Utils import _

import PaletteStore

from Models import Controllers, EditorHelper, EditorModels
from Views import SourceViews, StyledTextCtrls
from Explorers import ExplorerNodes

# Allocate an image index for Pascal files
EditorHelper.imgPascalModel = EditorHelper.imgIdxRange()

# Register plug-in preference
Plugins.registerPreference('PascalSupport', 'psPascalCompilerPath', "''",
                           ['Path to the compiler'], 'type: filepath')

class PascalModel(EditorModels.SourceModel):
    modelIdentifier = 'Pascal'
    defaultName = 'pascal'  # default name given to newly created files
    bitmap = 'Pascal.png' # this image must exist in Images/Modules
    ext = '.pas'
    imgIdx = EditorHelper.imgPascalModel

# get the style definitions file in either the prefs directory or the Boa root
pascal_cfgfile = Preferences.rcPath +'/stc-pascal.rc.cfg'
import os

import wx
import wx.stc

import Preferences, Utils, Plugins
from Utils import _

import PaletteStore

from Models import Controllers, EditorHelper, EditorModels
from Views import SourceViews, StyledTextCtrls
from Explorers import ExplorerNodes

# Allocate an image index for Pascal files
EditorHelper.imgPascalModel = EditorHelper.imgIdxRange()

# Register plug-in preference
Plugins.registerPreference('PascalSupport', 'psPascalCompilerPath', "''",
                           ['Path to the compiler'], 'type: filepath')


class PascalModel(EditorModels.SourceModel):
    modelIdentifier = 'Pascal'
    defaultName = 'pascal'  # default name given to newly created files
    bitmap = 'Pascal.png'  # this image must exist in Images/Modules
    ext = '.pas'
    imgIdx = EditorHelper.imgPascalModel


# get the style definitions file in either the prefs directory or the Boa root
예제 #6
0
to run the link app module itself from the IDE!

Linked apps can be chained but beware of cycles! ;)

Only proxies the run and debug methods to the parent app.

"""

import wx

import Plugins

import sourceconst
from Models import PythonEditorModels, PythonControllers, EditorHelper, Controllers

EditorHelper.imgLinkAppModel = EditorHelper.imgIdxRange()


class LinkAppModel(PythonEditorModels.PyAppModel):
    modelIdentifier = 'LinkApp'
    defaultName = 'LinkApp'
    bitmap = 'LinkApp_s.png'
    imgIdx = EditorHelper.imgLinkAppModel

    #    def getDefaultData(self):
    #        return sourceconst.defSig %{'modelIdent':self.modelIdentifier, 'main': ''}

    def findAppInModules(self, args):
        for name, Model in self.moduleModels.items():
            if Model.modelIdentifier in Controllers.appModelIdReg:
                filepath = self.moduleFilename(name)
예제 #7
0
import wx
import wx.stc

import Preferences, Utils, Plugins
from Utils import _

try:
    imp.find_module('Pyrex')
except ImportError:
    raise Plugins.SkipPlugin, _('Pyrex is not installed')

from Models import Controllers, EditorHelper, EditorModels, PythonEditorModels, PythonControllers
from Views import SourceViews, StyledTextCtrls

EditorHelper.imgPyrexModel = EditorHelper.imgIdxRange()

class PyrexModel(EditorModels.SourceModel):
    modelIdentifier = 'Pyrex'
    defaultName = 'pyrex'
    bitmap = 'Pyrex.png'
    ext = '.pyx'
    imgIdx = EditorHelper.imgPyrexModel

pyrex_cfgfile = os.path.join(Preferences.rcPath, 'stc-pyrex.rc.cfg')
#if not os.path.exists(pyrex_cfgfile):
#    pyrex_cfgfile = Preferences.pyPath +'/Plug-ins/stc-pyrex.rc.cfg'

class PyrexStyledTextCtrlMix(StyledTextCtrls.LanguageSTCMix):
    def __init__(self, wId):
        StyledTextCtrls.LanguageSTCMix.__init__(self, wId,
예제 #8
0
to run the link app module itself from the IDE!

Linked apps can be chained but beware of cycles! ;)

Only proxies the run and debug methods to the parent app.

"""

import wx

import Plugins

import sourceconst
from Models import PythonEditorModels, PythonControllers, EditorHelper, Controllers

EditorHelper.imgLinkAppModel = EditorHelper.imgIdxRange()

class LinkAppModel(PythonEditorModels.PyAppModel):
    modelIdentifier = 'LinkApp'
    defaultName = 'LinkApp'
    bitmap = 'LinkApp_s.png'
    imgIdx = EditorHelper.imgLinkAppModel

#    def getDefaultData(self):
#        return sourceconst.defSig %{'modelIdent':self.modelIdentifier, 'main': ''}

    def findAppInModules(self, args):
        for name, Model in self.moduleModels.items():
            if Model.modelIdentifier in Controllers.appModelIdReg:
                filepath = self.moduleFilename(name)
                if self.editor.modules.has_key(filepath):
예제 #9
0
#---Model-----------------------------------------------------------------------

# Define new zope image and a Model for opening in the Editor
from ZopeLib.ZopeEditorModels import addZOAImage, ZOAIcons, ZopeDocumentModel, ZopeController
import Models
from Models import Controllers, EditorHelper
from Models.HTMLSupport import HTMLFileModel, HTMLFileController, HTMLFileView

addZOAImage('Page Template', 'Images/ZOA/ZopePageTemplate.png')
addZOAImage('Filesystem Page Template', 'Images/ZOA/ZopePageTemplate.png')

class ZopePageTemplateModel(ZopeDocumentModel):
    imgIdx = ZOAIcons['Page Template']

EditorHelper.imgZopePTFSModel = EditorHelper.imgIdxRange()

class ZopePageTemplateFSModel(HTMLFileModel):
    modelIdentifier = 'PageTemplateHTML'
    defaultName = 'pagetemplate'
    bitmap = 'ZopePageTemplate_s.png'
    imgIdx = EditorHelper.imgZopePTFSModel
    ext = '.pt'

EditorHelper.modelReg[ZopePageTemplateFSModel.modelIdentifier] = ZopePageTemplateFSModel
EditorHelper.extMap['.pt'] = ZopePageTemplateFSModel
EditorHelper.extMap['.zpt'] = ZopePageTemplateFSModel

#---Views-----------------------------------------------------------------------

from ZopeLib import ZopeViews
예제 #10
0
import os

import wx
import wx.stc

import Preferences, Utils, Plugins
from Utils import _

import PaletteStore

from Models import Controllers, EditorHelper, EditorModels
from Views import SourceViews, StyledTextCtrls

# Allocate an image index for Java files
EditorHelper.imgJavaModel = EditorHelper.imgIdxRange()

Plugins.registerPreference('JavaSupport', 'jsJavaCompilerPath', "''",
                           ['Path to the compiler'], 'type: filepath')

class JavaModel(EditorModels.SourceModel):
    modelIdentifier = 'Java'
    defaultName = 'java'  # default name given to newly created files
    bitmap = 'Java.png' # this image must exist in Images/Modules
    ext = '.java'
    imgIdx = EditorHelper.imgJavaModel

# get the style definitions file in either the prefs directory or the Boa root
java_cfgfile = os.path.join(Preferences.rcPath, 'stc-java.rc.cfg')
#if not os.path.exists(java_cfgfile):
#    java_cfgfile = Preferences.pyPath +'/Plug-ins/stc-java.rc.cfg'
예제 #11
0
import wx
import wx.stc

import Preferences, Utils, Plugins
from Utils import _

try:
    imp.find_module('Pyrex')
except ImportError:
    raise Plugins.SkipPlugin, _('Pyrex is not installed')

from Models import Controllers, EditorHelper, EditorModels, PythonEditorModels, PythonControllers
from Views import SourceViews, StyledTextCtrls

EditorHelper.imgPyrexModel = EditorHelper.imgIdxRange()


class PyrexModel(EditorModels.SourceModel):
    modelIdentifier = 'Pyrex'
    defaultName = 'pyrex'
    bitmap = 'Pyrex.png'
    ext = '.pyx'
    imgIdx = EditorHelper.imgPyrexModel


pyrex_cfgfile = os.path.join(Preferences.rcPath, 'stc-pyrex.rc.cfg')
#if not os.path.exists(pyrex_cfgfile):
#    pyrex_cfgfile = Preferences.pyPath +'/Plug-ins/stc-pyrex.rc.cfg'