Exemple #1
0
            v = xkb.tmplValues[k + m1]
            #  v = terminators.get( v, v )

            if opts.utf8:
                try:
                    name = utf8name(v)
                    term = "VoidSymbol"
                except:
                    #    if terminators.has_key(v):
                    if v in defaultDeads:
                        name = "dead_" + v
                        try:
                            term = utf8name(terminators[v])
                        except:
                            term = "VoidSymbol"
                    elif terminators.has_key(v):
                        # the key is not supported, but maybe its terminator is in the supported chars
                        try:
                            name = utf8name(terminators[v])
                            term = "VoidSymbol"
                        except:
                            name = "VoidSymbol"
                            term = "VoidSymbol"
                    else:
                        # print k, v
                        name = "VoidSymbol"
                        term = "VoidSymbol"
            else:
                try:
                    cl = codecs.encode(v, "iso-8859-15")
                    name = names[cl]
Exemple #2
0
        print >> deadXMLBuf, '    </action>'
        actions.add(c1)
        
      previous = dc[ c, tuple([]) ].lower()
              
        
    else:
      raise ' '.join(c), d[c]
#  else:
#    print >> deadXMLBuf, '*********************************************', c
    
    
# actions with multi keys and without dead keys
for C in sorted( set(compose.charActions.keys() + list(xkb.chars) ) - actions - set(["Multi_key"])):
  a = compose.composeChars.get(C, C)
  if not terminators.has_key(C):
    print >> deadXMLBuf
    print >> deadXMLBuf, u'    <action id="%s">' % xmlChar(C)
    print >> deadXMLBuf, u'      <when state="none" output="%s"/>' % xmlChar(C)
    if compose.statesByAction.has_key(a):
      for s in sorted(compose.statesByAction[a]):
        print >> deadXMLBuf, u'      <when state="%s" next="%s"/>' % ('_'.join(s), '_'.join(s+(a,)))
    if compose.outputsByAction.has_key(a):
      for s, c1 in sorted(compose.outputsByAction[a]):
        print >> deadXMLBuf, u'      <when state="%s" output="%s"/>' % ('_'.join(s), xmlChar(c1))        
    print >> deadXMLBuf, u'    </action>'


# the space char produces the terminator char when a dead_ states is activated
print >> deadXMLBuf
print >> deadXMLBuf, u'    <action id=" ">'
Exemple #3
0
        v = u"&#x0022;"
    elif v == u'<':
        v = u"&#x003c;"
    elif v == u'&':
        v = u'&#x0026;'
    return v


out = codecs.open(sys.argv[2] + ".svg", "w", "utf8")
print >> out, header
for k, v in xkb.tmplValues.iteritems():
    v2 = terminators.get(v, v)
    if "_capslock" in k or "_command" in k:
        continue
    x, y, color = offsetAndColor(k)
    if terminators.has_key(v):
        color = deadColor
    print >> out, charTmpl % (x, y, color, xmlChar(v2))
print >> out, footer
out.close()

out = codecs.open(sys.argv[2] + "-simplifiee.svg", "w", "utf8")
print >> out, header
for k, v in xkb.tmplValues.iteritems():
    v2 = terminators.get(v, v)
    if "_capslock" in k or "_command" in k:
        continue
    x, y, color = offsetAndColor(k)
    if color == shiftColor and xkb.tmplValues[k.split("_")[0]] == v.lower():
        color = mainColor
    elif color == altgrShiftColor and xkb.tmplValues[k.split("_")[0] +
Exemple #4
0
   if v == "":
     v = "nop"
   try:
    term = "nop"
    cl = codecs.encode(v, "iso-8859-15")
   except:
     cl = "nop"
   
 #    if terminators.has_key(v):
   if deadNames.has_key(v):
     cl = deadNames[v]
     try:
       term = names[codecs.encode(terminators[v], "iso-8859-15")]
     except:
       term = "nop"
   elif terminators.has_key(v):
     print "unsupported", "dead_"+v
     term = "nop"
     try:
       cl = names[codecs.encode(terminators[v], "iso-8859-15")]
     except:
       cl = "nop"
     
       
   if ctrl:
     if charToCtrl.has_key(cl):
       cl = charToCtrl[cl]
     elif charToCtrl.has_key(cl.lower()):
       cl = charToCtrl[cl.lower()]
     elif charToCtrl.has_key(term):
       cl = charToCtrl[term]
Exemple #5
0
                print >> deadXMLBuf, '    </action>'
                actions.add(c1)

            previous = dc[c, tuple([])].lower()

        else:
            raise ' '.join(c), d[c]
#  else:
#    print >> deadXMLBuf, '*********************************************', c

# actions with multi keys and without dead keys
for C in sorted(
        set(compose.charActions.keys() + list(xkb.chars)) - actions -
        set(["Multi_key"])):
    a = compose.composeChars.get(C, C)
    if not terminators.has_key(C):
        print >> deadXMLBuf
        print >> deadXMLBuf, u'    <action id="%s">' % xmlChar(C)
        print >> deadXMLBuf, u'      <when state="none" output="%s"/>' % xmlChar(
            C)
        if compose.statesByAction.has_key(a):
            for s in sorted(compose.statesByAction[a]):
                print >> deadXMLBuf, u'      <when state="%s" next="%s"/>' % (
                    '_'.join(s), '_'.join(s + (a, )))
        if compose.outputsByAction.has_key(a):
            for s, c1 in sorted(compose.outputsByAction[a]):
                print >> deadXMLBuf, u'      <when state="%s" output="%s"/>' % (
                    '_'.join(s), xmlChar(c1))
        print >> deadXMLBuf, u'    </action>'

# the space char produces the terminator char when a dead_ states is activated