Page 1 sur 5

pyWrite: un éditeur de scripts Python pour Nspire...

Message non luPosté: 28 Oct 2014, 07:30
de Lionel Debroux
Pour complémenter le portage Nspire de Micro Python, dont nous nous sommes déjà largement faits l'écho, Fabian "Vogtinator" Vogt a commencé à écrire un éditeur de scripts Python pour la Nspire :)

Le but est d'être plus complet que nTxt (qui est un éditeur plus générique), tout en s'affranchissant bien sûr des restrictions artificielles de TI sur la lecture et l'écriture de fichiers qui empêchent d'utiliser Jens' Script Editor seul pour éditer des fichiers Python.

Fonctionnalités implémentées pour l'instant:
  • curseur de la souris;
  • invocation interactive du programme dans Micro Python; attention, pour que ça fonctionne, micropython doit être dans le répertoire ndless: "/documents/ndless/micropython.tns";
  • gestion de plusieurs polices de caractères, mais il n'y a pas encore de façon de changer de police;

Image

En revanche, l'éditeur ne peut pas encore sauvegarder directement les programmes :)
La coloration syntaxique n'est pas encore implémentée non plus, mais c'est prévu.

Téléchargement : archives_voir.php?id=106886
Source de l'info : http://www.omnimaga.org/ti-nspire-proje ... pt-editor/ .
Très peu d'utilisateurs issus d'Omnimaga ont répondu à ce topic-là (les contributions les plus utiles au topic sont dues à Adriweb et Bisam). C'est dommage pour Fabian, mais ce n'est qu'un des symptômes du fait que les autres sites communautaires ne reconnaissent pas l'importance de Micro Python Nspire...

Re: pyWrite: un éditeur de scripts Python pour Nspire...

Message non luPosté: 31 Oct 2014, 23:35
de Vogtinator
Just a quick cross-post:
In the meantime I could implement some UI stuff and saving. I also removed the "Save&Run" menu in favor of a simple "Run" item. Only difference is, that it doesn't save.

Editing a file:
Image

Selecting a location to save to:
Image

File is attached. Shold run on all calc models, but not very usable on clickpad without cursor movement.Please report if you find it useful!
If anyone wants to help: http://github.com/Vogtinator/pyWrite
Todo-list:
-Syntax highligting
-Horizontal scrolling (partially implemented)
-Settings dialog (font and location of micropython)

Re: pyWrite: un éditeur de scripts Python pour Nspire...

Message non luPosté: 31 Oct 2014, 23:37
de Bisam
That's really getting GREAT !

May I know which encoding is currently used (clearly not UTF8...) ?

Re: pyWrite: un éditeur de scripts Python pour Nspire...

Message non luPosté: 01 Nov 2014, 00:15
de Adriweb
Great ! :)

@Bisam : Ah, the joys of Unicode... :P

Re: pyWrite: un éditeur de scripts Python pour Nspire...

Message non luPosté: 01 Nov 2014, 00:23
de Vogtinator
May I know which encoding is currently used (clearly not UTF8...)?

Plain ASCII. I'm using nspireios nio_get_ascii for text input, so there's no way right now to input such characters.
If I can find a fast way to render unicode (probably utf8 or utf32 truncated to 16 bit) I can switch to that fairly easily, although it would complicate input a bit.

@Bisam : Ah, the joys of Unicode...

It's fairly simple: If you don't use Unicode, you have bugs. If you do, you have other kinds of bugs, it's really horrible :-(

Re: pyWrite: un éditeur de scripts Python pour Nspire...

Message non luPosté: 01 Nov 2014, 03:29
de Adriweb
Vogtinator a écrit:
@Bisam : Ah, the joys of Unicode...

It's fairly simple: If you don't use Unicode, you have bugs. If you do, you have other kinds of bugs, it's really horrible :-(

I know... :(
But there are some UTF8/16 stuff in the OS, though, so part of the hard work is kind of done. but yeah, it's not as if gluing all this together was a very easy task anyway...

(Also, yeah, as said in the omni topic, ISO-8859 is good too)

Re: pyWrite: un éditeur de scripts Python pour Nspire...

Message non luPosté: 01 Nov 2014, 08:27
de Lionel Debroux
The OS mostly uses UTF-16, but inputting UTF-16 takes more work than inputting ISO-8859-*...

Or maybe it's a good excuse to dig deeper in the OS and find relevant functions :)

Re: pyWrite: un éditeur de scripts Python pour Nspire...

Message non luPosté: 05 Nov 2014, 22:54
de Vogtinator
So, this time I'm posting the update here and cross-post on omnimaga :-)
pyWrite 0.2:
  • Some syntax highlighting
  • Selections
  • Bugfixes
  • Settings
  • Better scrolling (also horizontal)

Some screenshots:
Image
Image

Please report any bugs you can find!

Download: here

Concerning inputting characters not accessible via the usual keys, I'll probably implement a sidebar that appears if you press Var.

Re: pyWrite: un éditeur de scripts Python pour Nspire...

Message non luPosté: 05 Nov 2014, 23:02
de Bisam
Woot !
I like the "settings" !
Keep on like this...

Re: pyWrite: un éditeur de scripts Python pour Nspire...

Message non luPosté: 06 Nov 2014, 00:02
de Adriweb
Oh nice, pretty awesome features :)