def _generate_report(self, changelog, local_commit_id, remote_commit_id): ''' :return: A string with a report of the latest update from local commit to remote commit which changes stuff in changelog. ''' lshort = to_short_id(local_commit_id) rshort = to_short_id(remote_commit_id) ldate = get_commit_id_date(local_commit_id) rdate = get_commit_id_date(remote_commit_id) report = 'The following changes were applied to the local w3af'\ ' installation during the last update from %s (%s) to'\ ' %s (%s):\n\n%s' return report % (lshort, ldate, rshort, rdate, changelog)
def _user_confirmed_update(self, short_local_head_id, local_head_id, short_remote_head_id, remote_head_id): ''' Ask the user if he wants to update or not. :return: True if the user wants to update. ''' # Call callback function if self.callback_onupdate_confirm is not None: callback = self.callback_onupdate_confirm # pylint: disable=E1102 # pylint: disable=E1103 msg = 'Your current w3af installation is %s (%s). Do you want '\ 'to update to %s (%s)?' proceed_upd = callback(msg % (short_local_head_id, get_commit_id_date(local_head_id), short_remote_head_id, get_commit_id_date(remote_head_id))) return proceed_upd
def _user_confirmed_update(self, short_local_head_id, local_head_id, short_remote_head_id, remote_head_id): ''' Ask the user if he wants to update or not. :return: True if the user wants to update. ''' # Call callback function if self.callback_onupdate_confirm is not None: callback = self.callback_onupdate_confirm # pylint: disable=E1102 # pylint: disable=E1103 msg = 'Your current w3af installation is %s (%s). Do you want '\ 'to update to %s (%s)?' proceed_upd = callback( msg % (short_local_head_id, get_commit_id_date(local_head_id), short_remote_head_id, get_commit_id_date(remote_head_id))) return proceed_upd