Silme:Tutorial:Setting up environment: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 13: | Line 13: | ||
<pre> | <pre> | ||
hg clone http://hg.mozilla.org/ | hg clone http://hg.mozilla.org/l10n/silme | ||
</pre> | </pre> | ||
Line 19: | Line 19: | ||
#!/usr/bin/python | #!/usr/bin/python | ||
import sys | |||
sys.path.append('./lib') # path where the silme/lib exists | sys.path.append('./lib') # path where the silme/lib exists | ||
Line 24: | Line 27: | ||
def test(): | def test(): | ||
entity = Entity('id, 'value') | entity = Entity('id', 'value') | ||
if __name__ == "__main__": | if __name__ == "__main__": | ||
test() | test() | ||
You can also checkout | You can also checkout [http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme-apps/ silme-apps] to see examples. | ||
=== Windows === | === Windows === |
Latest revision as of 08:49, 22 January 2010
[This is a part of silme tutorial]
Overview
This section explains how to set up an environment to work with silme.
Requirements
You need Python 2.5. Nothing more. For serveral IOClients and FormatParsers you will need additional modules like MySQLdb for MySQL, pysqlite for SQLite, pysvn for SVN etc.
Linux and MacOS
hg clone http://hg.mozilla.org/l10n/silme
And then you can write first example.py:
#!/usr/bin/python import sys sys.path.append('./lib') # path where the silme/lib exists from silme.core import Entity def test(): entity = Entity('id', 'value') if __name__ == "__main__": test()
You can also checkout silme-apps to see examples.
Windows
- Go to python.org and download latest Python 2.6 msi package and install it.
- Download TortoiseHG and install it.
- Create a directory and right-click->tortisehg->clone directory and give it a path to silme repository.
- Open command line (cmd.exe) and type "set PATH=C:\Python26;%PATH%" to configure the path
- Navigate to directory where silme has been cloned to and try "python .\scripts\test.py"
You should be good to go from now on.
Next, let's take a closer look at the basic particles in the system - entities.