Commits

uniqx committed 5bbb696

__pyld_tick__ target added ..

Comments (0)

Files changed (2)

   # update modification time
   handle['mtime'] = mtime
 
+  print handle
+
   # archive
   if arch_path != '':
     try:
   :param str target: valid target are: init, reload, unload
   '''
 
-  if target in ('init','reload','unload'):
+  if target in ('init','reload','unload','tick'):
     try:
       __name__ = '__pyld_'+target+'__'
       exec(handle['code_object_'+target])
         handle['code_object_reload'] = compile(ast.Module(block.body),os.path.split(handle['path'])[-1],'exec')
       elif '__pyld_unload__' in dump:
         handle['code_object_unload'] = compile(ast.Module(block.body),os.path.split(handle['path'])[-1],'exec')
+      elif '__pyld_tick__' in dump:
+        handle['code_object_tick'] = compile(ast.Module(block.body),os.path.split(handle['path'])[-1],'exec')
 
 
 def __read_text_file(path):
 
 if __name__ == '__main__':
 
+  ##
+  ## local variables
+  ##
 
   # handles for the monitored files
   observe_handles = []
 
 
 
-
-  # parse arguments
+  ##
+  ## parse arguments
+  ##
 
   remaining_opt_param_count = 0
   last_opt_param = ''
 
 
 
-
-  # main loop
+  ##
+  ## main loop
+  ##
 
   last_tick = time.time()
   running = True
   while running:
 
     # calculate delta time since since last tick
-    d = time.time() - last_tick
+    delta = time.time() - last_tick
 
     # check files
-    if d >= interval:
+    if delta >= interval:
 
       for handle in observe_handles:
         __check_file(handle)
 
       last_tick = time.time()
 
+    # exec ticks
+    for handle in observe_handles:
+      __exec_code_object(handle,'tick')
+
     # sleep ...
     time.sleep(0)
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 if __name__ == '__pyld_reload__':
   print 'reloading pyld test'
+
+
+if __name__ == '__pyld_tick__':
+  pass
+  ## better don't print stuff here ^^