commit python-ioflo for openSUSE:Factory
Hello community, here is the log from the commit of package python-ioflo for openSUSE:Factory checked in at 2015-02-27 11:10:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-ioflo (Old) and /work/SRC/openSUSE:Factory/.python-ioflo.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-ioflo" Changes: -------- --- /work/SRC/openSUSE:Factory/python-ioflo/python-ioflo.changes 2015-01-29 09:58:27.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-ioflo.new/python-ioflo.changes 2015-02-27 11:10:30.000000000 +0100 @@ -1,0 +2,10 @@ +Thu Feb 26 21:28:47 UTC 2015 - aboe76@gmail.com + +- Updated to v1.1.9 + - More Skeddar timer fixes + - Added MonoTimer to Skeddar that detects if system clock is retrograded. + - Added binary create mode for OCFN utility function. Needed for P3 support if using msgpack. + - Renamed Registry class to Registrar class to avoid confusion with .Registry in RegisterType metaclass + - Added Ordered Set class called oset or OSet in base.osetting.py + +------------------------------------------------------------------- Old: ---- ioflo-1.1.5.tar.gz New: ---- ioflo-1.1.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-ioflo.spec ++++++ --- /var/tmp/diff_new_pack.xM2fD2/_old 2015-02-27 11:10:31.000000000 +0100 +++ /var/tmp/diff_new_pack.xM2fD2/_new 2015-02-27 11:10:31.000000000 +0100 @@ -16,7 +16,7 @@ # Name: python-ioflo -Version: 1.1.5 +Version: 1.1.9 Release: 0 License: Apache-2.0 Summary: Python IoFlo ++++++ ioflo-1.1.5.tar.gz -> ioflo-1.1.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/PKG-INFO new/ioflo-1.1.9/PKG-INFO --- old/ioflo-1.1.5/PKG-INFO 2015-01-21 01:55:25.000000000 +0100 +++ new/ioflo-1.1.9/PKG-INFO 2015-02-13 23:58:26.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: ioflo -Version: 1.1.5 +Version: 1.1.9 Summary: Flow Based Programming Automated Reasoning Engine and Automation Operation System Home-page: https://github.com/ioflo/ioflo Author: Samuel M. Smith diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/__metadata__.py new/ioflo-1.1.9/ioflo/__metadata__.py --- old/ioflo-1.1.5/ioflo/__metadata__.py 2015-01-21 01:53:24.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/__metadata__.py 2015-02-13 23:40:03.000000000 +0100 @@ -2,7 +2,7 @@ Ioflo package metadata ''' -__version_info__ = (1, 1, 5) +__version_info__ = (1, 1, 9) __version__ = '{0}.{1}.{2}'.format(*__version_info__) __author__ = "Samuel M. Smith" __license__ = "Apache 2.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/app/test/runplans.py new/ioflo-1.1.9/ioflo/app/test/runplans.py --- old/ioflo-1.1.5/ioflo/app/test/runplans.py 1970-01-01 01:00:00.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/app/test/runplans.py 2014-12-10 00:28:32.000000000 +0100 @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +Runs all the example FloScripts + + +""" +import sys +import os + +import ioflo.app.run + +PLAN_DIR_PATH = os.path.join( + os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + , 'plan') + +def getPlanFiles(planDirPath=PLAN_DIR_PATH): + planFiles = [] + for fname in os.listdir(os.path.abspath(planDirPath)): + root, ext = os.path.splitext(fname) + if ext != '.flo' or root.startswith('__') or root.startswith('gps'): + continue + + planFiles.append(os.path.abspath(os.path.join(planDirPath, fname))) + return planFiles + +def main(): + """ Run example scripts""" + failedCount = 0 + plans = getPlanFiles() + for plan in plans: + name, ext = os.path.splitext(os.path.basename(plan)) + skeddar = ioflo.app.run.run( name=name, + filepath=plan, + period=0.0625, + verbose=1, + real=False,) + + print("Plan {0}\n Skeddar {1}\n".format(plan, skeddar.name)) + failed = False + for house in skeddar.houses: + failure = house.metas['failure'].value + if failure: + failed = True + print("**** Failed in House = {0}. " + "Failure = {1}.\n".format(house.name, failure)) + else: + print("**** Succeeded in House = {0}.\n".format(house.name)) + if failed: + failedCount += 1 + + print("{0} failed out of {1}.\n".format(failedCount, len(plans))) + +if __name__ == '__main__': + main() + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/app/test/runstart.py new/ioflo-1.1.9/ioflo/app/test/runstart.py --- old/ioflo-1.1.5/ioflo/app/test/runstart.py 1970-01-01 01:00:00.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/app/test/runstart.py 2014-03-03 21:32:07.000000000 +0100 @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +Runs alls the example FloScripts + + +""" +import sys +import os + +import ioflo.app.run + +PLAN_DIR_PATH = os.path.join( + os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + , 'plan') + +def getPlanFiles(planDirPath=PLAN_DIR_PATH): + planFiles = [] + for fname in os.listdir(os.path.abspath(planDirPath)): + root, ext = os.path.splitext(fname) + if ext != '.flo' or root.startswith('__'): + continue + + planFiles.append(os.path.abspath(os.path.join(planDirPath, fname))) + return planFiles + +def test(): + """ Execute run.start """ + plans = getPlanFiles() + filepath = "../plan/meta.flo" + opts = dict(gandolf='grey', saruman='white') + metas = [("opts", ".testmeta.opts", dict(value=opts))] + + ioflo.app.run.start( + name='teststart', + period=0.125, + stamp=0.0, + real=False, + filepath=filepath, + behaviors=None, + username="", + password="", + mode=None, + houses=None, + metas=metas, + verbose=2, + ) + +if __name__ == '__main__': + test() + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/app/test/testPlans.py new/ioflo-1.1.9/ioflo/app/test/testPlans.py --- old/ioflo-1.1.5/ioflo/app/test/testPlans.py 2014-12-10 00:28:32.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/app/test/testPlans.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,57 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -Runs all the example FloScripts - - -""" -import sys -import os - -import ioflo.app.run - -PLAN_DIR_PATH = os.path.join( - os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - , 'plan') - -def getPlanFiles(planDirPath=PLAN_DIR_PATH): - planFiles = [] - for fname in os.listdir(os.path.abspath(planDirPath)): - root, ext = os.path.splitext(fname) - if ext != '.flo' or root.startswith('__') or root.startswith('gps'): - continue - - planFiles.append(os.path.abspath(os.path.join(planDirPath, fname))) - return planFiles - -def main(): - """ Run example scripts""" - failedCount = 0 - plans = getPlanFiles() - for plan in plans: - name, ext = os.path.splitext(os.path.basename(plan)) - skeddar = ioflo.app.run.run( name=name, - filepath=plan, - period=0.0625, - verbose=1, - real=False,) - - print("Plan {0}\n Skeddar {1}\n".format(plan, skeddar.name)) - failed = False - for house in skeddar.houses: - failure = house.metas['failure'].value - if failure: - failed = True - print("**** Failed in House = {0}. " - "Failure = {1}.\n".format(house.name, failure)) - else: - print("**** Succeeded in House = {0}.\n".format(house.name)) - if failed: - failedCount += 1 - - print("{0} failed out of {1}.\n".format(failedCount, len(plans))) - -if __name__ == '__main__': - main() - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/app/test/testStart.py new/ioflo-1.1.9/ioflo/app/test/testStart.py --- old/ioflo-1.1.5/ioflo/app/test/testStart.py 2014-03-03 21:32:07.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/app/test/testStart.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,53 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -Runs alls the example FloScripts - - -""" -import sys -import os - -import ioflo.app.run - -PLAN_DIR_PATH = os.path.join( - os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - , 'plan') - -def getPlanFiles(planDirPath=PLAN_DIR_PATH): - planFiles = [] - for fname in os.listdir(os.path.abspath(planDirPath)): - root, ext = os.path.splitext(fname) - if ext != '.flo' or root.startswith('__'): - continue - - planFiles.append(os.path.abspath(os.path.join(planDirPath, fname))) - return planFiles - -def test(): - """ Execute run.start """ - plans = getPlanFiles() - filepath = "../plan/meta.flo" - opts = dict(gandolf='grey', saruman='white') - metas = [("opts", ".testmeta.opts", dict(value=opts))] - - ioflo.app.run.start( - name='teststart', - period=0.125, - stamp=0.0, - real=False, - filepath=filepath, - behaviors=None, - username="", - password="", - mode=None, - houses=None, - metas=metas, - verbose=2, - ) - -if __name__ == '__main__': - test() - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/aiding.py new/ioflo-1.1.9/ioflo/base/aiding.py --- old/ioflo-1.1.5/ioflo/base/aiding.py 2015-01-09 17:30:53.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/base/aiding.py 2015-02-13 23:17:30.000000000 +0100 @@ -32,6 +32,7 @@ # Import ioflo libs from .globaling import * from .odicting import odict +from . import excepting from .consoling import getConsole console = getConsole() @@ -148,7 +149,7 @@ """ Computes elapsed time in seconds (fractional) since start. if zero then hasn't started yet """ - return abs(time.time() - self.start) + return max(0.0, time.time() - self.start) elapsed = property(getElapsed, doc='Elapsed time.') def getRemaining(self):# for property @@ -206,8 +207,130 @@ return self.restart(start=self.start, duration=duration) +class MonoTimer(object): + """ Class to manage real elaspsed time with monotonic guarantee. + If the system clock is retrograded (moved back in time) + while the timer is running then time.time() could move + to before the start time. + A MonoTimer detects this retrograde and if adjust is True then + shifts the timer back otherwise it raises a TimerRetroError + exception. + This timer is not able to detect a prograded clock + (moved forward in time) + + Needs time module + attributes: + .duration = time duration of timer start to stop + .start = time started + .stop = time when timer expires + .base = real time when started or restarted + .prev = real time when checked + + properties: + .elaspsed = time elasped since start + .remaining = time remaining until stop + .expired = True if expired, False otherwise + + methods: + .extend() = extends/shrinks timer duration + .repeat() = restarts timer at last .stop so no time lost + .restart() = restarts timer + """ + + def __init__(self, duration = 0.0, adjust=False): + """ Initialization method for instance. + duration in seconds (fractional) + """ + self.adjust = True if adjust else False + self.start = None + self.stop = None + self.latest = time.time() # last time checked current time + self.restart(start=self.latest, duration=duration) + + def update(self): + ''' + Updates .latest to current time. + Checks for retrograde movement of system time.time() and either + raises a TimerRetroErrorexception or adjusts the timer attributes to compensate. + ''' + delta = time.time() - self.latest # current time - last time checked + if delta < 0: # system clock has retrograded + if not self.adjust: + raise excepting.TimerRetroError("Timer retrograded by {0} " + "seconds\n".format(delta)) + self.start = self.start + delta + self.stop = self.stop + delta + + self.latest += delta + + def getElapsed(self): #for property + """ Computes elapsed time in seconds (fractional) since start. + if zero then hasn't started yet + """ + self.update() + return max(0.0, self.latest - self.start) + elapsed = property(getElapsed, doc='Elapsed time.') + + def getRemaining(self):# for property + """ Returns time remaining in seconds (fractional) before expires. + returns zero if it has already expired + """ + self.update() + return max(0.0, self.stop - self.latest) + remaining = property(getRemaining, doc='Remaining time.') + + def getExpired(self): + self.update() + if (self.latest >= self.stop): + return True + else: + return False + expired = property(getExpired, doc='True if expired, False otherwise') + + def restart(self,start=None, duration=None): + """ Starts timer at start time secs for duration secs. + (fractional from epoc) + If start arg is missing then restarts at current time + If duration arg is missing then restarts for current duration + """ + self.update() + if start is not None: + self.start = abs(start) #must be non negative + else: #use current time + self.start = self.latest + + if duration is not None: + self.duration = abs(duration) #must be non negative + #Otherwise keep old duration + + self.stop = self.start + self.duration + + return (self.start, self.stop) + + def repeat(self): + """ Restarts timer at stop so no time lost + + """ + return self.restart(start=self.stop) + + def extend(self, extension=None): + """ Extends timer duration for additional extension seconds (fractional). + Useful so as not to lose time when need more/less time on timer + + If extension negative then shortens existing duration + If extension arg missing then extends for the existing duration + effectively doubling the time + + """ + if extension is None: #otherwise extend by .duration or double + extension = self.duration + + duration = self.duration + extension + + return self.restart(start=self.start, duration=duration) + class StoreTimer(object): - """ Class to manage realtive Store based time. + """ Class to manage relative Store based time. Uses Store instance .stamp attribute as current time Attributes: .duration = time duration of timer start to stop @@ -238,7 +361,7 @@ """ Computes elapsed time in seconds (fractional) since start. if zero then hasn't started yet """ - return abs(self.store.stamp - self.start) + return max(0.0, self.store.stamp - self.start) elapsed = property(getElapsed, doc='Elapsed time.') def getRemaining(self):# for property @@ -2178,16 +2301,22 @@ crc64 = CRC64 # alias -def Ocfn(filename, openMode = 'r+'): +def Ocfn(filename, openMode = 'r+', binary=False): """Atomically open or create file from filename. If file already exists, Then open file using openMode - Else create file using write update mode + Else create file using write update mode If not binary Else + write update binary mode Returns file object + + If binary Then If new file open with write update binary mode """ try: newfd = os.open(filename, os.O_EXCL | os.O_CREAT | os.O_RDWR, 436) # 436 == octal 0664 - newfile = os.fdopen(newfd,"w+") + if not binary: + newfile = os.fdopen(newfd,"w+") + else: + newfile = os.fdopen(newfd,"w+b") except OSError as ex: if ex.errno == errno.EEXIST: newfile = open(filename, openMode) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/excepting.py new/ioflo-1.1.9/ioflo/base/excepting.py --- old/ioflo-1.1.5/ioflo/base/excepting.py 2015-01-05 22:40:57.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/base/excepting.py 2015-02-13 19:54:46.000000000 +0100 @@ -118,6 +118,20 @@ def __str__(self): return ("{0}: {1}.\n".format(self.__class__.__name__, self.message)) +class TimerRetroError(Exception): + """Used to indicate timer base has retrograded while timer is running + + usage: + + raise excepting.TimerRetrogradeError(msg) + """ + def __init__(self, message = None): + self.message = message #description of error + self.args = (message) + + def __str__(self): + return ("{0}: {1}.\n".format(self.__class__.__name__, self.message)) + def Test(): """Module self test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/framing.py new/ioflo-1.1.9/ioflo/base/framing.py --- old/ioflo-1.1.5/ioflo/base/framing.py 2015-01-08 22:10:54.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/base/framing.py 2015-01-21 18:59:03.000000000 +0100 @@ -726,7 +726,7 @@ return (exits, enters) -class Frame(registering.StoriedRegistry): +class Frame(registering.StoriedRegistrar): """ Frame Class for hierarchical action framework object inherited instance attributes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/housing.py new/ioflo-1.1.9/ioflo/base/housing.py --- old/ioflo-1.1.5/ioflo/base/housing.py 2015-01-07 22:14:05.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/base/housing.py 2015-01-21 18:59:01.000000000 +0100 @@ -50,7 +50,7 @@ #Class definitions -class House(registering.StoriedRegistry): +class House(registering.StoriedRegistrar): """House Class for managing framework(s) includes store for framework and name registries for framers, frames, and actions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/logging.py new/ioflo-1.1.9/ioflo/base/logging.py --- old/ioflo-1.1.5/ioflo/base/logging.py 2014-09-24 04:37:02.000000000 +0200 +++ new/ioflo-1.1.9/ioflo/base/logging.py 2015-01-21 18:58:59.000000000 +0100 @@ -230,7 +230,7 @@ self.desire = ABORT self.status = ABORTED -class Log(registering.StoriedRegistry): +class Log(registering.StoriedRegistrar): """Log Class for logging to file Iherited instance attributes: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/odicting.py new/ioflo-1.1.9/ioflo/base/odicting.py --- old/ioflo-1.1.5/ioflo/base/odicting.py 2014-03-31 19:18:25.000000000 +0200 +++ new/ioflo-1.1.9/ioflo/base/odicting.py 2015-01-29 18:20:14.000000000 +0100 @@ -22,10 +22,8 @@ Changing the value of a key does not affect the order of the key """ - __slots__ = ['_keys'] - def __new__(cls, *args, **kwargs): self = dict.__new__(cls,*args, **kwargs) self._keys = [] @@ -74,7 +72,6 @@ for k in kwa: self[k] = kwa[k] - def __delitem__(self, key): """ del x[y] """ dict.__delitem__(self, key) @@ -148,7 +145,6 @@ if k not in self._keys: self[k] = kwa[k] - def insert(self, index, key, val): """ Insert val at index if key not in odict""" if key in self: @@ -196,7 +192,6 @@ del self[key] return (key, value) - def reorder(self, other): """ Update values in this odict based on the `other` odict or dict. reorder is ignored if other is not an odict @@ -216,7 +211,6 @@ keys.remove(key) keys.append(key) - def setdefault(self, key, default=None): """ If key in odict, return value at key Otherwise set value at key to default and return default @@ -245,6 +239,7 @@ def values(self): return [self[key] for key in self._keys] +ODict = odict # alias #from . import optimize #optimize.bind_all(odict) @@ -281,7 +276,6 @@ print(x) print(y) - def Test(): """Self test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/osetting.py new/ioflo-1.1.9/ioflo/base/osetting.py --- old/ioflo-1.1.5/ioflo/base/osetting.py 1970-01-01 01:00:00.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/base/osetting.py 2015-01-29 18:23:29.000000000 +0100 @@ -0,0 +1,84 @@ +"""Ordered set class. +Modified version of recipe +http://code.activestate.com/recipes/576694/ + + +""" +#print("module {0}".format(__name__)) +import collections + +class oset(collections.MutableSet): + """ + Ordered Set, preserves order of entry in set + + Usage: + s = oset('abracadaba') + t = oset('simsalabim') + print(s | t) + print(s & t) + print(s - t) + """ + + def __init__(self, iterable=None): + self.end = end = [] + end += [None, end, end] # sentinel node for doubly linked list + self.map = {} # key --> [key, prev, next] + if iterable is not None: + self |= iterable + + def __len__(self): + return len(self.map) + + def __contains__(self, key): + return key in self.map + + def add(self, key): + if key not in self.map: + end = self.end + curr = end[1] + curr[2] = end[1] = self.map[key] = [key, curr, end] + + def discard(self, key): + if key in self.map: + key, prev, next = self.map.pop(key) + prev[2] = next + next[1] = prev + + def __iter__(self): + end = self.end + curr = end[2] + while curr is not end: + yield curr[0] + curr = curr[2] + + def __reversed__(self): + end = self.end + curr = end[1] + while curr is not end: + yield curr[0] + curr = curr[1] + + def pop(self, last=True): + if not self: + raise KeyError('set is empty') + key = self.end[1][0] if last else self.end[2][0] + self.discard(key) + return key + + def __repr__(self): + if not self: + return '%s()' % (self.__class__.__name__,) + return '%s(%r)' % (self.__class__.__name__, list(self)) + + def __eq__(self, other): + if isinstance(other, OrderedSet): + return len(self) == len(other) and list(self) == list(other) + return set(self) == set(other) + + +if __name__ == '__main__': + s = oset('abracadaba') + t = oset('simsalabim') + print(s | t) + print(s & t) + print(s - t) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/registering.py new/ioflo-1.1.9/ioflo/base/registering.py --- old/ioflo-1.1.5/ioflo/base/registering.py 2014-12-10 00:28:33.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/base/registering.py 2015-01-21 18:58:56.000000000 +0100 @@ -52,7 +52,7 @@ odict(ioinits or odict()), odict(parms or odict())) -class Registry(object): +class Registrar(object): """Class that ensures every instance has a unique name uses class variable Counter and Names dictionary """ @@ -119,7 +119,7 @@ return cls.Names.get(name, None) -class StoriedRegistry(Registry): +class StoriedRegistrar(Registrar): """Adds store attribute to Registry instances """ __slots__ = ('store', ) @@ -133,7 +133,7 @@ .store = reference to shared data store """ - super(StoriedRegistry, self).__init__(**kw) + super(StoriedRegistrar, self).__init__(**kw) self.changeStore(store=store) def changeStore(self, store=None): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/skedding.py new/ioflo-1.1.9/ioflo/base/skedding.py --- old/ioflo-1.1.5/ioflo/base/skedding.py 2014-12-10 02:44:21.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/base/skedding.py 2015-02-13 23:37:41.000000000 +0100 @@ -125,8 +125,8 @@ self.stamp = float(abs(stamp)) #real time or sim time mode self.real = True if real else False - self.timer = aiding.Timer(duration = self.period) - self.elapsed = aiding.Timer() + self.timer = aiding.MonoTimer(duration = self.period, adjust=True) + self.elapsed = aiding.MonoTimer(adjust=True) self.filepath = os.path.abspath(filepath) self.plan = os.path.split(self.filepath)[1] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/storing.py new/ioflo-1.1.9/ioflo/base/storing.py --- old/ioflo-1.1.5/ioflo/base/storing.py 2015-01-09 20:42:24.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/base/storing.py 2015-01-21 18:58:19.000000000 +0100 @@ -52,7 +52,7 @@ return self -class Store(registering.Registry): +class Store(registering.Registrar): """global data store to be shared amoungst all taskers. Each object has the concept of ownership in the datashare. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/tasking.py new/ioflo-1.1.9/ioflo/base/tasking.py --- old/ioflo-1.1.5/ioflo/base/tasking.py 2014-12-19 21:11:45.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/base/tasking.py 2015-01-21 18:59:17.000000000 +0100 @@ -24,7 +24,7 @@ #Class definitions -class Tasker(registering.StoriedRegistry): +class Tasker(registering.StoriedRegistrar): """Task class, Base class for weightless threads """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/test/_testRegister.py new/ioflo-1.1.9/ioflo/base/test/_testRegister.py --- old/ioflo-1.1.5/ioflo/base/test/_testRegister.py 2014-07-24 19:06:14.000000000 +0200 +++ new/ioflo-1.1.9/ioflo/base/test/_testRegister.py 2015-01-21 18:58:10.000000000 +0100 @@ -10,7 +10,7 @@ self.store = store - print(A.Registry) + print(A.Registrar) def TestMetaclassify(): @@ -22,7 +22,7 @@ self.store = store - print(A.Registry) + print(A.Registrar) if __name__ == "__main__": diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/test/_testRegistry.py new/ioflo-1.1.9/ioflo/base/test/_testRegistry.py --- old/ioflo-1.1.5/ioflo/base/test/_testRegistry.py 2014-07-24 19:06:14.000000000 +0200 +++ new/ioflo-1.1.9/ioflo/base/test/_testRegistry.py 2015-01-21 18:58:16.000000000 +0100 @@ -4,16 +4,16 @@ def TestRegistry(): """Module self test """ - x = Registry() + x = Registrar() print(x.name) - y = Registry() + y = Registrar() print(y.name) name = "Hello" - if Registry.VerifyName(name): - z = Registry(name=name) - print(Registry.Names) - print(Registry.VerifyName(name)) + if Registrar.VerifyName(name): + z = Registrar(name=name) + print(Registrar.Names) + print(Registrar.VerifyName(name)) if __name__ == "__main__": TestRegistry() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/test/testActing.py new/ioflo-1.1.9/ioflo/base/test/testActing.py --- old/ioflo-1.1.5/ioflo/base/test/testActing.py 2015-01-13 20:06:37.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/base/test/testActing.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,195 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Unit Test Template -""" - -import sys -if sys.version_info < (2, 7): - import unittest2 as unittest -else: - import unittest - -import os - -from ioflo.test import testing -from ioflo.base.consoling import getConsole -console = getConsole() - - -from ioflo.base import acting -from ioflo.base import deeding -from ioflo.base import storing - - -def setUpModule(): - console.reinit(verbosity=console.Wordage.concise) - -def tearDownModule(): - pass - - -class BasicTestCase(testing.FrameIofloTestCase): - """ - Example TestCase - """ - - def setUp(self): - """ - Call super if override so House Framer and Frame are setup correctly - """ - super(BasicTestCase, self).setUp() - - def tearDown(self): - """ - Call super if override so House Framer and Frame are torn down correctly - """ - super(BasicTestCase, self).tearDown() - - def testActorify(self): - """ - Test the actorify decorator - """ - console.terse("{0}\n".format(self.testActorify.__doc__)) - @acting.actorify("BlueBeard") - def bearded(self, x=1, y=2): - """ - Actor action method - """ - z = x + y - return (self, z) - - self.assertIn("BlueBeard", acting.Actor.Registry) - actor, inits, ioinits, parms = acting.Actor.__fetch__("BlueBeard") - self.assertIs(actor._Parametric, True) - self.assertDictEqual(actor.Inits, {}) - self.assertDictEqual(actor.Ioinits, {}) - self.assertDictEqual(actor.Parms, {}) - self.assertDictEqual(inits, {}) - self.assertDictEqual(ioinits, {}) - self.assertDictEqual(parms, {}) - - actor = actor() # create instance - self.assertIsInstance(actor, acting.Actor ) - self.assertEqual(actor.__class__.__name__, "BlueBeard") - self.assertEqual(actor.action.im_class.__name__, "BlueBeard") - self.assertIs(actor.action.im_func, bearded) - self.assertIs(actor.action.im_self, actor) - self.assertEqual(actor.action.__doc__, '\n Actor action method\n ') - self.assertEqual(actor.action.__name__, 'bearded') - - me, z = actor() # perform action - self.assertIs(me, actor) - self.assertEqual(z, 3) - - - def testDeedify(self): - """ - Test the deedify decorator - """ - console.terse("{0}\n".format(self.testDeedify.__doc__)) - @deeding.deedify("BlackSmith") - def blackened(self, x=3, y=2): - """ - Deed action method - """ - z = x + y - return (self, z) - - self.assertIn("BlackSmith", deeding.Deed.Registry) - actor, inits, ioinits, parms = deeding.Deed.__fetch__("BlackSmith") - self.assertIs(actor._Parametric, False) - self.assertDictEqual(actor.Inits, {}) - self.assertDictEqual(actor.Ioinits, {}) - self.assertDictEqual(actor.Parms, {}) - self.assertDictEqual(inits, {}) - self.assertDictEqual(ioinits, {}) - self.assertDictEqual(parms, {}) - - actor = actor() # create instance - self.assertIsInstance(actor, deeding.Deed ) - self.assertEqual(actor.__class__.__name__, "BlackSmith") - self.assertEqual(actor.action.im_class.__name__, "BlackSmith") - self.assertIs(actor.action.im_func, blackened) - self.assertIs(actor.action.im_self, actor) - self.assertEqual(actor.action.__doc__, '\n Deed action method\n ') - self.assertEqual(actor.action.__name__, 'blackened') - - me, z = actor() # perform action - self.assertIs(me, actor) - self.assertEqual(z, 5) - - def testFrameDeed(self): - """ - Test adding a Deed to a frame and running it - """ - console.terse("{0}\n".format(self.testFrameDeed.__doc__)) - @deeding.deedify("TestDeed") - def action(self, a="Felgercarb", **kwa): - """ - Deed action method - """ - share = self.store.create(".test.a").update(value=a) - - self.assertIn("TestDeed", deeding.Deed.Registry) - act = self.addDeed("TestDeed") - self.assertIsInstance(act, acting.Act) - self.assertIn(act, self.frame.reacts) - self.assertEqual(act.actor, "TestDeed") - self.assertEqual(act.frame, self.frame.name) - - self.resolve() # resolve House - self.assertIs(act.frame, self.frame) - self.assertIs(act.frame.framer, self.framer) - self.assertIs(act.actor.store, self.store) - self.assertIn(act.actor.name, deeding.Deed.Registry) - self.assertEqual(act.actor.name, "TestDeed") - self.assertIsInstance(act.actor, deeding.Deed) - self.assertEqual(act.actor.__class__.__name__, "TestDeed") - self.assertEqual(act.actor.action.im_class.__name__, "TestDeed") - self.assertIs(act.actor.action.im_func, action) - self.assertIs(act.actor.action.im_self, act.actor) - self.assertEqual(act.actor.action.__doc__, '\n Deed action method\n ') - self.assertEqual(act.actor.action.__name__, 'action') - - self.assertIs(self.store.fetch(".test.a"), None) - self.frame.recur() # run reacts in frame - share = self.store.fetch(".test.a") - self.assertIsInstance(share, storing.Share ) - self.assertEqual(share.value, "Felgercarb") - - -def runOne(test): - ''' - Unittest Runner - ''' - test = BasicTestCase(test) - suite = unittest.TestSuite([test]) - unittest.TextTestRunner(verbosity=2).run(suite) - -def runSome(): - """ Unittest runner """ - tests = [] - names = ['testActorify', - 'testDeedify', - 'testFrameDeed', ] - tests.extend(map(BasicTestCase, names)) - suite = unittest.TestSuite(tests) - unittest.TextTestRunner(verbosity=2).run(suite) - -def runAll(): - """ Unittest runner """ - suite = unittest.TestSuite() - suite.addTest(unittest.TestLoader().loadTestsFromTestCase(BasicTestCase)) - unittest.TextTestRunner(verbosity=2).run(suite) - -if __name__ == '__main__' and __package__ is None: - - #console.reinit(verbosity=console.Wordage.concise) - - #runAll() #run all unittests - - runSome()#only run some - - #runOne('testBasic') - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/base/test/test_acting.py new/ioflo-1.1.9/ioflo/base/test/test_acting.py --- old/ioflo-1.1.5/ioflo/base/test/test_acting.py 1970-01-01 01:00:00.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/base/test/test_acting.py 2015-02-03 00:15:27.000000000 +0100 @@ -0,0 +1,210 @@ +# -*- coding: utf-8 -*- +""" +Unit Test Template +""" + +import sys +if sys.version_info < (2, 7): + import unittest2 as unittest +else: + import unittest + +import os + +from ioflo.test import testing +from ioflo.base.consoling import getConsole +console = getConsole() + + +from ioflo.base import acting +from ioflo.base import deeding +from ioflo.base import storing + + +def setUpModule(): + console.reinit(verbosity=console.Wordage.concise) + +def tearDownModule(): + pass + + +class BasicTestCase(testing.FrameIofloTestCase): + """ + Example TestCase + """ + + def setUp(self): + """ + Call super if override so House Framer and Frame are setup correctly + """ + super(BasicTestCase, self).setUp() + + def tearDown(self): + """ + Call super if override so House Framer and Frame are torn down correctly + """ + super(BasicTestCase, self).tearDown() + + def testActorify(self): + """ + Test the actorify decorator + """ + console.terse("{0}\n".format(self.testActorify.__doc__)) + @acting.actorify("BlueBeard") + def bearded(self, x=1, y=2): + """ + Actor action method + """ + z = x + y + return (self, z) + + self.assertIn("BlueBeard", acting.Actor.Registry) + actor, inits, ioinits, parms = acting.Actor.__fetch__("BlueBeard") + self.assertIs(actor._Parametric, True) + self.assertDictEqual(actor.Inits, {}) + self.assertDictEqual(actor.Ioinits, {}) + self.assertDictEqual(actor.Parms, {}) + self.assertDictEqual(inits, {}) + self.assertDictEqual(ioinits, {}) + self.assertDictEqual(parms, {}) + + actor = actor() # create instance + self.assertIsInstance(actor, acting.Actor ) + self.assertEqual(actor.__class__.__name__, "BlueBeard") + if sys.version > '3': + self.assertEqual(actor.action.__self__.__class__.__name__, "BlueBeard") + self.assertIs(actor.action.__func__, bearded) + self.assertIs(actor.action.__self__, actor) + else: + self.assertEqual(actor.action.im_class.__name__, "BlueBeard") + self.assertIs(actor.action.im_func, bearded) + self.assertIs(actor.action.im_self, actor) + self.assertEqual(actor.action.__doc__, '\n Actor action method\n ') + self.assertEqual(actor.action.__name__, 'bearded') + + me, z = actor() # perform action + self.assertIs(me, actor) + self.assertEqual(z, 3) + + + def testDeedify(self): + """ + Test the deedify decorator + """ + console.terse("{0}\n".format(self.testDeedify.__doc__)) + @deeding.deedify("BlackSmith") + def blackened(self, x=3, y=2): + """ + Deed action method + """ + z = x + y + return (self, z) + + self.assertIn("BlackSmith", deeding.Deed.Registry) + actor, inits, ioinits, parms = deeding.Deed.__fetch__("BlackSmith") + self.assertIs(actor._Parametric, False) + self.assertDictEqual(actor.Inits, {}) + self.assertDictEqual(actor.Ioinits, {}) + self.assertDictEqual(actor.Parms, {}) + self.assertDictEqual(inits, {}) + self.assertDictEqual(ioinits, {}) + self.assertDictEqual(parms, {}) + + actor = actor() # create instance + self.assertIsInstance(actor, deeding.Deed ) + self.assertEqual(actor.__class__.__name__, "BlackSmith") + if sys.version > '3': + self.assertEqual(actor.action.__self__.__class__.__name__, "BlackSmith") + self.assertIs(actor.action.__func__, blackened) + self.assertIs(actor.action.__self__, actor) + else: + self.assertEqual(actor.action.im_class.__name__, "BlackSmith") + self.assertIs(actor.action.im_func, blackened) + self.assertIs(actor.action.im_self, actor) + self.assertEqual(actor.action.__doc__, '\n Deed action method\n ') + self.assertEqual(actor.action.__name__, 'blackened') + + me, z = actor() # perform action + self.assertIs(me, actor) + self.assertEqual(z, 5) + + def testFrameDeed(self): + """ + Test adding a Deed to a frame and running it + """ + console.terse("{0}\n".format(self.testFrameDeed.__doc__)) + @deeding.deedify("TestDeed") + def action(self, a="Felgercarb", **kwa): + """ + Deed action method + """ + share = self.store.create(".test.a").update(value=a) + + self.assertIn("TestDeed", deeding.Deed.Registry) + act = self.addDeed("TestDeed") + self.assertIsInstance(act, acting.Act) + self.assertIn(act, self.frame.reacts) + self.assertEqual(act.actor, "TestDeed") + self.assertEqual(act.frame, self.frame.name) + + self.resolve() # resolve House + self.assertIs(act.frame, self.frame) + self.assertIs(act.frame.framer, self.framer) + self.assertIs(act.actor.store, self.store) + self.assertIn(act.actor.name, deeding.Deed.Registry) + self.assertEqual(act.actor.name, "TestDeed") + self.assertIsInstance(act.actor, deeding.Deed) + self.assertEqual(act.actor.__class__.__name__, "TestDeed") + if sys.version > '3': + self.assertEqual(act.actor.action.__self__.__class__.__name__, "TestDeed") + self.assertIs(act.actor.action.__func__, action) + self.assertIs(act.actor.action.__self__, act.actor) + else: + self.assertEqual(act.actor.action.im_class.__name__, "TestDeed") + self.assertIs(act.actor.action.im_func, action) + self.assertIs(act.actor.action.im_self, act.actor) + self.assertEqual(act.actor.action.__doc__, '\n Deed action method\n ') + self.assertEqual(act.actor.action.__name__, 'action') + + self.assertIs(self.store.fetch(".test.a"), None) + self.frame.recur() # run reacts in frame + share = self.store.fetch(".test.a") + self.assertIsInstance(share, storing.Share ) + self.assertEqual(share.value, "Felgercarb") + + +def runOne(test): + ''' + Unittest Runner + ''' + test = BasicTestCase(test) + suite = unittest.TestSuite([test]) + unittest.TextTestRunner(verbosity=2).run(suite) + +def runSome(): + """ Unittest runner """ + tests = [] + names = ['testActorify', + 'testDeedify', + 'testFrameDeed', ] + tests.extend(map(BasicTestCase, names)) + suite = unittest.TestSuite(tests) + unittest.TextTestRunner(verbosity=2).run(suite) + +def runAll(): + """ Unittest runner """ + suite = unittest.TestSuite() + suite.addTest(unittest.TestLoader().loadTestsFromTestCase(BasicTestCase)) + unittest.TextTestRunner(verbosity=2).run(suite) + +if __name__ == '__main__' and __package__ is None: + + #console.reinit(verbosity=console.Wordage.concise) + + #runAll() #run all unittests + + runSome()#only run some + + #runOne('testBasic') + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo/test/__init__.py new/ioflo-1.1.9/ioflo/test/__init__.py --- old/ioflo-1.1.5/ioflo/test/__init__.py 2015-01-12 19:59:20.000000000 +0100 +++ new/ioflo-1.1.9/ioflo/test/__init__.py 2015-02-03 18:26:55.000000000 +0100 @@ -35,7 +35,7 @@ console.terse("\nRunning ioflo tests starting at '{0}' from '{1}', \n".format(start, top)) loader = unittest.TestLoader() - suite = loader.discover(start, 'test*.py', top ) + suite = loader.discover(start, 'test_*.py', top ) unittest.TextTestRunner(verbosity=2).run(suite) if __name__ == "__main__": diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo.egg-info/PKG-INFO new/ioflo-1.1.9/ioflo.egg-info/PKG-INFO --- old/ioflo-1.1.5/ioflo.egg-info/PKG-INFO 2015-01-21 01:55:14.000000000 +0100 +++ new/ioflo-1.1.9/ioflo.egg-info/PKG-INFO 2015-02-13 23:58:16.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: ioflo -Version: 1.1.5 +Version: 1.1.9 Summary: Flow Based Programming Automated Reasoning Engine and Automation Operation System Home-page: https://github.com/ioflo/ioflo Author: Samuel M. Smith diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ioflo-1.1.5/ioflo.egg-info/SOURCES.txt new/ioflo-1.1.9/ioflo.egg-info/SOURCES.txt --- old/ioflo-1.1.5/ioflo.egg-info/SOURCES.txt 2015-01-21 01:55:14.000000000 +0100 +++ new/ioflo-1.1.9/ioflo.egg-info/SOURCES.txt 2015-02-13 23:58:17.000000000 +0100 @@ -27,8 +27,8 @@ ioflo/app/plan/testResolveDoClause.flo ioflo/app/plan/testSlave.flo ioflo/app/test/__init__.py -ioflo/app/test/testPlans.py -ioflo/app/test/testStart.py +ioflo/app/test/runplans.py +ioflo/app/test/runstart.py ioflo/base/__init__.py ioflo/base/acting.py ioflo/base/aiding.py @@ -49,6 +49,7 @@ ioflo/base/needing.py ioflo/base/odicting.py ioflo/base/optimize.py +ioflo/base/osetting.py ioflo/base/poking.py ioflo/base/registering.py ioflo/base/serving.py @@ -69,7 +70,7 @@ ioflo/base/test/_testStoring.py ioflo/base/test/_testTasking.py ioflo/base/test/_testmeta.py -ioflo/base/test/testActing.py +ioflo/base/test/test_acting.py ioflo/test/__init__.py ioflo/test/testTemplate.py ioflo/test/testing.py -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de