<commit_before>import gtk
import dbus

import conf
from sugar.activity import Activity
from sugar.presence import PresenceService
from sugar.canvas.IconColor import IconColor
from sugar.p2p import Stream
from sugar.p2p import network
from sugar.chat import ActivityChat

class ActivityChatWindow(gtk.Window):
	def __init__(self, gdk_window, chat_widget):
		gtk.Window.__init__(self)

		self.realize()
		self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
		self.window.set_accept_focus(True)		
		self.window.set_transient_for(gdk_window)
		self.set_position(gtk.WIN_POS_CENTER_ALWAYS)

		self.add(chat_widget)

class ActivityHost:
	def __init__(self, shell, window):
		self._shell = shell

		self._window = window
		self._xid = window.get_xid()
		self._pservice = PresenceService.get_instance()

		bus = dbus.SessionBus()
		proxy_obj = bus.get_object(Activity.get_service_name(self._xid),
								   Activity.get_object_path(self._xid))

		self._activity = dbus.Interface(proxy_obj, Activity.ACTIVITY_INTERFACE)
		self._id = self._activity.get_id()
		self._type = self._activity.get_type()
		self._gdk_window = gtk.gdk.window_foreign_new(self._xid)

		registry = conf.get_activity_registry()
		info = registry.get_activity(self._type)
		self._icon_name = info.get_icon()

		self._chat_widget = ActivityChat.ActivityChat(self)
		self._chat_window = ActivityChatWindow(self._gdk_window, self._chat_widget)

		self._frame_was_visible = False
		self._shell.connect('activity-changed', self._activity_changed_cb)
		self._shell.connect('activity-closed', self._activity_closed_cb)<commit_msg>Set default chat window size<commit_after>import gtk
import dbus

import conf
from sugar.activity import Activity
from sugar.presence import PresenceService
from sugar.canvas.IconColor import IconColor
from sugar.p2p import Stream
from sugar.p2p import network
from sugar.chat import ActivityChat

class ActivityChatWindow(gtk.Window):
	def __init__(self, gdk_window, chat_widget):
		gtk.Window.__init__(self)

		self.realize()
		self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
		self.window.set_accept_focus(True)		
		self.window.set_transient_for(gdk_window)
		self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
		self.set_default_size(600, 450)

		self.add(chat_widget)

class ActivityHost:
	def __init__(self, shell, window):
		self._shell = shell

		self._window = window
		self._xid = window.get_xid()
		self._pservice = PresenceService.get_instance()

		bus = dbus.SessionBus()
		proxy_obj = bus.get_object(Activity.get_service_name(self._xid),
								   Activity.get_object_path(self._xid))

		self._activity = dbus.Interface(proxy_obj, Activity.ACTIVITY_INTERFACE)
		self._id = self._activity.get_id()
		self._type = self._activity.get_type()
		self._gdk_window = gtk.gdk.window_foreign_new(self._xid)

		registry = conf.get_activity_registry()
		info = registry.get_activity(self._type)
		self._icon_name = info.get_icon()

		self._chat_widget = ActivityChat.ActivityChat(self)
		self._chat_window = ActivityChatWindow(self._gdk_window, self._chat_widget)

		self._frame_was_visible = False
		self._shell.connect('activity-changed', self._activity_changed_cb)
		self._shell.connect('activity-closed', self._activity_closed_cb)
{'fraction_non_alphanumeric': 0.09768160741885626, 'fraction_numerical': 0.0030911901081916537, 'mean_word_length': 5.472, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2236648', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1079, 'n_words': 181}