Ticket #2277: 0001-disable-default-server-for-log-submission-2277.patch

File 0001-disable-default-server-for-log-submission-2277.patch, 2.4 KB (added by quozl, 10 years ago)
  • logcollect.py

    From dd4f0c6b597284b4502b645ddf95f27a019027aa Mon Sep 17 00:00:00 2001
    From: James Cameron <quozl@laptop.org>
    Date: Wed, 30 Mar 2011 10:22:16 +1100
    Subject: [PATCH] disable default server for log submission, #2277
    
    Adds two gconf settings for deployments or builders who may wish to
    re-enable this feature.
    
    Signed-off-by: James Cameron <quozl@laptop.org>
    ---
     logcollect.py |    3 ++-
     logviewer.py  |   14 ++++++++++----
     2 files changed, 12 insertions(+), 5 deletions(-)
    
    diff --git a/logcollect.py b/logcollect.py
    index 8713048..2b30f42 100644
    a b Usage: 
    536536    if mode.startswith('http'):
    537537        print "Trying to send the logs using HTTP (web)"
    538538        if len(mode) == 4:
    539             url = 'http://olpc.scheffers.net/olpc/submit.tcl'
     539            print "No default log destination, aborting"
     540            sys.exit(1)
    540541        else:
    541542            url = mode
    542543           
  • logviewer.py

    diff --git a/logviewer.py b/logviewer.py
    index cdd77ed..920025f 100644
    a b import re 
    2424import gtk
    2525import pango
    2626import gobject
    27 import gio
     27import gio
     28import gconf
    2829
    2930from sugar.activity import activity
    3031from sugar import env
    class LogActivity(activity.Activity): 
    476477        self.collector_palette.popup(True)
    477478
    478479class CollectorPalette(Palette):
    479     _DEFAULT_SERVER = 'http://olpc.scheffers.net/olpc/submit.tcl'
    480 
    481480    def __init__(self, handler):
    482481        Palette.__init__(self, _('Log Collector: Send XO information'))
    483482
    class CollectorPalette(Palette): 
    492491       
    493492        send_button = gtk.Button(_('Send information'))
    494493        send_button.connect('clicked', self._on_send_button_clicked_cb)
     494        client = gconf.client_get_default()
     495        if client.get_bool('/desktop/sugar/privacy/log_send_enable'):
     496            send_button.set_sensitive(False)
     497            self._default_server = None
     498        else:
     499            self._default_server = \
     500                client.get_string('/desktop/sugar/privacy/log_send_server')
    495501
    496502        vbox = gtk.VBox(False, 5)
    497503        vbox.pack_start(label)
    class CollectorPalette(Palette): 
    505511        try:
    506512            data = self._collector.write_logs()
    507513            sender = LogSend()
    508             success = sender.http_post_logs(self._DEFAULT_SERVER, data)
     514            success = sender.http_post_logs(self._default_server, data)
    509515        except:
    510516            success = False
    511517