86>Jul 14 02:10:10 userdel[3219811]: delete user 'rooter' <86>Jul 14 02:10:10 userdel[3219811]: removed group 'rooter' owned by 'rooter' <86>Jul 14 02:10:10 userdel[3219811]: removed shadow group 'rooter' owned by 'rooter' <86>Jul 14 02:10:10 groupadd[3219829]: group added to /etc/group: name=rooter, GID=549 <86>Jul 14 02:10:10 groupadd[3219829]: group added to /etc/gshadow: name=rooter <86>Jul 14 02:10:10 groupadd[3219829]: new group: name=rooter, GID=549 <86>Jul 14 02:10:10 useradd[3219840]: new user: name=rooter, UID=549, GID=549, home=/root, shell=/bin/bash <86>Jul 14 02:10:10 userdel[3219866]: delete user 'builder' <86>Jul 14 02:10:10 userdel[3219866]: removed group 'builder' owned by 'builder' <86>Jul 14 02:10:10 userdel[3219866]: removed shadow group 'builder' owned by 'builder' <86>Jul 14 02:10:10 groupadd[3219885]: group added to /etc/group: name=builder, GID=550 <86>Jul 14 02:10:10 groupadd[3219885]: group added to /etc/gshadow: name=builder <86>Jul 14 02:10:10 groupadd[3219885]: new group: name=builder, GID=550 <86>Jul 14 02:10:10 useradd[3219901]: new user: name=builder, UID=550, GID=550, home=/usr/src, shell=/bin/bash <13>Jul 14 02:10:13 rpmi: libgdbm-1.8.3-alt10 1454943313 installed <13>Jul 14 02:10:13 rpmi: libexpat-2.2.9-alt1 sisyphus+252464.200.2.1 1590958863 installed <13>Jul 14 02:10:13 rpmi: libp11-kit-0.23.15-alt2 sisyphus+252784.100.2.2 1591274915 installed <13>Jul 14 02:10:13 rpmi: libtasn1-4.16.0-alt1 sisyphus+245480.100.1.1 1580825069 installed <13>Jul 14 02:10:13 rpmi: rpm-macros-alternatives-0.5.1-alt1 sisyphus+226946.100.1.1 1554830426 installed <13>Jul 14 02:10:13 rpmi: alternatives-0.5.1-alt1 sisyphus+226946.100.1.1 1554830426 installed <13>Jul 14 02:10:13 rpmi: ca-certificates-2020.06.29-alt1 sisyphus+254237.300.1.1 1593450881 installed <13>Jul 14 02:10:13 rpmi: ca-trust-0.1.2-alt1 sisyphus+233348.100.1.1 1561653823 installed <13>Jul 14 02:10:13 rpmi: p11-kit-trust-0.23.15-alt2 sisyphus+252784.100.2.2 1591274915 installed <13>Jul 14 02:10:13 rpmi: libcrypto1.1-1.1.1g-alt1 sisyphus+249982.60.8.1 1587743567 installed <13>Jul 14 02:10:13 rpmi: libssl1.1-1.1.1g-alt1 sisyphus+249982.60.8.1 1587743567 installed <13>Jul 14 02:10:13 rpmi: python3-3.8.3-alt1 sisyphus+251775.300.4.1 1592726188 installed <13>Jul 14 02:10:14 rpmi: python3-base-3.8.3-alt1 sisyphus+251775.300.4.1 1592726188 installed <13>Jul 14 02:10:14 rpmi: libpython3-3.8.3-alt1 sisyphus+251775.300.4.1 1592726188 installed <13>Jul 14 02:10:14 rpmi: tests-for-installed-python3-pkgs-0.1.13.1-alt2 1535450458 installed <13>Jul 14 02:10:14 rpmi: rpm-build-python3-0.1.13.1-alt2 1535450458 installed <13>Jul 14 02:10:16 rpmi: libverto-0.3.0-alt1_7 sisyphus+225932.100.1.1 1553994917 installed <13>Jul 14 02:10:16 rpmi: liblmdb-0.9.23-alt1 sisyphus+225277.100.2.1 1553001689 installed <13>Jul 14 02:10:16 rpmi: libkeyutils-1.6-alt2 sisyphus+226520.100.2.1 1554512088 installed <13>Jul 14 02:10:16 rpmi: libffi6-1:3.2.1-alt4 sisyphus+251953.300.2.1 1589891021 installed <13>Jul 14 02:10:16 rpmi: libcom_err-1.44.6-alt1 sisyphus+224154.100.1.1 1552091653 installed <86>Jul 14 02:10:16 groupadd[3230907]: group added to /etc/group: name=_keytab, GID=499 <86>Jul 14 02:10:16 groupadd[3230907]: group added to /etc/gshadow: name=_keytab <86>Jul 14 02:10:16 groupadd[3230907]: new group: name=_keytab, GID=499 <13>Jul 14 02:10:16 rpmi: libkrb5-1.18.2-alt2 sisyphus+254565.100.4.1 1594375563 installed <13>Jul 14 02:10:16 rpmi: libtirpc-1.2.6-alt1 sisyphus+250076.100.1.1 1587038260 installed <13>Jul 14 02:10:16 rpmi: libnsl2-1.1.0-alt1_1 1511548748 installed <13>Jul 14 02:10:16 rpmi: python-modules-encodings-2.7.18-alt1 sisyphus+250345.100.4.1 1588665039 installed <13>Jul 14 02:10:16 rpmi: python-modules-compiler-2.7.18-alt1 sisyphus+250345.100.4.1 1588665039 installed <13>Jul 14 02:10:16 rpmi: python-modules-email-2.7.18-alt1 sisyphus+250345.100.4.1 1588665039 installed <13>Jul 14 02:10:16 rpmi: python-modules-unittest-2.7.18-alt1 sisyphus+250345.100.4.1 1588665039 installed <13>Jul 14 02:10:17 rpmi: python-modules-2.7.18-alt1 sisyphus+250345.100.4.1 1588665039 installed <13>Jul 14 02:10:17 rpmi: python-modules-nis-2.7.18-alt1 sisyphus+250345.100.4.1 1588665039 installed <13>Jul 14 02:10:17 rpmi: python-modules-ctypes-2.7.18-alt1 sisyphus+250345.100.4.1 1588665039 installed <13>Jul 14 02:10:17 rpmi: python-modules-multiprocessing-2.7.18-alt1 sisyphus+250345.100.4.1 1588665039 installed <13>Jul 14 02:10:17 rpmi: python-modules-logging-2.7.18-alt1 sisyphus+250345.100.4.1 1588665039 installed <13>Jul 14 02:10:17 rpmi: python-tools-2to3-2.7.18-alt1 sisyphus+250345.100.4.1 1588665039 installed <13>Jul 14 02:10:17 rpmi: python3-module-xmpp-0.5.0-alt4 sisyphus+245271.100.1.1 1580376902 installed Building target platforms: x86_64 Building for target x86_64 Wrote: /usr/src/in/nosrpm/python3-module-jabberbot-0.16-alt2.nosrc.rpm <13>Jul 14 02:10:19 rpmi: python3-module-pkg_resources-1:46.1.3-alt1 sisyphus+250566.200.3.1 1587973342 installed <13>Jul 14 02:10:19 rpmi: libtinfo-devel-6.1.20180407-alt2 sisyphus+222164.200.1.1 1550686221 installed <13>Jul 14 02:10:19 rpmi: libncurses-devel-6.1.20180407-alt2 sisyphus+222164.200.1.1 1550686221 installed <13>Jul 14 02:10:19 rpmi: python3-dev-3.8.3-alt1 sisyphus+251775.300.4.1 1592726188 installed <13>Jul 14 02:10:19 rpmi: python3-module-setuptools-1:46.1.3-alt1 sisyphus+250566.200.3.1 1587973342 installed Installing python3-module-jabberbot-0.16-alt2.src.rpm Building target platforms: x86_64 Building for target x86_64 Executing(%prep): /bin/sh -e /usr/src/tmp/rpm-tmp.59916 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + rm -rf jabberbot-0.16 + echo 'Source #0 (jabberbot-0.16.tar.gz):' Source #0 (jabberbot-0.16.tar.gz): + /bin/gzip -dc /usr/src/RPM/SOURCES/jabberbot-0.16.tar.gz + /bin/tar -xf - + cd jabberbot-0.16 + /bin/chmod -c -Rf u+rwX,go-w . + find -type f -name '*.py' -exec 2to3 -w -n '{}' + RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: No changes to ./setup.py RefactoringTool: Refactored ./jabberbot.py --- ./jabberbot.py (original) +++ ./jabberbot.py (refactored) @@ -31,15 +31,15 @@ import os import re import sys -import thread +import _thread try: import xmpp except ImportError: - print >> sys.stderr, """ + print(""" You need to install xmpppy from http://xmpppy.sf.net/. On Debian-based systems, install the python-xmpp package. - """ + """, file=sys.stderr) sys.exit(-1) import time @@ -462,7 +462,7 @@ "
" + \ text.encode('utf-8') + "")) message.addChild(node=html) - except Exception, e: + except Exception as e: # Didn't work, incorrect markup or something. self.log.debug('An error while building a xhtml message. '\ 'Fallback to normal messagebody') @@ -509,7 +509,7 @@ If the parameter 'only_available' is True, the broadcast will not go to users whose status is not 'Available'.""" - for jid, (show, status) in self.__seen.items(): + for jid, (show, status) in list(self.__seen.items()): if not only_available or show is self.AVAILABLE: self.send(jid, message) @@ -546,11 +546,11 @@ self.status_type_changed(jid, self.OFFLINE) try: - subscription = self.roster.getSubscription(unicode(jid.__str__())) - except KeyError, e: + subscription = self.roster.getSubscription(str(jid.__str__())) + except KeyError as e: # User not on our roster subscription = None - except AttributeError, e: + except AttributeError as e: # Recieved presence update before roster built return @@ -635,7 +635,7 @@ if jid not in self.__seen: self.log.info('Ignoring message from unseen guest: %s' % jid) self.log.debug("I've seen: %s" % - ["%s" % x for x in self.__seen.keys()]) + ["%s" % x for x in list(self.__seen.keys())]) return # Remember the last-talked-in message thread for replies @@ -653,7 +653,7 @@ def execute_and_send(): try: reply = self.commands[cmd](mess, args) - except Exception, e: + except Exception as e: self.log.exception('An error happened while processing '\ 'a message ("%s") from %s: %s"' % (text, jid, traceback.format_exc(e))) @@ -663,7 +663,7 @@ # Experimental! # if command should be executed in a seperate thread do it if self.commands[cmd]._jabberbot_command_thread: - thread.start_new_thread(execute_and_send, ()) + _thread.start_new_thread(execute_and_send, ()) else: execute_and_send() else: @@ -726,13 +726,12 @@ usage = '\n'.join(sorted([ '%s: %s' % (name, (command.__doc__ or \ '(undocumented)').strip().split('\n', 1)[0]) - for (name, command) in self.commands.iteritems() \ + for (name, command) in self.commands.items() \ if name != (self.__command_prefix + 'help') \ and not command._jabberbot_command_hidden ])) - usage = '\n\n' + '\n\n'.join(filter(None, - [usage, self.MSG_HELP_TAIL % {'helpcommand': - self.__command_prefix + 'help'}])) + usage = '\n\n' + '\n\n'.join([_f for _f in [usage, self.MSG_HELP_TAIL % {'helpcommand': + self.__command_prefix + 'help'}] if _f]) else: description = '' if (args not in self.commands and @@ -747,7 +746,7 @@ top = self.top_of_help_message() bottom = self.bottom_of_help_message() - return ''.join(filter(None, [top, description, usage, bottom])) + return ''.join([_f for _f in RefactoringTool: Refactored ./examples/uptime.py RefactoringTool: No changes to ./examples/twitterbot.py RefactoringTool: Refactored ./examples/tunes.py RefactoringTool: No changes to ./examples/muc.py RefactoringTool: No changes to ./examples/broadcast.py RefactoringTool: Files that were modified: RefactoringTool: ./setup.py RefactoringTool: ./jabberbot.py RefactoringTool: ./examples/uptime.py RefactoringTool: ./examples/twitterbot.py RefactoringTool: ./examples/tunes.py RefactoringTool: ./examples/muc.py RefactoringTool: ./examples/broadcast.py [top, description, usage, bottom] if _f]) def idle_proc(self): """This function will be called in the main loop.""" @@ -769,7 +768,7 @@ #logging.debug('Got response: ' + str(res)) if res is None: self.on_ping_timeout() - except IOError, e: + except IOError as e: logging.error('Error pinging the server: %s, '\ 'treating as ping timeout.' % e) self.on_ping_timeout() --- ./examples/uptime.py (original) +++ ./examples/uptime.py (refactored) @@ -31,9 +31,9 @@ if __name__ == '__main__': if len(sys.argv) != 3: - print >>sys.stderr, """ + print(""" Usage: %s