core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:

generation of D-Bus bridge has been broken by black formatting tool, this patch fixes this.
This commit is contained in:
Goffi 2018-07-01 20:37:58 +02:00
commit f2b1398a9f
8 changed files with 303 additions and 918 deletions

View file

@ -145,19 +145,8 @@ class Constructor(object):
i = 0
while i < len(signature):
if signature[i] not in [
"b",
"y",
"n",
"i",
"x",
"q",
"u",
"t",
"d",
"s",
"a",
]:
if signature[i] not in ["b", "y", "n", "i", "x", "q", "u", "t", "d", "s",
"a"]:
raise ParseError("Unmanaged attribute type [%c]" % signature[i])
if signature[i] == "a":

View file

@ -29,7 +29,7 @@ class DbusXmlConstructor(base_constructor.Constructor):
base_constructor.Constructor.__init__(self, bridge_template, options)
self.template = "dbus_xml_template.xml"
self.core_dest = "org.goffi.sat.xml"
self.core_dest = "org.salutatoi.sat.xml"
self.default_annotation = {
"a{ss}": "StringDict",
"a(sa{ss}as)": "QList<Contact>",

View file

@ -1,4 +1,4 @@
<node>
<interface name="org.goffi.SAT.core">
<interface name="org.salutatoi.SAT.core">
</interface>
</node>

View file

@ -28,9 +28,9 @@ log = getLogger(__name__)
from twisted.internet.defer import Deferred
from sat.core.exceptions import BridgeInitError
const_INT_PREFIX = "org.goffi.SAT" # Interface prefix
const_INT_PREFIX = "org.salutatoi.SAT" # Interface prefix
const_ERROR_PREFIX = const_INT_PREFIX + ".error"
const_OBJ_PATH = "/org/goffi/SAT/bridge"
const_OBJ_PATH = "/org/salutatoi/SAT/bridge"
const_CORE_SUFFIX = ".core"
const_PLUGIN_SUFFIX = ".plugin"
@ -128,10 +128,10 @@ class DbusObject(dbus.service.Object):
# further investigations
pass
##SIGNALS_PART##
##SIGNALS_PART##
### methods ###
##METHODS_PART##
##METHODS_PART##
def __attributes(self, in_sign):
"""Return arguments to user given a in_sign
@param in_sign: in_sign in the short form (using s,a,i,b etc)
@ -272,7 +272,7 @@ class Bridge(object):
self.dbus_name = dbus.service.BusName(const_INT_PREFIX, self.session_bus)
self.dbus_bridge = DbusObject(self.session_bus, const_OBJ_PATH)
##SIGNAL_DIRECT_CALLS_PART##
##SIGNAL_DIRECT_CALLS_PART##
def register_method(self, name, callback):
log.debug("registering DBus bridge method [%s]" % name)
self.dbus_bridge.register_method(name, callback)

View file

@ -29,9 +29,9 @@ DBusGMainLoop(set_as_default=True)
import ast
const_INT_PREFIX = "org.goffi.SAT" # Interface prefix
const_INT_PREFIX = "org.salutatoi.SAT" # Interface prefix
const_ERROR_PREFIX = const_INT_PREFIX + ".error"
const_OBJ_PATH = '/org/goffi/SAT/bridge'
const_OBJ_PATH = '/org/salutatoi/SAT/bridge'
const_CORE_SUFFIX = ".core"
const_PLUGIN_SUFFIX = ".plugin"
const_TIMEOUT = 120

File diff suppressed because it is too large Load diff

View file

@ -103,6 +103,7 @@ class Bridge(object):
self, name, lambda *args, **kwargs: self.sendSignal(name, *args, **kwargs)
)
def actionNew(self, action_data, id, security_limit, profile):
self.sendSignal("actionNew", action_data, id, security_limit, profile)
@ -118,30 +119,8 @@ class Bridge(object):
def entityDataUpdated(self, jid, name, value, profile):
self.sendSignal("entityDataUpdated", jid, name, value, profile)
def messageNew(
self,
uid,
timestamp,
from_jid,
to_jid,
message,
subject,
mess_type,
extra,
profile,
):
self.sendSignal(
"messageNew",
uid,
timestamp,
from_jid,
to_jid,
message,
subject,
mess_type,
extra,
profile,
)
def messageNew(self, uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile):
self.sendSignal("messageNew", uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile)
def newContact(self, contact_jid, attributes, groups, profile):
self.sendSignal("newContact", contact_jid, attributes, groups, profile)

View file

@ -172,7 +172,7 @@ class Const(object):
if (
BaseDirectory
): # skipped when xdg module is not available (should not happen in backend)
if "org.goffi.cagou.cagou" in BaseDirectory.__file__:
if "org.salutatoi.cagou.cagou" in BaseDirectory.__file__:
# FIXME: hack to make config read from the right location on Android
# TODO: fix it in a more proper way
@ -184,8 +184,8 @@ class Const(object):
BaseDirectory = None
DEFAULT_CONFIG = {
"local_dir": "/data/data/org.goffi.cagou.cagou/app",
"media_dir": "/data/data/org.goffi.cagou.cagou/files/app/media",
"local_dir": "/data/data/org.salutatoi.cagou.cagou/app",
"media_dir": "/data/data/org.salutatoi.cagou.cagou/files/app/media",
# FIXME: temporary location for downloads, need to call API properly
"downloads_dir": os.path.join(
Environment.getExternalStoragePublicDirectory(
@ -197,7 +197,7 @@ class Const(object):
"log_dir": "%(local_dir)s",
}
CONFIG_FILES = [
"/data/data/org.goffi.cagou.cagou/files/app/android/"
"/data/data/org.salutatoi.cagou.cagou/files/app/android/"
+ APP_NAME_FILE
+ ".conf"
]