def get_hash(self): """ This hash will be different whenever the keyboard configuration changes. """ import hashlib m = hashlib.sha1() m.update(KeyboardConfigBase.get_hash(self)) for x in (self.xkbmap_print, self.xkbmap_query, \ self.xkbmap_mod_meanings, self.xkbmap_mod_pointermissing, \ self.xkbmap_keycodes, self.xkbmap_x11_keycodes): m.update("/%s" % str(x)) return "%s/%s/%s" % (self.xkbmap_layout, self.xkbmap_variant, m.hexdigest())
def get_hash(self): """ This hash will be different whenever the keyboard configuration changes. """ import hashlib m = hashlib.sha1() m.update(KeyboardConfigBase.get_hash(self)) for x in (self.xkbmap_print, self.xkbmap_query, \ self.xkbmap_mod_meanings, self.xkbmap_mod_pointermissing, \ self.xkbmap_keycodes, self.xkbmap_x11_keycodes): m.update("/%s" % str(x)) return "%s/%s/%s" % (self.xkbmap_layout, self.xkbmap_variant, m.hexdigest())
def get_hash(self): """ This hash will be different whenever the keyboard configuration changes. """ import hashlib m = hashlib.sha1() def hashadd(v): m.update(("/%s" % str(v)).encode("utf8")) m.update(KeyboardConfigBase.get_hash(self)) for x in (self.xkbmap_print, self.xkbmap_query, self.xkbmap_raw, \ self.xkbmap_mod_meanings, self.xkbmap_mod_pointermissing, \ self.xkbmap_keycodes, self.xkbmap_x11_keycodes): hashadd(x) if self.xkbmap_query_struct: #flatten the dict in a predicatable order: for k in sorted(self.xkbmap_query_struct.keys()): hashadd(self.xkbmap_query_struct.get(k)) return "%s/%s/%s" % (self.xkbmap_layout, self.xkbmap_variant, m.hexdigest())
def get_hash(self): """ This hash will be different whenever the keyboard configuration changes. """ import hashlib m = hashlib.sha1() def hashadd(v): m.update(("/%s" % str(v)).encode("utf8")) m.update(KeyboardConfigBase.get_hash(self)) for x in (self.xkbmap_print, self.xkbmap_query, self.xkbmap_raw, \ self.xkbmap_mod_meanings, self.xkbmap_mod_pointermissing, \ self.xkbmap_keycodes, self.xkbmap_x11_keycodes): hashadd(x) if self.xkbmap_query_struct: #flatten the dict in a predicatable order: for k in sorted(self.xkbmap_query_struct.keys()): hashadd(self.xkbmap_query_struct.get(k)) return "%s/%s/%s/%s" % (self.xkbmap_layout, self.xkbmap_variant, self.xkbmap_options, m.hexdigest())