Mostrando entradas con la etiqueta Scite. Mostrar todas las entradas
Mostrando entradas con la etiqueta Scite. Mostrar todas las entradas

Configurar SCITE para usar PEP8 de Python



1.-Instalar en el sistema el paquete pep8 (con pip o easy_install) de python.
2.- Abrir Scite como root.
3.- Abrir fichero python.properties (Menus:: Options > Edit properties > Open Python.properties)
4.- Añadir lo siguiente al final del fichero y guardarlo:

command.name.2.*.py=Run PEP8
command.2.*.py=pep8 $(FilePath)
 
Ahora en el menu Tools, aparece una entrada nueva: Run PEP8.

Configurar SCITE (Scintilla) para Python (Español + .API)

Scintilla es un componente open source para editores y Scite es un editor de texto basado en el.
http://www.scintilla.org/.
Procedimiento para personalizar Scite como editor para Python en lenguaje español e instalar un fichero .api para Python.
1.- Tener instalado Python (version 2.x o 3.x).
2.- Descargar SCite. http://www.scintilla.org/SciTEDownload.html
3.- Configurar Scite para el idioma Español. Copiar a un archivo: http://scite-files.googlecode.com/svn-history/trunk/translations/locale.es.properties .Guardarlo en el directorio de Scite con el nombre locale.properties.
4.- En Scite un archivo .API se utiliza para mostrar información (en forma de tooltips) sobre las funciones declaradas de un lenguaje. Para usar esta característica tenemos 2 scripts en http://code.google.com/p/scite-files/wiki/Customization. Uno es para las versiones 2.x (gen_python) y otro para las 3.x (gen_python_3). Estos scripts se deben de correr en un shell independiente no dentro de Scite.Una vez generado el fichero .api copiarlo como root en el directorio de Scite (en debian en /usr/share/scite/).
Luego debemos de poner un poner una serie de lineas en el SciteUser.properties (las instrucciones vienen como comentarios en los scripts, hay que leerlas.).

5.- Para indicarle a Scite la versión con la que ejecutar Python debemos de abrir el fichero  python.properties y modificar las líneas que le indican el programa (versión de Python) que debe ejecutar. Estas se encuentran alrededor de la línea 90 y tienen este aspecto. (Resalto con negrita lo cambiado para LINUX)

if PLAT_WIN
    command.go.*.py=pythonw -u "$(FileNameExt)"
    command.go.subsystem.*.py=1
    command.go.*.pyw=pythonw -u "$(FileNameExt)"
    command.go.subsystem.*.pyw=1
    command.build.SConscript=scons.bat --up .
    command.build.SConstruct=scons.bat .

if PLAT_GTK
    command.go.*.py=python3.2 -u "$(FileNameExt)"
    command.build.SConscript=scons --up .
    command.build.SConstruct=scons .

if PLAT_MAC
    command.go.*.py=python -u "$(FileNameExt)"
    command.build.SConscript=scons --up .
    command.build.SConstruct=scons .

command.name.1.*.py=Syntax Check
command.1.*.py=python3.2 -c "import py_compile; py_compile.compile(r'$(FilePath)')"


6.- Para personalizar más nuestro Scite se pueden poner más opciones en el fichero personal SciteUser.properties.

Ejemplo:

#SciteUser.properties de Arturo Suelves (última actualización 2014)

#API file for python 3
api.*.py=$(SciteDefaultHome)/python3.api
api.*.pyw=$(SciteDefaultHome)/python3.api
autocomplete.choose.single=1
autocomplete.python.ignorecase=1
autocomplete.python.start.characters=.
autocomplete.python.fillups=(
#autocompleteword.automatic
calltip.python.ignorecase=1
calltip.python.word.characters=._$(chars.alpha)$(chars.numeric)


# Indent (4 spaces) y no se usan tabs
tabsize=4
indent.size=4
use.tabs=0
#indent.auto=1
indent.automatic=1
indent.opening=0
indent.closing=0
#tab.indents=0
#backspace.unindents=0

# Folding enable folding, and show lines below when collapsed.
fold=1
fold.compact=1
fold.flags=16
fold.symbols=1
fold.highlight=1
fold.highlight.colour=#ccC0C0
#fold.on.open=1
fold.comment=1
fold.preprocessor=1

# Sizes and visibility in edit pane
line.margin.visible=1
line.margin.width=4
margin.width=16
fold.margin.width=16
fold.margin.colour=#ccccc0
#fold.margin.highlight.colour=#0000FF
blank.margin.left=4
blank.margin.right=4
buffered.draw=1
#two.phase.draw=0
#technology=1


#Show statusbar
statusbar.visible=1

#SciTE is able to display a column of line numbers to the left of the selection margin.
#Setting line.margin.visible to 1 makes this column visible at startup.
#The line.margin.width property controls how much space is reserved for the line numbers,
#in terms of the number of digits that can be displayed. To specify that the margin should
#expand if needed to accomodate larger line numbers, add a '+' after the number of digits,
#e.g. line.margin.width=3+. These properties replace the old line.numbers property,
#which was overloaded to perform both of the actions described above.
#The line.numbers property is no longer available.

line.margin.visible=1
line.margin.width=3+

#Monospace font

font.base=font:!Monospace,size:10
font.small=font:!Monospace,size:9
font.comment=font:!Monospace,size:10

#Background and colours
style.*.32=$(font.base),back:#CCCCc0,fore:#00000f
style.*.33=back:#C0C0C0,$(font.base)
style.*.37=fore:#939393

#Cursor properties
caret.fore=#000000
caret.period=500
caret.additional.blinks=0
caret.width=3
caret.line.back=#FFFED8
caret.line.back.alpha=63

#Toolbar and Tabbar
tabbar.visible=1
tabbar.hide.one=1
tabbar.multiline=1
toolbar.visible=1
toolbar.detachable=1
#toolbar.usestockicons=1


#Selections options
selection.alpha=75
#selection.back=#FFFFFF
colour.keyword=fore:#649bff
colour.operator=fore:#727272

#Output style
style.errorlist.32=$(font.small),back:#aaaAA0
style.errorlist.0=fore:#FFFFFF

#wrap del outpu se habilita
output.wrap=1

#Autocompleteword
#autocompleteword.automatic=1

#More fast with warp to 0.
wrap=0


#Configurar la ayuda del Scite (para que se vea en el navegador iceweasel
if PLAT_GTK
    command.print.*=a2ps "$(FileNameExt)"
    command.scite.help=iceweasel /usr/share/scite/SciTEDoc.html
    command.help.=iceweasel /usr/share/doc/python3.2/html/index.html

#salvar la sesion al salir
save.session=1
session.bookmarks=1
session.folds=1

#visualizar el path en el tabbar
pathbar.visible=1