Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
Merge 13.9 bugfixes from branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
sergirubio committed Aug 24, 2018
2 parents 5029862 + db8bb11 commit 0d0c2b6
Show file tree
Hide file tree
Showing 12 changed files with 402 additions and 191 deletions.
21 changes: 20 additions & 1 deletion fandango/CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RELEASE_NOTE = "Fandango 13.2.*; Cached tango database methods"
RELEASE_NOTE = "Fandango 13.*; Cached tango database methods"

"""
IMPORTANT:
Expand All @@ -11,6 +11,25 @@ BUGS PENDING for 13.* (to not be released in master until bugs will be solved)
threads.wait: exceptions on ipython exit
threads/WorkerDS: uncatched deadlocks

13.9.0 - August 2018
--------------------

DynamicDS:
solves critical bug in get_default_properties
Enable events on raw attribute change
Solve bugs on array events and qualities

tango_monitor refactored
fixed bugs on EventSource init/del
allow dots on device names (req by Philal)
better event check
set archive event as optional on DynamicDS
export devices: vector/list bug solved by kmadisa
export more attribute properties (by kmadisa)
critical bug solved on XATTR (long uris)



13.7.0 - Abril 2018
-------------------
Add get_attr_name, get_dev_name methods
Expand Down
2 changes: 1 addition & 1 deletion fandango/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
13.8.0
13.9.0
19 changes: 11 additions & 8 deletions fandango/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,14 @@ def __init__(self, name, keeptime=1000., fake=False, parent=None, **kw):
Arguments: loglevel, tango_asynch, pollingPeriod, keeptime,
enablePolling, use_events
"""
##Set logging
#self.call__init__(Logger,self.full_name) ##This fails, for unknown reasons
Logger.__init__(self,name) #self.full_name) #This must be done early

self.setLogLevel(kw.get('loglevel',kw.get('log_level',
kw.get('logLevel',self.DEFAULT_LOG))))
self.info('Init(%s)'%str(kw))

#@TODO: All this mangling to be replaced by fandango.parse_tango_model
if 0 < name.replace('//','/').count('/') < name.count(':')+3:
name += '/state'
Expand Down Expand Up @@ -637,14 +645,7 @@ def __init__(self, name, keeptime=1000., fake=False, parent=None, **kw):
self.normal_name = '/'.join(self.device.split('/')[-3:]
+[self.simple_name])
assert self.fake or self.proxy,\
'%s,%s: A valid device name is needed'%(name,parent)

##Set logging
#self.call__init__(Logger,self.full_name) ##This fails, for unknown reasons
Logger.__init__(self,self.full_name)
self.setLogLevel(kw.get('loglevel',kw.get('log_level',
kw.get('logLevel',self.DEFAULT_LOG))))
self.info('Init(%s)'%str(kw))
'%s: A valid and existing device is needed'%(name)

self.listeners = defaultdict(set) #[]
self.event_ids = dict() # An {EventType:ID} dict
Expand Down Expand Up @@ -706,6 +707,8 @@ def getNormalName(self): return self.normal_name

def cleanUp(self):
self.debug("cleanUp")
if not hasattr(self,'listeners'):
return
while self.listeners:
self.removeListener(self.listeners.popitem(),exclude='')
if self.isPollingEnabled():
Expand Down
20 changes: 19 additions & 1 deletion fandango/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,26 @@
Go to http://mysql-python.sourceforge.net/MySQLdb.html for further information
"""

import time,datetime,log,traceback,sys
import os,time,datetime,log,traceback,sys

import MySQLdb
"""
Instead of using the outdated MySQL-python package or Oracle's mysql.connector,
try to install mysqlclient instead:
https://pypi.org/project/mysqlclient/#description
https://github.com/PyMySQL/mysqlclient-python
https://mysqlclient.readthedocs.io
To install it on Debian:
sudo aptitude remove python-mysqldb
sudo aptitude install python-pip
sudo aptitude install libmariadbclient-dev
sudo pip install mysqlclient
"""


class FriendlyDB(log.Logger):
"""
Expand Down
8 changes: 6 additions & 2 deletions fandango/dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,12 @@ def start(self):
#@self_locked
def stop(self):
print 'Stopping ThreadDict ...'
if self.threaded and hasattr(self,'event'): self.event.set()
if hasattr(self,'_Thread'): self._Thread.join()
if self.threaded and hasattr(self,'event'):
print('event set')
self.event.set()
if hasattr(self,'_Thread'):
print('thread join')
self._Thread.join()
print 'ThreadDict Stopped'

def alive(self):
Expand Down
Loading

0 comments on commit 0d0c2b6

Please sign in to comment.