Author: dmeyer
Date: Sun Oct 15 17:29:17 2006
New Revision: 1918
Modified:
trunk/beacon/README
trunk/beacon/doc/api.txt
Log:
doc update
Modified: trunk/beacon/README
==============================================================================
--- trunk/beacon/README (original)
+++ trunk/beacon/README Sun Oct 15 17:29:17 2006
@@ -19,49 +19,7 @@
Access the database
-First you need to connect to the database. After that you can get a
-directory object and call the listdir() memeber function. You get a
-Query object in return. Besides some monitoring stuff, the class has
-an interator to walk through the list of results:
-
-| kaa.beacon.connect('/var/lib/freevo/beacondb')
-| directory = kaa.beacon.get('/home/mp3')
-| listing = directory.listdir()
-| for item in listing:
-| print item
-
-Item is an object of the type Item (or higher classes like File or
-Directory. You will be able to change that in later versions of
-kaa.beacon to your own classes). Directory object have a 'listdir()'
-again (other types will also have a list in the future). You can
-access the attributes from the database with the memeber function
-'getattr()'. A File/Directory also has attributes 'url', 'filename'
-and 'isdir'. To get a list of all possible attributes call 'keys()'.
-Using the attribute 'thumbnail' will return a Thumbnail object for
-that item you can use to get/set/create thumbnails. The thumbnail
-object has (besides other things) a member variable 'image' returning
-the thumbnail filename with the highest resolution or None if no
-thumbnail exists. If no thumbnail exists, you get check the meber
-variable 'failed' to check if you already tried to create a thumbnail
-and failed. If this returns False, you can use the function 'create()'
-to create a thumbnail. The arguments are size (NORMAL or LARGE) and
-the flag 'wait'. If 'wait' is True the function will block using
-notifier.step until the thumbnail is created. If 'wait' is False
-(default), the function will return a Signal you can connect to to get
-notice when thumbnailing is done. NOTICE: you need to keep the
-thumbnail object, if you delete the object, a scheduled thumbnailing
-will be stopped.
-
-| thumbnail = item.getattr('thumbnail')
-| if thumbnail.image:
-| print 'thumbnail is', thumbnail.image
-| return
-| if thumbnail.failed:
-| print 'unable to create thumbnail for', item.filename
-| return
-| # create one (blocking)
-| thumbnail.create('large', True)
-
+[ see doc/api.txt ]
Hidden features
Modified: trunk/beacon/doc/api.txt
==============================================================================
--- trunk/beacon/doc/api.txt (original)
+++ trunk/beacon/doc/api.txt Sun Oct 15 17:29:17 2006
@@ -43,36 +43,40 @@
function will call kaa.notifier.step until connected. This small
version of a query can not be monitored for changes.
-If you have a directory item you can call the memeber function
-'listdir' to get Query object with all files in that directory. Using
-the parameter recursive=True will return all files (not directories)
-recursive inside the dir. Symlinks will not be followed (except if the
-starting dir is a symlink).
-
-Note: only a nornal directory listing (not recursive) and no other
-kind of query will check the filesystem if the file is still there or
-if there are newer files that would match.
+If you have a directory item you can call the member function 'list to
+get Query object with all files in that directory. Using the parameter
+recursive=True will return all files (not directories) recursive
+inside the dir. Symlinks will not be followed (except if the starting
+dir is a symlink).
+
+Note: that the none-recursive call will return all files in the
+directory regardless of whether it has been scanned; the recursive
+call will only return scanned files. Only a normal directory listing
+(not recursive) and no other kind of query will check the filesystem
+if the file is still there or if there are newer files that would
+match.
== Items ==
-The items returned by a query can either be a 'Directory', a 'File' or
-a simple 'Item' (e.g. tracks on a DVD). They have functions to get and
-set attributes in the database (getattr and setattr). It could be
-possible that an item for a new file is not scanned, in that case the
-attributes returned are limited to the basic filesystem information.
-To force scanning for such an item, add 'force' to getattr and the
-function will block using kaa.notifier.step until the item is
-scanned. You can use the function 'scanned' to get information if the
-item is already scanned or not. If you set information with setattr,
-the information will be added to the database. If the attribute starts
-with 'tmp:', it will be stored only in this object and not added to
-the database. A new query with the same item in the database will not
-contain that attribute. The function 'keys' will return all known keys
-you can use. Special attributes are 'title' (generate a nice title
-based on the name), 'image' (the filename that contains an image for
-this item) and 'thumbnail' (same as image, but as Thumbnail
-object). If an attribute does not exist, None will be returned.
+The items returned by a query can either be a 'File' or a simple
+'Item' (e.g. tracks on a DVD, use 'list' to get all tracks). They have
+functions to get and set attributes in the database (getattr and
+setattr). It could be possible that an item for a new file is not
+scanned, in that case the attributes returned are limited to the basic
+filesystem information. To force scanning for such an item, add
+'force' to getattr and the function will block using kaa.notifier.step
+until the item is scanned. You can use the function 'scanned' to get
+information if the item is already scanned or not. If you set
+information with setattr, the information will be added to the
+database. If the attribute starts with 'tmp:', it will be stored only
+in this object and not added to the database. A new query with the
+same item in the database will not contain that attribute. The
+function 'keys' will return all known keys you can use. Special
+attributes are 'title' (generate a nice title based on the name),
+'image' (the filename that contains an image for this item) and
+'thumbnail' (same as image, but as Thumbnail object). If an attribute
+does not exist, None will be returned.
== Thumbnails ==
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog