Author: dmeyer
Date: Wed Feb 13 13:50:44 2008
New Revision: 3071

Log:
rename yield_execution to coroutine

Modified:
   trunk/base/test/async_lock.py
   trunk/beacon/bin/beacon-search
   trunk/beacon/src/client.py
   trunk/beacon/src/db.py
   trunk/beacon/src/media.py
   trunk/beacon/src/query.py
   trunk/beacon/src/server/controller.py
   trunk/beacon/src/server/cpuinfo.py
   trunk/beacon/src/server/crawl.py
   trunk/beacon/src/server/hwmon/client.py
   trunk/beacon/src/server/monitor.py
   trunk/beacon/src/server/parser.py
   trunk/beacon/src/server/server.py
   trunk/display/src/lcdproc.py
   trunk/epg/src/client.py
   trunk/epg/src/server.py
   trunk/feedmanager/bin/beacon-feedmanager
   trunk/feedmanager/src/core.py
   trunk/popcorn/src/generic.py

Modified: trunk/base/test/async_lock.py
==============================================================================
--- trunk/base/test/async_lock.py       (original)
+++ trunk/base/test/async_lock.py       Wed Feb 13 13:50:44 2008
@@ -1,6 +1,6 @@
 import kaa
 
[EMAIL PROTECTED](synchronize = True)
[EMAIL PROTECTED](synchronize = True)
 def f(x):
     print 'in', x
     yield kaa.YieldContinue

Modified: trunk/beacon/bin/beacon-search
==============================================================================
--- trunk/beacon/bin/beacon-search      (original)
+++ trunk/beacon/bin/beacon-search      Wed Feb 13 13:50:44 2008
@@ -150,7 +150,7 @@
     print 'Beacon has finished the query and parsing.'
 
 
[EMAIL PROTECTED]()
[EMAIL PROTECTED]()
 def main():
     try:
         # list of modes this script can start in

Modified: trunk/beacon/src/client.py
==============================================================================
--- trunk/beacon/src/client.py  (original)
+++ trunk/beacon/src/client.py  Wed Feb 13 13:50:44 2008
@@ -96,7 +96,7 @@
     # Public API
     # -------------------------------------------------------------------------
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def get(self, filename):
         """
         Return an object for the given filename.
@@ -164,7 +164,7 @@
             self.rpc('monitor.directory', directory)
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def get_db_info(self):
         """
         Returns information about the database.  Look at
@@ -320,7 +320,7 @@
         self.rpc('item.update', items)
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _beacon_media_information(self, media):
         """
         Get some basic media information.
@@ -351,7 +351,7 @@
     # -------------------------------------------------------------------------
 
     @kaa.rpc.expose('connect')
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _connected(self, id, database, media):
         """
         Callback to pass the database information to the client.

Modified: trunk/beacon/src/db.py
==============================================================================
--- trunk/beacon/src/db.py      (original)
+++ trunk/beacon/src/db.py      Wed Feb 13 13:50:44 2008
@@ -173,9 +173,9 @@
         # do query based on type
         if 'filename' in query and qlen == 1:
             fname = os.path.realpath(query['filename'])
-            return kaa.yield_execution()(self.query_filename)(fname)
+            return kaa.coroutine()(self.query_filename)(fname)
         if 'id' in query and qlen == 1:
-            return kaa.yield_execution()(self._db_query_id)(query['id'])
+            return kaa.coroutine()(self._db_query_id)(query['id'])
         if 'parent' in query and 'recursive' in query and qlen == 2:
             if not query['parent']._beacon_isdir:
                 raise AttributeError('parent is no directory')
@@ -186,9 +186,9 @@
                     return self._db_query_dir(query['parent'])
             query['parent'] = query['parent']._beacon_id
         if 'attr' in query:
-            return kaa.yield_execution()(self._db_query_attr)(query)
+            return kaa.coroutine()(self._db_query_attr)(query)
         if 'type' in query and query['type'] == 'media':
-            return kaa.yield_execution()(self._db.query)(**query)
+            return kaa.coroutine()(self._db.query)(**query)
         return self._db_query_raw(query)
 
 
@@ -222,7 +222,7 @@
         return result
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _db_query_dir(self, parent):
         """
         A query to get all files in a directory. The parameter parent is a
@@ -313,7 +313,7 @@
         yield items
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _db_query_dir_recursive(self, parent):
         """
         Return all files in the directory 'parent' including files in
@@ -406,7 +406,7 @@
         return result
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _db_query_raw(self, query):
         """
         Do a 'raw' query. This means to query the database and create

Modified: trunk/beacon/src/media.py
==============================================================================
--- trunk/beacon/src/media.py   (original)
+++ trunk/beacon/src/media.py   Wed Feb 13 13:50:44 2008
@@ -71,7 +71,7 @@
         self._controller.eject(self)
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def update(self, prop):
         """
         Update media properties.
@@ -180,7 +180,7 @@
         self._controller = controller
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def add(self, id, prop):
         """
         Add a media.

Modified: trunk/beacon/src/query.py
==============================================================================
--- trunk/beacon/src/query.py   (original)
+++ trunk/beacon/src/query.py   Wed Feb 13 13:50:44 2008
@@ -185,7 +185,7 @@
     # Internal API
     # -------------------------------------------------------------------------
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _beacon_start_query(self, query):
         """
         Start the database query.
@@ -246,7 +246,7 @@
     # Server callbacks for changes (called by client.notify)
     # -------------------------------------------------------------------------
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _beacon_callback_changed(self, send_signal):
         """
         Changed message from server.

Modified: trunk/beacon/src/server/controller.py
==============================================================================
--- trunk/beacon/src/server/controller.py       (original)
+++ trunk/beacon/src/server/controller.py       Wed Feb 13 13:50:44 2008
@@ -60,7 +60,7 @@
         return parse(self._db, item)
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _beacon_update_all(self):
         """
         Timed callback to write all changes to the db.
@@ -93,7 +93,7 @@
         return self._db.query(**query)
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def delete_item(self, item):
         """
         Delete an item.

Modified: trunk/beacon/src/server/cpuinfo.py
==============================================================================
--- trunk/beacon/src/server/cpuinfo.py  (original)
+++ trunk/beacon/src/server/cpuinfo.py  Wed Feb 13 13:50:44 2008
@@ -140,7 +140,7 @@
     def debug():
         print "CPU:", cpuinfo()
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def add_load():
         x = 0
         for i in range(300000):

Modified: trunk/beacon/src/server/crawl.py
==============================================================================
--- trunk/beacon/src/server/crawl.py    (original)
+++ trunk/beacon/src/server/crawl.py    Wed Feb 13 13:50:44 2008
@@ -511,7 +511,7 @@
         yield subdirs
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _add_directory_attributes(self, directory):
         """
         Add some extra attributes for a directory recursive. This function

Modified: trunk/beacon/src/server/hwmon/client.py
==============================================================================
--- trunk/beacon/src/server/hwmon/client.py     (original)
+++ trunk/beacon/src/server/hwmon/client.py     Wed Feb 13 13:50:44 2008
@@ -81,7 +81,7 @@
     # rpc callbacks
 
     @kaa.rpc.expose('device.add')
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _device_add(self, dev):
         # FIXME: check if the device is still valid
 
@@ -139,7 +139,7 @@
         self._device_add(dev)
 
 
-    @kaa.yield_execution(synchronize = True)
+    @kaa.coroutine(synchronize = True)
     def _device_scanned(self, metadata, dev):
 
         # FIXME: ACTIVE WAITING:

Modified: trunk/beacon/src/server/monitor.py
==============================================================================
--- trunk/beacon/src/server/monitor.py  (original)
+++ trunk/beacon/src/server/monitor.py  Wed Feb 13 13:50:44 2008
@@ -128,7 +128,7 @@
             pass
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def check(self, changes):
         """
         This function compares the last query result with the current db status
@@ -199,7 +199,7 @@
         yield True
 
 
-    @kaa.yield_execution(0.01)
+    @kaa.coroutine(0.01)
     def _initial_scan(self):
         """
         Start scanning the current list of items if they need to be updated.

Modified: trunk/beacon/src/server/parser.py
==============================================================================
--- trunk/beacon/src/server/parser.py   (original)
+++ trunk/beacon/src/server/parser.py   Wed Feb 13 13:50:44 2008
@@ -73,7 +73,7 @@
     extention_plugins[ext].append(function)
 
 
[EMAIL PROTECTED]()
[EMAIL PROTECTED]()
 def parse(db, item, check_image=False):
     """
     Main beacon parse function. Return the load this function produced:
@@ -124,11 +124,11 @@
         else:
             return 0
 
-    # looks like we have more to do. Start the yield_execution part of the 
parser
+    # looks like we have more to do. Start the coroutine part of the parser
     return _parse(db, item, mtime)
 
 
[EMAIL PROTECTED]()
[EMAIL PROTECTED]()
 def _parse(db, item, mtime):
     """
     Parse the item, this can take a while.

Modified: trunk/beacon/src/server/server.py
==============================================================================
--- trunk/beacon/src/server/server.py   (original)
+++ trunk/beacon/src/server/server.py   Wed Feb 13 13:50:44 2008
@@ -287,7 +287,7 @@
 
 
     @kaa.rpc.expose('monitor.directory')
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def monitor_dir(self, directory):
         """
         Monitor a directory in the background. One directories with a monitor
@@ -314,7 +314,7 @@
 
 
     @kaa.rpc.expose('monitor.add')
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def monitor_add(self, client_id, request_id, query):
         """
         Create a monitor object to monitor a query for a client.
@@ -355,7 +355,7 @@
 
 
     @kaa.rpc.expose('item.update')
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def update(self, items):
         """
         Update items from the client.
@@ -369,7 +369,7 @@
 
 
     @kaa.rpc.expose('item.request')
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def request(self, filename):
         """
         Request item data.
@@ -388,7 +388,7 @@
 
 
     @kaa.rpc.expose('item.create')
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def item_create(self, type, parent, **kwargs):
         """
         Create a new item.
@@ -400,7 +400,7 @@
 
     
     @kaa.rpc.expose('item.delete')
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def item_delete(self, id):
         """
         Create a new item.

Modified: trunk/display/src/lcdproc.py
==============================================================================
--- trunk/display/src/lcdproc.py        (original)
+++ trunk/display/src/lcdproc.py        Wed Feb 13 13:50:44 2008
@@ -219,7 +219,7 @@
         self.socket.write(line + '\n')
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _connect(self, server, port):
         """
         Connect to the server and init the connection.

Modified: trunk/epg/src/client.py
==============================================================================
--- trunk/epg/src/client.py     (original)
+++ trunk/epg/src/client.py     Wed Feb 13 13:50:44 2008
@@ -47,9 +47,9 @@
 
 DISCONNECTED, CONNECTING, CONNECTED = range(3)
 
-def yield_execution_while_connecting():
+def wait_while_connecting():
     """
-    Decorator that wraps kaa.yield_execution, raising an exception if
+    Decorator that wraps kaa.coroutine, raising an exception if
     the client is disconnected, YieldContinue if the client is in the process
     of connecting, or the actual return value of the decorated function if the
     client is connected.
@@ -63,7 +63,7 @@
             yield func(client, *args, **kwargs)
 
         newfunc.func_name = func.func_name
-        return kaa.yield_execution()(newfunc)
+        return kaa.coroutine()(newfunc)
     return decorator
 
        
@@ -146,7 +146,7 @@
         self.signals["updated"].emit()
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def search(self, channel=None, time=None, **kwargs):
         """
         Search the db. This will call the search function on server side using
@@ -235,7 +235,7 @@
         return Channel(tuner_id, name, long_name)
 
 
-    @yield_execution_while_connecting()
+    @wait_while_connecting()
     def get_channel(self, name):
         """
         Get channel by name.
@@ -245,7 +245,7 @@
         return self._channels_by_name[name]
 
 
-    @yield_execution_while_connecting()
+    @wait_while_connecting()
     def get_channel_by_db_id(self, db_id):
         """
         Get channel by database id.
@@ -255,7 +255,7 @@
         return self._channels_by_db_id[db_id]
 
 
-    @yield_execution_while_connecting()
+    @wait_while_connecting()
     def get_channel_by_tuner_id(self, tuner_id):
         """
         Get channel by tuner id.
@@ -265,7 +265,7 @@
         return self._channels_by_tuner_id[tuner_id]
 
 
-    @yield_execution_while_connecting()
+    @wait_while_connecting()
     def get_channels(self, sort=False):
         """
         Get all channels

Modified: trunk/epg/src/server.py
==============================================================================
--- trunk/epg/src/server.py     (original)
+++ trunk/epg/src/server.py     Wed Feb 13 13:50:44 2008
@@ -166,7 +166,7 @@
 
 
     @kaa.rpc.expose('guide.update')
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def update(self, backend = None, *args, **kwargs):
         """
         Start epg update calling the source_* files.  If backend is specified,

Modified: trunk/feedmanager/bin/beacon-feedmanager
==============================================================================
--- trunk/feedmanager/bin/beacon-feedmanager    (original)
+++ trunk/feedmanager/bin/beacon-feedmanager    Wed Feb 13 13:50:44 2008
@@ -115,7 +115,7 @@
 
 elif sys.argv[1] in ('--update', '-u'):
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def update():
         n = None
         if len(sys.argv) > 2:
@@ -134,7 +134,7 @@
                     print 'failed'
         sys.exit(0)
         
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def parallel_update():
         global active
         active = 0

Modified: trunk/feedmanager/src/core.py
==============================================================================
--- trunk/feedmanager/src/core.py       (original)
+++ trunk/feedmanager/src/core.py       Wed Feb 13 13:50:44 2008
@@ -156,7 +156,7 @@
             d.appendChild(e)
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _get_image(self, url):
         """
         Download image and store it to the image dir. Returns image
@@ -171,7 +171,7 @@
         yield fname
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def update(self, verbose=False):
         """
         Update feed.
@@ -274,7 +274,7 @@
         yield True
     
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def remove(self):
         """
         Remove entries from this feed.

Modified: trunk/popcorn/src/generic.py
==============================================================================
--- trunk/popcorn/src/generic.py        (original)
+++ trunk/popcorn/src/generic.py        Wed Feb 13 13:50:44 2008
@@ -59,8 +59,8 @@
 
         def newfunc(self, *args, **kwargs):
             # always return an InProgress object and handle the
-            # function like it is decorated with yield_execution
-            afunc = kaa.yield_execution()(func)
+            # function like it is decorated with coroutine
+            afunc = kaa.coroutine()(func)
             async = kaa.InProgress()
             if self._get_state() in states and not self._pending:
                 # already finished
@@ -231,7 +231,7 @@
         return async
 
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def _open(self, player=None):
         """
         The real open function called from 'open' and 'play'. This function
@@ -305,7 +305,7 @@
 
     # Player API
 
-    @kaa.yield_execution()
+    @kaa.coroutine()
     def open(self, mrl, caps = None, player = None):
         """
         Open mrl. The parameter 'caps' defines the needed capabilities the

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to