def apply_hack_to_avoid_problems_with_caching(self): if hasattr(self.js_context.document.head, 'childNodes'): for element in self.js_context.document.head.childNodes.values(): if hasattr(element, 'src') and element.src: url = extend_querystring(element.src, {'query_id': random_hash()[:5]}) element.src = url elif hasattr(element, 'href') and element.href: url = extend_querystring(element.href, {'query_id': random_hash()[:5]}) element.href = url return False
def __init__(self, path, backref): self.__melange_ref__ = weakref.ref(backref) gobject.GObject.__init__(self) cream.base.Component.__init__(self, path=path) self.state = STATE_NONE self._position = (0, 0) self.display = gtk.gdk.display_get_default() self.instance_id = '%s' % random_hash(bits=100)[0:32] skin_dir = os.path.join(self.context.working_directory, 'skins') self.skins = cream.manifest.ManifestDB(skin_dir, type='org.cream.melange.Skin') self.config = WidgetConfiguration(self.context.working_directory, skins=self.skins.by_id, themes=self.__melange_ref__().themes.by_id) self.config.connect('field-value-changed', self.configuration_value_changed_cb) #self.window = WidgetWindow() self.load()
def __init__(self, path, backref): self.__melange_ref__ = weakref.ref(backref) exec_mode = self.__melange_ref__().context.execution_mode gobject.GObject.__init__(self) cream.base.Component.__init__(self, path=path, user_path_prefix='org.cream.Melange/data/widgets', exec_mode=exec_mode) self.state = STATE_NONE width = gtk.gdk.screen_width() height = gtk.gdk.screen_height() self._position = (int(width/2), int(height/2)) self.display = gtk.gdk.display_get_default() self.instance_id = '%s' % random_hash(bits=100)[0:32] # TODO: User self.context.get(_user)_path() skin_dir = os.path.join(self.context.working_directory, 'data', 'skins') self.skins = cream.manifest.ManifestDB(skin_dir, type='org.cream.melange.Skin') scheme_path = os.path.join(self.context.get_path(), 'configuration/scheme.xml') path = os.path.join(self.context.get_user_path(), 'configuration/') self.config = WidgetConfiguration(scheme_path, path, skins=self.skins, themes=self.__melange_ref__().themes) self.config.connect('field-value-changed', self.configuration_value_changed_cb) self.load()
def __init__(self, manager): cream.ipc.Object.__init__(self, 'org.cream.HotkeyManager', '/org/cream/HotkeyManager/broker_{0}'.format(random_hash(bits=20)) ) self.hotkeys = {} self.hotkeys_by_action = {} self.manager = weakref.ref(manager)