python: metadata files and a first stab at documentation

db4
Björn Lindqvist 2014-01-30 21:29:21 +01:00 committed by John Benediktsson
parent 715d426ad3
commit 8bfd12c0f8
5 changed files with 39 additions and 0 deletions

1
extra/python/authors.txt Normal file
View File

@ -0,0 +1 @@
Björn Lindqvist

1
extra/python/summary.txt Normal file
View File

@ -0,0 +1 @@
Python interface

View File

@ -0,0 +1 @@
Björn Lindqvist

View File

@ -0,0 +1 @@
Syntax for defining Python wrappers

View File

@ -0,0 +1,35 @@
IN: python.syntax
USING: python.syntax help.markup help.syntax ;
HELP: PY-FROM:
{ $syntax "PY-FROM: module => name-effects ;" }
{ $values
{ "module" "fully qualified name of a python module" }
{ "name-effects" "pairs of names and effect declarations of bindings to import" }
}
{ $description
"Creates factor words that maps to the given python objects."
}
{ $examples
{ $code
"PY-FROM: os.path => isfile ( path -- ? ) splitext ( path -- root ext ) ;"
}
} ;
HELP: PY-METHODS:
{ $syntax "PY-METHODS: class => name-effects ;" }
{ $values
{ "class" "name of a class to associate the bindings with" }
{ "name-effects" "pairs of names and effect declarations of methods to create" }
}
{ $description
"Creates factor words that acts as properties and getters and can work on any python object."
}
{ $examples
{ $code
"PY-FROM: zipfile => ZipFile ( name mode -- file ) ;"
"PY-METHODS: ZipFile => namelist ( self -- names ) ;"
"! Then use the declarations like this"
"\"name-of-zip.zip\" >py \"r\" >py ZipFile namelist >factor"
}
} ;