diff options
author | Alexander Akulich <akulichalexander@gmail.com> | 2020-11-01 02:11:34 +0300 |
---|---|---|
committer | Alexander Akulich <akulichalexander@gmail.com> | 2020-11-01 02:11:39 +0300 |
commit | 2d1ec29f6dc3246746f1fc39730ab39b5d4516bf (patch) | |
tree | 3e514a388884a00adf683aac8f8d71bb4aadbc9f | |
parent | cf646c5c0d8a47ae15e4ecbea015b75c56eea4a0 (diff) | |
parent | b0f139ff63c4d5f9471423422f298443ae222f9a (diff) | |
download | telepathy-idle-2d1ec29f6dc3246746f1fc39730ab39b5d4516bf.tar.gz |
Merge branch 'telepathy-idle-0.2'
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | NEWS | 30 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | data/meson.build | 13 | ||||
-rw-r--r-- | extensions/_gen/meson.build | 58 | ||||
-rw-r--r-- | extensions/meson.build | 29 | ||||
-rw-r--r-- | meson.build | 87 | ||||
-rw-r--r-- | meson_options.txt | 13 | ||||
-rw-r--r-- | src/idle-parser.c | 34 | ||||
-rw-r--r-- | src/idle-server-connection.c | 3 | ||||
-rw-r--r-- | src/meson.build | 52 | ||||
-rw-r--r-- | tests/meson.build | 37 | ||||
-rw-r--r-- | tests/twisted/config.py.in | 1 | ||||
-rw-r--r-- | tests/twisted/meson.build | 93 | ||||
-rw-r--r-- | tests/twisted/messages/invalid-utf8.py | 2 | ||||
-rw-r--r-- | tests/twisted/tools/idletest.cert | 26 | ||||
-rw-r--r-- | tests/twisted/tools/idletest.key | 32 | ||||
-rw-r--r-- | tests/twisted/tools/meson.build | 22 | ||||
-rw-r--r-- | tools/glib-ginterface-gen.py | 13 | ||||
-rw-r--r-- | tools/libglibcodegen.py | 4 | ||||
-rw-r--r-- | tools/make-release-mail.py | 23 |
21 files changed, 535 insertions, 42 deletions
@@ -48,6 +48,7 @@ Makefile.in data/org.freedesktop.Telepathy.ConnectionManager.idle.service extensions/_gen +!extensions/_gen/meson.build extensions/extensions.html src/telepathy-idle @@ -1,3 +1,33 @@ + +telepathy-idle 0.2.1 (2020-11-01) +================================== + + +Enhancements: + +• Port build tools to Python 3 (Michael Catanzaro) + +• Add meson build system (Jan Tojnar) + +Fixes: + +• Update test to Python 3 (Tomi Leppänen) + +• Properly handle long IRC messages (polari#147, Michael Catanzaro) + +• Fix a critical message from GLib on disconnecting (Guillaume, Diane Trout) + +• Fix message corruption on accident bling removal (Florian Muellner) + +• Update the certificate for tests (Diane Trout) + +• Fix "Invalid utf8" test for Python 3 (Diane Trout) + +• Properly handle channels with a '!' at the start of name (Daniel Landau) + +• Properly handle modechars (Daniel Landau) + + telepathy-idle 0.2.0 (2013-10-03) ================================= diff --git a/configure.ac b/configure.ac index 02a5966..4aa24ca 100644 --- a/configure.ac +++ b/configure.ac @@ -11,8 +11,8 @@ AC_PREREQ([2.60]) m4_define([idle_major_version], [0]) m4_define([idle_minor_version], [2]) -m4_define([idle_micro_version], [0]) -m4_define([idle_nano_version], [1]) +m4_define([idle_micro_version], [1]) +m4_define([idle_nano_version], [0]) m4_define([idle_base_version], [idle_major_version.idle_minor_version.idle_micro_version]) diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..2edead8 --- /dev/null +++ b/data/meson.build @@ -0,0 +1,13 @@ +# Telepathy manager file +install_data( + 'idle.manager', + install_dir: managerdir, +) + +# Dbus service file +configure_file( + input: 'org.freedesktop.Telepathy.ConnectionManager.idle.service.in', + output: '@BASENAME@', + configuration: pathconf, + install_dir: dbus_services_dir, +) diff --git a/extensions/_gen/meson.build b/extensions/_gen/meson.build new file mode 100644 index 0000000..9f40cdd --- /dev/null +++ b/extensions/_gen/meson.build @@ -0,0 +1,58 @@ +xsltproc_with_flags = [xsltproc, '--nonet', '--novalid'] + +gen_all_xml = custom_target( + 'all.xml', + input: [ + join_paths(tools_dir, 'identity.xsl'), + join_paths('..', 'all.xml'), + ], + output: 'all.xml', + command: xsltproc_with_flags + ['--xinclude', '@INPUT@'], + capture: true, +) + +gen_svc = custom_target( + 'svc', + input: [ + join_paths(tools_dir, 'glib-ginterface-gen.py'), + gen_all_xml, + ], + output: [ + 'svc.h', + 'svc-gtk-doc.h', + 'svc.c', + ], + command: [ + python2, + '@INPUT0@', + '--filename=extensions/_gen/svc', + '--signal-marshal-prefix=_idle_ext', + '--include=<telepathy-glib/telepathy-glib.h>', + '--not-implemented-func=tp_dbus_g_method_return_not_implemented', + '--allow-unstable', + '@INPUT1@', + 'Idle_Svc_', + ], +) + +gen_enums_h = custom_target( + 'enums.h', + input: [ + join_paths(tools_dir, 'c-constants-generator.xsl'), + gen_all_xml, + ], + output: 'enums.h', + command: xsltproc_with_flags + ['--stringparam', 'mixed-case-prefix', 'Idle', '@INPUT@'], + capture: true, +) + +gen_interfaces_h = custom_target( + 'interfaces.h', + input: [ + join_paths(tools_dir, 'c-interfaces-generator.xsl'), + gen_all_xml, + ], + output: 'interfaces.h', + command: xsltproc_with_flags + ['--stringparam', 'mixed-case-prefix', 'Idle', '@INPUT@'], + capture: true, +) diff --git a/extensions/meson.build b/extensions/meson.build new file mode 100644 index 0000000..388820d --- /dev/null +++ b/extensions/meson.build @@ -0,0 +1,29 @@ +xmls = files( + 'all.xml', + 'Connection_Interface_IRC_Command1.xml', +) + +subdir('_gen') + +libidle_extensions = library( + 'idle-extensions', + sources: [ + 'extensions.h', + gen_svc[2], + gen_enums_h, + gen_interfaces_h, + ], + dependencies: idle_deps, + include_directories: include_directories('..'), +) + +gen_extensions_html = custom_target( + 'extensions.html', + input: [ + join_paths(tools_dir, 'doc-generator.xsl'), + gen_all_xml, + ], + output: 'extensions.html', + command: xsltproc_with_flags + ['@INPUT@'], + capture: true, +) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..f2839fe --- /dev/null +++ b/meson.build @@ -0,0 +1,87 @@ +# Making releases: +# set the new version number: +# odd minor -> development series +# even minor -> stable series +# increment micro for each release within a series +# set nano_version to 0 +# make the release, tag it +# set nano_version to 1 + +project( + 'telepathy-idle', + 'c', + version: '0.2.0.1', + default_options: [ + 'c_std=c99', + ], + meson_version: '>= 0.50.0', +) + +package_string = '@0@-@1@'.format(meson.project_name(), meson.project_version()) + +cc = meson.get_compiler('c') + +glib = dependency('glib-2.0', version: '>= 2.32.0') +gobject = dependency('gobject-2.0', version: '>= 2.32.0') +gio = dependency('gio-2.0', version: '>= 2.32.0') +dbus = dependency('dbus-1', version: '>= 0.51') +dbus_glib = dependency('dbus-glib-1', version: '>= 0.51') +telepathy_glib = dependency('telepathy-glib', version: '>= 0.23.0') + +idle_deps = [ + glib, + gobject, + gio, + dbus, + dbus_glib, + telepathy_glib, +] + +xsltproc = find_program('xsltproc') +python2 = import('python').find_installation('python2') + +# check for a version of python that can run the twisted tests +if get_option('twisted_tests') + if run_command(python2, '-c', '''from sys import version_info; import dbus, dbus.mainloop.glib; raise SystemExit(version_info < (2, 5, 0, 'final', 0))''').returncode() != 0 or run_command(python2, '-c', '''import twisted.words.protocols.irc, twisted.internet.reactor''').returncode() != 0 + error('Missing twisted IRC support') + endif + + test_python = python2.path() +endif + +# Directories + +datadir = join_paths(get_option('prefix'), get_option('datadir')) +libexecdir = join_paths(get_option('prefix'), get_option('libexecdir')) +pkglibexecdir = join_paths(libexecdir, meson.project_name()) +dbus_services_dir = join_paths(datadir, 'dbus-1', 'services') +managerdir = join_paths(datadir, 'telepathy', 'managers') + +# Configuration + +conf_data = configuration_data() +conf_data.set_quoted('DBUS_SERVICES_DIR', dbus_services_dir, description: 'DBus services directory') +conf_data.set('GLIB_VERSION_MIN_REQUIRED', 'GLIB_VERSION_2_28', description: 'Ignore post 2.28 deprecations') +conf_data.set('GLIB_VERSION_MAX_ALLOWED', 'GLIB_VERSION_2_32', description: 'Prevent post 2.32 APIs') +conf_data.set('TP_SEAL_ENABLE', '', description: 'Prevent to use sealed variables') +conf_data.set('TP_DISABLE_SINGLE_INCLUDE', '', description: 'Disable single header include') +conf_data.set('TP_VERSION_MIN_REQUIRED', 'TP_VERSION_0_24', description: 'Ignore post 0.24 deprecations') +conf_data.set('TP_VERSION_MAX_ALLOWED', 'TP_VERSION_0_24', description: 'Prevent post 0.24 APIs') +conf_data.set_quoted('VERSION', meson.project_version()) +if cc.has_function('strnlen') + conf_data.set10('HAVE_STRNLEN', true) +endif + +configure_file( + output: 'config.h', + configuration: conf_data, +) + +configuration_inc = include_directories('.') +src_inc = include_directories('src') +tools_dir = join_paths(meson.current_source_dir(), 'tools') + +subdir('extensions') +subdir('src') +subdir('data') +subdir('tests') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..01583da --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,13 @@ +option( + 'twisted_tests', + type: 'boolean', + value: true, + description: 'Enable tests using Python with Twisted and IRC protocol support', +) + +option( + 'twisted_sleep', + type: 'string', + value: '0', + description: 'Number of seconds to sleep in twisted tests', +) diff --git a/src/idle-parser.c b/src/idle-parser.c index 6f0885c..ec454ec 100644 --- a/src/idle-parser.c +++ b/src/idle-parser.c @@ -151,6 +151,7 @@ struct _IdleParserPrivate { /* continuation line buffer */ gchar split_buf[IRC_MSG_MAXLEN + 3]; + guint split_buf_used; /* message handlers */ GSList *handlers[IDLE_PARSER_LAST_MESSAGE_CODE]; @@ -226,6 +227,13 @@ strnlen(const char *msg, size_t maxlen) } #endif +static void clear_split_buf(IdleParser *parser) { + IdleParserPrivate *priv = IDLE_PARSER_GET_PRIVATE(parser); + + memset(priv->split_buf, '\0', IRC_MSG_MAXLEN + 3); + priv->split_buf_used = 0; +} + void idle_parser_receive(IdleParser *parser, const gchar *msg) { IdleParserPrivate *priv = IDLE_PARSER_GET_PRIVATE(parser); guint i; @@ -245,7 +253,7 @@ void idle_parser_receive(IdleParser *parser, const gchar *msg) { if ((lasti == 0) && (priv->split_buf[0] != '\0')) { g_strlcpy(g_stpcpy(concat_buf, priv->split_buf), msg, i + 1); tmp = concat_buf; - memset(priv->split_buf, '\0', IRC_MSG_MAXLEN + 3); + clear_split_buf(parser); } else { tmp = g_strndup(msg + lasti, i - lasti); } @@ -264,10 +272,18 @@ void idle_parser_receive(IdleParser *parser, const gchar *msg) { } } - if (!line_ends) - g_strlcpy(priv->split_buf, msg + lasti, (IRC_MSG_MAXLEN + 3) - lasti); - else - memset(priv->split_buf, '\0', IRC_MSG_MAXLEN + 3); + if (!line_ends) { + len = strlen(msg + lasti); + if (len > (IRC_MSG_MAXLEN + 3) - priv->split_buf_used - 1) { + IDLE_DEBUG("Discarding content that exceeds maximum message length: \"%s\"", msg + lasti); + clear_split_buf(parser); + } else { + g_strlcpy(priv->split_buf + priv->split_buf_used, msg + lasti, (IRC_MSG_MAXLEN + 3) - priv->split_buf_used); + priv->split_buf_used += len; + } + } else { + clear_split_buf(parser); + } } void idle_parser_add_handler(IdleParser *parser, IdleParserMessageCode code, IdleParserMessageHandler handler, gpointer user_data) { @@ -502,7 +518,13 @@ static gboolean _parse_atom(IdleParser *parser, GValueArray *arr, char atom, con gchar *id, *bang = NULL; gchar modechar = '\0'; - if (idle_muc_channel_is_modechar(token[0])) { + /* Channel names can start with a '!', so don't strip that + * (https://tools.ietf.org/html/rfc2811#section-3.2), not + * even when expecting a nickname (without mode chars) as + * that ends up for example messing up PRIMSG handling and + * showing the same message as both a channel and a private + * message */ + if (atom == 'C' && idle_muc_channel_is_modechar(token[0])) { modechar = token[0]; token++; } diff --git a/src/idle-server-connection.c b/src/idle-server-connection.c index 878b199..c463fe0 100644 --- a/src/idle-server-connection.c +++ b/src/idle-server-connection.c @@ -590,7 +590,10 @@ void idle_server_connection_send_async(IdleServerConnection *conn, const gchar * * with null bytes gives us cleaner debug messages, without * affecting the readability of the code. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-truncation" strncpy(priv->output_buffer, cmd, output_buffer_size); +#pragma GCC diagnostic pop priv->nwritten = 0; diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..c264c02 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,52 @@ +libidle_convenience = library( + 'idle-convenience', + sources: [ + 'idle-connection.c', + 'idle-connection-manager.c', + 'idle-contact-info.c', + 'idle-ctcp.c', + 'idle-debug.c', + 'idle-handles.c', + 'idle-im-channel.c', + 'idle-im-manager.c', + 'idle-muc-channel.c', + 'idle-muc-manager.c', + 'room-config.c', + 'idle-parser.c', + 'protocol.c', + 'idle-roomlist-channel.c', + 'idle-roomlist-manager.c', + 'idle-server-connection.c', + 'idle-text.c', + 'server-tls-channel.c', + 'server-tls-manager.c', + 'tls-certificate.c', + gen_enums_h, # required by libidle_extensions + ], + dependencies: idle_deps, + include_directories: configuration_inc, + link_with: libidle_extensions, +) + +executable( + 'telepathy-idle', + sources: [ + 'idle.c' + ], + dependencies: idle_deps, + include_directories: configuration_inc, + install: true, + install_dir: libexecdir, + link_with: libidle_convenience, +) + +pathconf = configuration_data() +pathconf.set('libexecdir', libexecdir) + +telepathy_idle_8 = configure_file( + configuration: pathconf, + input: 'telepathy-idle.8.in', + output: '@BASENAME@', +) + +install_man(telepathy_idle_8) diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 0000000..626168c --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,37 @@ + +test_ctcp_tokenize = executable( + 'test-ctcp-tokenize', + sources: [ + 'test-ctcp-tokenize.c', + ], + dependencies: idle_deps, + include_directories: [configuration_inc, src_inc], + link_with: libidle_convenience, +) +test('test_ctcp_tokenize', test_ctcp_tokenize) + +test_ctcp_kill_blingbling = executable( + 'test-ctcp-kill-blingbling', + sources: [ + 'test-ctcp-kill-blingbling.c', + ], + dependencies: idle_deps, + include_directories: [configuration_inc, src_inc], + link_with: libidle_convenience, +) +test('test_ctcp_kill_blingbling', test_ctcp_kill_blingbling) + +test_text_encode_and_split = executable( + 'test-text-encode-and-split', + sources: [ + 'test-text-encode-and-split.c', + ], + dependencies: idle_deps, + include_directories: [configuration_inc, src_inc], + link_with: libidle_convenience, +) +test('test_text_encode_and_split', test_text_encode_and_split) + +if get_option('twisted_tests') + subdir('twisted') +endif diff --git a/tests/twisted/config.py.in b/tests/twisted/config.py.in new file mode 100644 index 0000000..d0228f1 --- /dev/null +++ b/tests/twisted/config.py.in @@ -0,0 +1 @@ +PACKAGE_STRING = "@PACKAGE_STRING@" diff --git a/tests/twisted/meson.build b/tests/twisted/meson.build new file mode 100644 index 0000000..7e39d4b --- /dev/null +++ b/tests/twisted/meson.build @@ -0,0 +1,93 @@ +twisted_tests = [ + 'cm/protocol.py', + 'connect/connect-close-ssl.py', + 'connect/connect-success.py', + 'connect/connect-success-ssl.py', + 'connect/connect-reject-ssl.py', + 'connect/connect-fail.py', + 'connect/connect-fail-ssl.py', + 'connect/disconnect-before-socket-connected.py', + 'connect/disconnect-during-cert-verification.py', + 'connect/ping.py', + 'connect/server-quit-ignore.py', + 'connect/server-quit-noclose.py', + 'connect/socket-closed-after-handshake.py', + 'connect/socket-closed-during-handshake.py', + 'connect/invalid-nick.py', + 'contacts.py', + 'channels/join-muc-channel.py', + 'channels/join-muc-channel-bouncer.py', + 'channels/requests-create.py', + 'channels/requests-muc.py', + 'channels/muc-channel-topic.py', + 'channels/muc-destroy.py', + 'channels/room-list-channel.py', + 'channels/room-list-multiple.py', + 'irc-command.py', + 'messages/accept-invalid-nicks.py', + 'messages/contactinfo-request.py', + 'messages/invalid-utf8.py', + 'messages/messages-iface.py', + 'messages/message-order.py', + 'messages/leading-space.py', + 'messages/long-message-split.py', + 'messages/room-contact-mixup.py', + 'messages/room-config.py', +] + +twisted_conf = configuration_data() +twisted_conf.set_quoted('PACKAGE_STRING', package_string) + +configure_file( + input: 'config.py.in', + output: '@BASENAME@', + configuration: twisted_conf, +) + +if get_option('twisted_sleep') == '0' + idle_test_sleep = '' +else + idle_test_sleep = '--sleep=@0@'.format(get_option('twisted_sleep')) +endif + +# idle-twisted-tests.list +test_list = custom_target('idle-twisted-tests.list', + output: 'idle-twisted-tests.list', + command: ['echo', '\n'.join(twisted_tests)], + capture: true, +) + +# We don't really use idletestsdir yet - we only support uninstalled testing +# so far - but I'm substituting it to keep the script more similar to Gabble's. +# ${pkglibexecdir}/tests is what GNOME's InstalledTests goal recommends. + +abs_top_srcdir = meson.source_root() +abs_top_builddir = meson.build_root() + +run_test_conf = configuration_data() +run_test_conf.set('idletestsdir', join_paths(pkglibexecdir, 'tests')) +run_test_conf.set('TEST_PYTHON', test_python) + +run_test = configure_file( + input: 'run-test.sh.in', + output: '@BASENAME@', + configuration: run_test_conf, +) + +test( + 'check', + run_test, + args: twisted_tests, + env: [ + 'IDLE_TEST_UNINSTALLED=1', + 'IDLE_ABS_TOP_SRCDIR=@0@'.format(abs_top_srcdir), + 'IDLE_ABS_TOP_BUILDDIR=@0@'.format(abs_top_builddir), + 'IDLE_TEST_SLEEP=@0@'.format(idle_test_sleep), + ], + depends: [ + test_list, + ], + suite: 'twisted', +) + +subdir('tools') diff --git a/tests/twisted/messages/invalid-utf8.py b/tests/twisted/messages/invalid-utf8.py index a48c2f4..725e3bd 100644 --- a/tests/twisted/messages/invalid-utf8.py +++ b/tests/twisted/messages/invalid-utf8.py @@ -33,7 +33,7 @@ def test_with_message(q, stream, parts): # Idle's default character set is UTF-8. We send it a message which is # basically UTF-8, except that one of its code points is invalid. - stream.sendMessage('PRIVMSG', stream.nick, ':%s' % invalid_utf8, + stream.sendMessage('PRIVMSG', bytes(stream.nick), ':%s' % invalid_utf8, prefix='remoteuser') # Idle should signal that *something* was received. If it hasn't validated diff --git a/tests/twisted/tools/idletest.cert b/tests/twisted/tools/idletest.cert index 655abc2..7ea6bcc 100644 --- a/tests/twisted/tools/idletest.cert +++ b/tests/twisted/tools/idletest.cert @@ -1,10 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIBTzCB+gIBATANBgkqhkiG9w0BAQQFADAzMRIwEAYDVQQKEwl0ZWxlcGF0aHkx -HTAbBgNVBAsTFHRlbGVwYXRoeSBkZXZlbG9wZXJzMB4XDTA5MDExNDE3NDc0N1oX -DTA5MDExNDE3NDg0N1owMzESMBAGA1UEChMJdGVsZXBhdGh5MR0wGwYDVQQLExR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0GCSqGSIb3DQEBCwUAA4IBAQBJCT/EPWqv/wUDn7jK4nRXXXwtIL7eYYTAvcJh +gxtrkkNB1LAp6mnb1WOw+Wbdpf2IgTqfAvpzCRL+kCM80Pqh365JlA5JflzhWxsJ +xtJQfNfiZhgXKN1rm5lT+U/WgGR6A1serbxUiRN2O6wB8nxtoc7sBJh18pcrwpam +vOGAolbePV8HPfyBRkCnSw1X6BdifEtxlRCfVWELSI6xQHX8OPTU+uGcvte5uAEi +7CRRJHlUoojyLOxlJ6IeXh7MjrDIi6tHDqVR9MlRRN3oXhvsN/TtsZUuuC7s280W +oapk/x7WNDSQsdsi0bmTLrJoZgHzaPRJPCwBFzbj/T1kCC0B -----END CERTIFICATE----- diff --git a/tests/twisted/tools/idletest.key b/tests/twisted/tools/idletest.key index 3a80dab..d579266 100644 --- a/tests/twisted/tools/idletest.key +++ b/tests/twisted/tools/idletest.key @@ -1,9 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIBOwIBAAJBAL3P+mLMQx4v5s7eCIlUYcas4csTsB8OisCvCYDS7wKC7Tr4n5Jb -40meSPwC3huKjFESB7rJ4Pr5wcIL2TNeuZcCAwEAAQJBAJLaJc3qWsMwLFJAVjpp -nnwnpUmIoeplRdRtl9yjVWeKrvD2gSh2Qz693dgJbDUGURJecJ+LSS4YMOS+8FLp -KgECIQDhgvqh9KahKphn2/vvcCx3DKBZ7wh9lYIaaAay6IuAhwIhANd5cF48u0ID -39kZCwfhpAKQDxvpqmbnRzB0hISjEpJxAiARfZIo24vM9jvJ2mMI6B9awGzzbLmw -29aya50RZT3kowIhALrT2NJc5iB/K4AZbq8Ovh5auj8Bg3Zl4hvpa11154yBAiAO -F+44Mb+YQi+r526cDv983vCuoU5EM0PbPvJxaWmwtQ== +MIIEpAIBAAKCAQEAvfB9mhPOYmpDKPDS1OgB+Wl2ZAxM2nOBe8f66K67itaTugYm +wE0dl97iCShg0svw/A4YRBwhQ3hjQlT+Zz2ZJ7jhWLQbS3+4n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XH3EZa3xQNkcWpYmbTn1gf658+KRnxlx7FTYlOPqeU30d2FsaLWi2KJ2 +7kjx1WZOC4zd/wGyD0+tXjp7AoGAcNM9gwb9hkqfS0s25mhWtY9u0OzOd+rsAt5X +CzfaRQwu0J3+8NWM01WrxRE9NDtOBudgtP/Z1crKtbnve6bJwkT0a6ZJkae0yO7x +G9+JLXIPPAC7ftfaq5J0Fyshx/OatL1z6+S1fvURm/nmvrRD8PVz3PeDJcfh1uku +1JjRWnUCgYAFnAsOddzyRMe52WbeoDbl/AFJZMBbLDb2fI9yGNzy2Y79V0Bvxi3k +iSp6vHXA2tiVysyeEgVWYOdPmblQ6GRivAW75sgyuma1A0GJqkmd1EPXwbFNod8K +Ax0XXK2/olLTWtSOs8Cxmopb+V1rpyuTwlhyHc9J4HGEEBeazlYg3A== -----END RSA PRIVATE KEY----- diff --git a/tests/twisted/tools/meson.build b/tests/twisted/tools/meson.build new file mode 100644 index 0000000..c3d28b6 --- /dev/null +++ b/tests/twisted/tools/meson.build @@ -0,0 +1,22 @@ +ewl_conf = configuration_data() +ewl_conf.set('abs_top_builddir', abs_top_builddir) +ewl_conf.set('abs_top_srcdir', abs_top_srcdir) + +configure_file( + input: 'exec-with-log.sh.in', + output: '@BASENAME@', + configuration: ewl_conf, +) + +configure_file( + input: 'tmp-session-bus.conf.in', + output: '@BASENAME@', + configuration: ewl_conf, +) + +# D-Bus service file for testing +configure_file( + input: 'idle.service.in', + output: 'org.freedesktop.Telepathy.ConnectionManager.idle.service', + configuration: ewl_conf, +) diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py index 8fea5df..995d874 100644 --- a/tools/glib-ginterface-gen.py +++ b/tools/glib-ginterface-gen.py @@ -22,6 +22,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +import functools import sys import os.path import xml.dom.minidom @@ -85,18 +86,12 @@ class Generator(object): self.allow_havoc = allow_havoc def h(self, s): - if isinstance(s, unicode): - s = s.encode('utf-8') self.__header.append(s) def b(self, s): - if isinstance(s, unicode): - s = s.encode('utf-8') self.__body.append(s) def d(self, s): - if isinstance(s, unicode): - s = s.encode('utf-8') self.__docs.append(s) def do_node(self, node): @@ -733,7 +728,7 @@ class Generator(object): def __call__(self): nodes = self.dom.getElementsByTagName('node') - nodes.sort(cmp_by_name) + nodes.sort(key=functools.cmp_to_key(cmp_by_name)) self.h('#include <glib-object.h>') self.h('#include <dbus/dbus-glib.h>') @@ -768,7 +763,7 @@ class Generator(object): file_set_contents(self.basename + '-gtk-doc.h', '\n'.join(self.__docs)) def cmdline_error(): - print """\ + print ("""\ usage: gen-ginterface [OPTIONS] xmlfile Prefix_ options: @@ -788,7 +783,7 @@ options: void symbol (DBusGMethodInvocation *context) and return some sort of "not implemented" error via dbus_g_method_return_error (context, ...) -""" +""") sys.exit(1) diff --git a/tools/libglibcodegen.py b/tools/libglibcodegen.py index 6a9d214..2c9f164 100644 --- a/tools/libglibcodegen.py +++ b/tools/libglibcodegen.py @@ -154,7 +154,7 @@ def type_to_gtype(s): return ("GHashTable *", "DBUS_TYPE_G_STRING_STRING_HASHTABLE", "BOXED", False) elif s[:2] == 'a{': #some arbitrary hash tables if s[2] not in ('y', 'b', 'n', 'q', 'i', 'u', 's', 'o', 'g'): - raise Exception, "can't index a hashtable off non-basic type " + s + raise Exception("can't index a hashtable off non-basic type " + s) first = type_to_gtype(s[2]) second = type_to_gtype(s[3:-1]) return ("GHashTable *", "(dbus_g_type_get_map (\"GHashTable\", " + first[1] + ", " + second[1] + "))", "BOXED", False) @@ -169,4 +169,4 @@ def type_to_gtype(s): return ("GValueArray *", gtype, "BOXED", True) # we just don't know .. - raise Exception, "don't know the GType for " + s + raise(Exception, "don't know the GType for " + s) diff --git a/tools/make-release-mail.py b/tools/make-release-mail.py index 5c42b47..3343838 100644 --- a/tools/make-release-mail.py +++ b/tools/make-release-mail.py @@ -6,6 +6,15 @@ # to <telepathy@lists.freedesktop.org>. I hope that you enjoy your stay. import sys +import re + +def looks_like_a_header(line, package, version=None): + if version is None: + pattern = "^%s .* \(.*\)$" % package + else: + pattern = "^%s %s \(.*\)$" % (package, version) + + return re.match(pattern, line) is not None def extract_description(package, version, news_path): release_name = [] @@ -15,19 +24,19 @@ def extract_description(package, version, news_path): lines = (line for line in f.readlines()) for line in lines: # Find the 'telepathy-foo 0.1.2' header - if line.startswith("%s %s" % (package, version)): + if looks_like_a_header(line, package, version): break # Skip the ====== line, and the first blank line - lines.next() - lines.next() + next(lines) + next(lines) got_release_name = False for line in lines: line = line.rstrip() # If we hit the next version header, we're done - if line.startswith(package): + if looks_like_a_header(line, package): break # Else, if we hit a blank line and we're still reading the release # name, we're done with the release name. @@ -50,7 +59,7 @@ GIT_URL = 'http://cgit.freedesktop.org/telepathy' def main(package, version, news_path): release_name, details = extract_description(package, version, news_path) - print """ + print(""" %(release_name)s tarball: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz @@ -64,14 +73,14 @@ git: %(git_url)s/%(package)s 'version': version, 'release_name': release_name, 'details': details, - } + }) if __name__ == '__main__': try: package, version, news_path = sys.argv[1:] main(package, version, news_path) - except ValueError, e: + except ValueError as e: sys.stderr.write( 'Usage: %s package-name package.version.number path/to/NEWS\n' % sys.argv[0]) |