Quick Start GuideFrom Enso Wiki
[edit] WarningWARNING: This guide describes process for the official "Frozen" Enso with "Enso Developr prototype" installed. It is not guide for the "community" (open-source) Enso. If you want to participate in the Community Enso development, please follow the guide on Main Page
[edit] Get PythonIf you are familiar with Python, then just make sure you have a recent version of Python installed. Otherwise, check out this guide to getting up and running with Python quickly: Python on XP: 7 Minutes to Hello World. The quick-start guide uses Python, but you can really use any language that supports XML-RPC. If you are more familiar with another language, you should check out one of the language guides on the left. [edit] Get Enso Developer PrototypeDownload the current Enso Developer installer from here, and run it. [edit] Create The Enso Extension
c:\Python25\python.exe MyEnsoExtension.py
Now you should be able to use the sample commands, like "translate to swedish" and "order food". [edit] Write Your First CommandAs with all programming tutorials, your first goal is to get the computer to say "Hello, world!". Rather than writing a command-line program that prints this, though, you're going to make the "hi" command, and Enso will display a transparent message. To do this, you'll need to edit callCommand() in the EnsoExtensionMethods class. Add the following to the begining of this function: if commandName == "hi": self.enso.displayMessage( "<p>Hello, world!</p>" ) # We found and executed the command, so return True return True Now, when Enso calls the "callCommand" method with the "hi" command, you'll see one of Enso's transparent messages with that well-known computer greeting. But before you can run the "hi" command, you have to tell Enso it exists. Down at the bottom of the file, you'll see this code: enso.registerCommand( EXTENSION_ENDPOINT_URL, "order {food}", "order some food.", "<p>Allows you to order food.</p>", "bounded" ) Right after this, you should add a call to register your new command: enso.registerCommand( EXTENSION_ENDPOINT_URL, "hi", "Says hello.", "<p>Just says hello to the world.</p>", "none" ) Once you've added this code, you should be able to fire up your Enso Extension, and issue the "hi" command! Before you exit, remember to unregister your command. Put it in the finally block near the bottom: enso.unregisterCommand( EXTENSION_ENDPOINT_URL, "hi" ) For more information on how Enso Extensions work (in Python), see the Python HOWTO. [edit] TroubleshootingIf your modified MyEnsoExtension.py won't run after you've pasted the above code, make sure the text editor you're using does replace tabs with spaces. You can verify that by enabling "show hidden characters" (or similar) in your editors preferences. Please read http://wiki.python.org/moin/HowToEditPythonCode for further information on Python's handling of tabs and spaces. |

