HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/inkscape/extensions/text_randomcase.py
#!/usr/bin/env python
import chardataeffect, inkex, string

import random

class C(chardataeffect.CharDataEffect):

  def process_chardata(self,text, line, par):
    r = ""
    a = 1
    for i in range(len(text)):
      c = text[i]
      # bias the randomness towards inversion of the previous case:
      if a > 0:
        a = random.choice([-2,-1,1])
      else:
        a = random.choice([-1,1,2])
      if a > 0 and c.isalpha():
        r = r + c.upper()
      elif a < 0 and c.isalpha():
        r = r + c.lower()
      else:
        r = r + c

    return r

c = C()
c.affect()