Difference between revisions of "Silme:Tutorial:Setting up environment"
Jump to navigation
Jump to search
Zbraniecki (talk | contribs) |
Zbraniecki (talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
You need Python 2.5. Nothing more. | You need Python 2.5. Nothing more. | ||
− | For serveral | + | For serveral IOClients and FormatParsers you will need additional modules like MySQLdb for MySQL, pysqlite for SQLite, pysvn for SVN etc. |
=== Linux and MacOS === | === Linux and MacOS === | ||
<pre> | <pre> | ||
− | + | hg clone http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme | |
</pre> | </pre> | ||
Line 17: | Line 17: | ||
<code lang="python"> | <code lang="python"> | ||
#!/usr/bin/python | #!/usr/bin/python | ||
− | sys.path.append('./lib') | + | sys.path.append('./lib') # path where the silme/lib exists |
− | from | + | from silme.core import Entity |
def test(): | def test(): | ||
Line 28: | Line 28: | ||
</code> | </code> | ||
− | You can also checkout from | + | You can also checkout from HG ./silme/scripts to see examples. (launch from the directory above ./scripts, like: ./scripts/test.py) |
=== Windows === | === Windows === | ||
− | + | * Go to [http://www.python.org/download/ python.org] and download latest Python 2.6 msi package and install it. | |
+ | * Download [http://bitbucket.org/tortoisehg/stable/wiki/Home 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 - [[Silme:Tutorial:Entity|entities]]. |
Latest revision as of 02:32, 15 February 2009
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/users/zbraniecki_mozilla.com/silme
And then you can write first example.py:
- !/usr/bin/python
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 from HG ./silme/scripts to see examples. (launch from the directory above ./scripts, like: ./scripts/test.py)
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.