Skip to content

Commit

Permalink
Support for diacritics
Browse files Browse the repository at this point in the history
Support for diacritics by changing interpreter from Python 2 to Python 3.
  • Loading branch information
bpetrynski authored Apr 8, 2021
1 parent 64eb341 commit f867cf2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
Binary file modified Change Case.alfredworkflow
Binary file not shown.
29 changes: 15 additions & 14 deletions changecase.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from xml.sax.saxutils import escape
from titlecase import titlecase


if len(sys.argv) > 1 and len(sys.argv[1].strip()):
text = sys.argv[1]
else:
Expand Down Expand Up @@ -36,37 +37,37 @@ def upcase(m):

}

print """<?xml version="1.0"?>
print("""<?xml version="1.0"?>
<items>
<item arg="%(lower)s">
<title>%(lower)s</title>
<subtitle>lowercase</subtitle>
<title>"%(lower)s"</title>
<subtitle>Transform text to `lowercase`</subtitle>
<icon>lowercase.png</icon>
</item>
<item arg="%(upper)s">
<title>%(upper)s</title>
<subtitle>UPPERCASE</subtitle>
<title>"%(upper)s"</title>
<subtitle>Transform text to `UPPERCASE`</subtitle>
<icon>uppercase.png</icon>
</item>
<item arg="%(title)s">
<title>%(title)s</title>
<subtitle>Title Case</subtitle>
<title>"%(title)s"</title>
<subtitle>Transform text to `Title Case`</subtitle>
<icon>titlecase.png</icon>
</item>
<item arg="%(camel)s">
<title>%(camel)s</title>
<subtitle>CamelCase</subtitle>
<title>"%(camel)s"</title>
<subtitle>Transform text to `CamelCase`</subtitle>
<icon>camelcase.png</icon>
</item>
<item arg="%(kebab)s">
<title>%(kebab)s</title>
<subtitle>kebab-case</subtitle>
<title>"%(kebab)s"</title>
<subtitle>Transform text to hyphenated `kebab-case`</subtitle>
<icon>kebabcase.png</icon>
</item>
<item arg="%(snake)s">
<title>%(snake)s</title>
<subtitle>snake_case</subtitle>
<title>"%(snake)s"</title>
<subtitle>Transform text to `snake_case`</subtitle>
<icon>snakecase.png</icon>
</item>
</items>""" % variations
</items>""" % variations)

0 comments on commit f867cf2

Please sign in to comment.