Skip to content
This repository was archived by the owner on Apr 26, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
713c130
futurized to python3
sergirubio Dec 9, 2019
2e53a62
requires python-future
sergirubio Dec 9, 2019
b332e14
futurized to python3
sergirubio Dec 9, 2019
0cb596f
Merge branch 'master' into develop
sergirubio Dec 9, 2019
b3479c3
Merge branch 'develop' into 'master'
sergirubio Dec 9, 2019
f1d9c46
adding tests
sergirubio Dec 23, 2019
f7540e8
Merge branch 'master' into develop
sergirubio Dec 24, 2019
64573af
Merge branch 'develop' into 'master'
sergirubio Dec 24, 2019
dda06c0
add repr to FriendlyDB
sergirubio Jan 8, 2020
c676df2
solve bug on DevError
sergirubio Jan 20, 2020
ca958a5
solve bug on ThreadDict.Stop()
sergirubio Jan 20, 2020
6115efe
update VERSION for develop (15)
sergirubio Jan 20, 2020
2aaa031
Merge branch 'master' of https://git.cells.es/ctpkg/fandango into dev…
sergirubio Jan 20, 2020
5e6838b
conflict fixed
sergirubio Feb 13, 2020
ea3a2ac
add delay pause to ThreadDict
sergirubio Feb 13, 2020
1c3f6f0
add cache to get_process_memory()
sergirubio Feb 13, 2020
64b2eb5
update setup.py for pip2
sergirubio Mar 3, 2020
cab73ed
version reverted to 14.9 (pre py3)
sergirubio Mar 3, 2020
efe9123
better get_process_memory
sergirubio Mar 16, 2020
43a20d4
SubprocessMethod update
sergirubio Mar 16, 2020
d1b439b
improve aggregators
sergirubio Mar 24, 2020
b0cc7a3
add getTableIndex
sergirubio Mar 24, 2020
ab0522f
add functional.inf
sergirubio Mar 24, 2020
d30fb5f
add try/except to SubprocessMethod
sergirubio Mar 24, 2020
ab6104c
solve bug in lambdas
sergirubio Mar 25, 2020
cbf02c8
replace asserts by raise
sergirubio Mar 25, 2020
96975be
solve py2to3 issues
sergirubio Mar 25, 2020
9bf1c86
14.9.2: asynchronous methods and decimation
sergirubio Mar 25, 2020
deda1d0
solve py3 bug
sergirubio Mar 25, 2020
e5688fe
solve py3 bug
sergirubio Mar 25, 2020
e53b1f9
allow to force a mysql driver
sergirubio Mar 31, 2020
033e73b
SubprocessMethod TimeOut(time) exception
sergirubio Mar 31, 2020
06320f3
remove future import
sergirubio Mar 31, 2020
be08072
Merge branch 'develop' of https://git.cells.es/ctpkg/fandango into de…
sergirubio Apr 1, 2020
8934534
solve return value in getTableRows()
sergirubio Apr 6, 2020
25cdfea
Merge branch 'develop' of https://github.com/tango-controls/fandango …
sergirubio Apr 6, 2020
8e4cb76
rename old event callback
sergirubio Oct 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions ci/test/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,25 @@ def test_rms():
"""
returns the rms value (sqrt of the squares average)
"""
#assert fandango.functional.rms
data = 1,2,3,4
assert fandango.functional.rms(data) == \
fandango.functional.math.sqrt(sum(a**2 for a in data))

def test_randomize():
"""
returns a randomized version of the list
"""
#assert fandango.functional.randomize
data = 1,2,3,4
rdata = fandango.functional.randomize(data)
assert all(a in rdata for a in data) and len(data) == len(rdata)

def test_randpop():
"""
removes and returns a random item from the sequence
"""
#assert fandango.functional.randpop
data = 1,2,3,4
rdata = [fandango.functional.randpop(data) for i in range(4)]
assert all(a in rdata for a in data) and len(data) == len(rdata)

def test_floor():
"""
Expand Down
9 changes: 9 additions & 0 deletions fandango/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ IMPORTANT:

MASTER branch provides python 2.6 compatible releases
DEVELOP branch will provide the current Py2.7/3.3 code

15.0.1 Develop Branch

like 14.8.1, but only compatible with PyTango2.7 (using future)

################################################################

14.8.2
solve bugs on tango_monitor and ThreadDict.stop()

14.8.1 Apply bugfixes/pull requests from github

Expand Down
2 changes: 1 addition & 1 deletion fandango/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.8.1
14.9.2
92 changes: 50 additions & 42 deletions fandango/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
## along with this program; if not, see <http://www.gnu.org/licenses/>.
####################################################################@########
"""
from __future__ import print_function
from __future__ import absolute_import
try:
from builtins import map
except:
pass


__doc__ = """
@package fandango
Expand All @@ -56,7 +63,7 @@
try:
os.remove(p)
print('%s removed ...'%p)
except Exception,e:
except Exception as e:
print(e)
print('fandango, CLEAN OLD FILES ERROR!:')
print('An old file still exists at:\n\t%s'%p)
Expand All @@ -66,70 +73,71 @@

try:
# LOAD VERSION NUMBER
import objects,imp
from objects import ReleaseNumber
from . import objects
import imp
from .objects import ReleaseNumber
PATH = os.path.dirname(objects.__file__)
vf = open(PATH+'/VERSION')
RELEASE = ReleaseNumber(map(int,vf.read().strip().split('.')))
RELEASE = ReleaseNumber(list(map(int,vf.read().strip().split('.'))))
vf.close()

except Exception,e:
except Exception as e:
print(traceback.format_exc())
print('Unable to load RELEASE number: %s'%e)

try:
import pkg_resources
__version__ = pkg_resources.get_distribution(__name__).version
except Exception, e:
except Exception as e:
#print ('Unable to get distribution version number, fandango has '
# 'probably not been installed as a package')
__version__ = RELEASE

__test__ = ['tango']

try:
from functional import *
except Exception,e:
from .functional import *
except Exception as e:
print('Unable to import functional module: %s'%e)

try:
from log import printf,Logger,LogFilter,shortstr,\
from .log import printf,Logger,LogFilter,shortstr,\
except2str,FakeLogger,pprint
except Exception,e:
except Exception as e:
print('Unable to import log module: %s'%e)

try:
from excepts import trial,getLastException,getPreviousExceptions, \
from .excepts import trial,getLastException,getPreviousExceptions, \
ExceptionWrapper,Catched,CatchedArgs
except:
print('Unable to import excepts module')

try:
from objects import Object,Singleton,SingletonMap,Struct,NamedProperty
from objects import dirModule,loadModule,dirClasses,obj2dict,copy
from objects import Decorator,ClassDecorator,Decorated,BoundDecorator
from objects import Cached, Variable
except Exception,e:
from .objects import Object,Singleton,SingletonMap,Struct,NamedProperty
from .objects import dirModule,loadModule,dirClasses,obj2dict,copy
from .objects import Decorator,ClassDecorator,Decorated,BoundDecorator
from .objects import Cached, Variable
except Exception as e:
print('Unable to import objects module: %s'%traceback.format_exc())

try:
from linos import shell_command,ping,sysargs_to_dict,listdir, \
from .linos import shell_command,ping,sysargs_to_dict,listdir, \
sendmail,MyMachine,get_fqdn
except:
print('Unable to import linos module: %s\n'%traceback.format_exc())

try:
from arrays import CSVArray, TimedQueue
from .arrays import CSVArray, TimedQueue
except:
print('Unable to import arrays module')

try:
from doc import *
from .doc import *
except:
print('Unable to import doc module')

try:
from dicts import ThreadDict,CaselessDict,ReversibleDict, \
from .dicts import ThreadDict,CaselessDict,ReversibleDict, \
CaselessDefaultDict,DefaultThreadDict, \
Enumeration,SortedDict,CaselessList, \
defaultdict,defaultdict_fromkey, \
Expand All @@ -139,19 +147,19 @@
traceback.print_exc()

try:
from threads import WorkerProcess,WorkerThread,SingletonWorker,\
from .threads import WorkerProcess,WorkerThread,SingletonWorker,\
wait,timed_range
except:
print('Unable to import threads module')

try:
from debug import Timed, timeit
except Exception,e:
from .debug import Timed, timeit
except Exception as e:
print('Unable to import debug module')

#TANGO related modules
try:
from tango import finder,get_device,get_database,get_database_device, \
from .tango import finder,get_device,get_database,get_database_device, \
get_all_devices,get_device_info,get_alias_for_device, \
get_device_for_alias,get_tango_host, \
find_devices,find_attributes, find_properties,\
Expand All @@ -164,12 +172,12 @@
fakeEvent,fakeEventType, get_attribute_events, check_attribute_events

try:
from device import Dev4Tango,DevChild,TangoCommand
except Exception,e: raise Exception('fandango.device: %s'%e)
from .device import Dev4Tango,DevChild,TangoCommand
except Exception as e: raise Exception('fandango.device: %s'%e)

try:
from servers import ServersDict,Astor,ProxiesDict,ComposersDict
except Exception,e: raise Exception('fandango.servers: %s'%e)
from .servers import ServersDict,Astor,ProxiesDict,ComposersDict
except Exception as e: raise Exception('fandango.servers: %s'%e)

try:
path = imp.find_module('fandango')[1]
Expand All @@ -180,33 +188,33 @@
%','.join(deprecated))
try: [os.remove(f) for f in deprecated]
except: print('... and should be removed manually!')
from interface import FullTangoInheritance,NewTypeInheritance
except Exception,e: raise Exception('fandango.interface: %s'%e)
from .interface import FullTangoInheritance,NewTypeInheritance
except Exception as e: raise Exception('fandango.interface: %s'%e)

try:
from dynamic import DynamicDS,DynamicDSClass,DynamicAttribute, \
from .dynamic import DynamicDS,DynamicDSClass,DynamicAttribute, \
DynamicDSTypes,CreateDynamicCommands,DynamicServer
except Exception,e: raise Exception('fandango.dynamic: %s'%e)
except Exception as e: raise Exception('fandango.dynamic: %s'%e)

try:
from callbacks import EventSource,EventThread,EventListener, \
from .callbacks import EventSource,EventThread,EventListener, \
CachedAttributeProxy,TangoListener,TangoAttribute
except Exception,e: raise Exception('fandango.callbacks: %s'%e)
except Exception as e: raise Exception('fandango.callbacks: %s'%e)

except Exception,e:
except Exception as e:
print('Unable to import fandango.*tango modules: %s'%e)
print traceback.format_exc()
print(traceback.format_exc())



#OTHER fancy modules
if False: #Disabled to avoid extra dependencies!!
try: import web
except: print 'Unable to import fandango.web module'
try: import qt
except: print 'Unable to import fandango.qt module'
try: from db import FriendlyDB
except: print 'Unable to import db module'
try: from . import web
except: print('Unable to import fandango.web module')
try: from . import qt
except: print('Unable to import fandango.qt module')
try: from .db import FriendlyDB
except: print('Unable to import db module')

__all__ = ['dicts','excepts','log','objects','db','device','web','threads',
'dynamic','callbacks','arrays','servers','linos','functional',
Expand Down
Loading