answered
2018-09-20 20:55:55 +0200
Sorry about the not existing code yet: I am just in the last steps before publishing both source and package. But for understanding some snippets.
I have defined a Singleton class in python (like e. g. described here: https://stackoverflow.com/questions/6760685/creating-a-singleton-in-python Method 3A - python3 part)
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]
And then a Singleton member class is defined like this (it is a factory for an Archive class defined somewhere else, uses another Factory class):
class ArchiveFactory(metaclass=Singleton):
"""
Factory which creates an Archive if it does not exist or gets the pickle
otherwise if returns the Singleton
"""
def __init__(self, progname=('podqast')):
"""
Initialization
"""
self.archive = None
def get_archive(self):
"""
Get the Archive
"""
if not self.archive:
self.archive = Factory().get_store().get(archivename)
if not self.archive:
self.archive = Archive()
self.have_archive = True
return self.archive
return self.archive
When packaging the python code is compiled to pyc files. And in this step I get a error message with 1807:
Compiling /home/deploy/installroot/usr/share/harbour-podqast/python/podcast/archive.py ...
File "/usr/share/harbour-podqast/python/podcast/archive.py", line 66
class ArchiveFactory(metaclass=Singleton):
^
SyntaxError: invalid syntax
But this is no syntax error in python3.
@cy8aer Is the source code of your project available somewhere? If not, a small example would be appreciated. (Please consider converting your comments to a separate question or at least an answer.)
martyone ( 2018-09-20 23:03:30 +0200 )editHi.
I have noticed a new entry inside the 'Devices' options: I mean Tools --> Options --> Devices called Android :).
Was this option there before or may it be related to the upcoming Android upgrade for SFOS 3?
Regards.
Pasko ( 2018-09-28 18:47:40 +0200 )edit@Pasko Unfortunately this is a regression introduced with Qt Creator upgrade - the Android plugin should be still disabled in our fork of Qt Creator.
martyone ( 2018-10-01 09:15:29 +0200 )edit