Skip to content

Commit

Permalink
change different ways to relase it
Browse files Browse the repository at this point in the history
  • Loading branch information
fulln committed Jun 19, 2020
1 parent 40a953e commit a7eddd4
Show file tree
Hide file tree
Showing 2 changed files with 174 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Alfred_ywz/index3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/python
# encoding: utf-8

import sys
import json

def read_file(json_filename):
with open(json_filename) as f:
pop_data = json.load(f)
return pop_data

def get_json(query):
# parentPath = os.path.dirname(__file__)
filename ="./"+query+".json"
return read_file(filename)

def switch(arg):
list = ['changyong', 'gaoxing', 'maimeng', 'zhenjing', 'shengqi', 'wunai', 'yun', 'daoqian', 'dongwu', 'haixiu', 'ku', 'memeda', 'shuila', 'zaijian', 'aojiao', 'chihuo', 'deyi', 'haipa', 'jiong', 'zan', 'nanguo', 'jian', 'qita']
if len(arg) > 2 :
for key in list:
if key.find(arg) != -1:
return key
return

def get_xml(query):
arg = switch(query)
if arg is None:
return
data = get_json(arg)
strs = """<item arg="{0}">
<title>{0}</title>
<subtitle>{1}</subtitle>
<icon>icon.png</icon>
</item>
"""
out = []
for key in data:
out.append(strs.format(data[key],key))
print(''.join(out))
135 changes: 135 additions & 0 deletions Alfred_ywz/info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>com.fulln.me.fmoji</string>
<key>connections</key>
<dict>
<key>1CE015A1-B893-4DD2-A3DC-80812E535EE4</key>
<array/>
<key>B54CA4B1-38F0-4CAA-9033-B03930705DF1</key>
<array>
<dict>
<key>destinationuid</key>
<string>1CE015A1-B893-4DD2-A3DC-80812E535EE4</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
</dict>
<key>createdby</key>
<string>fulln</string>
<key>description</key>
<string>颜文字处理</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>ywz</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>autopaste</key>
<true/>
<key>clipboardtext</key>
<string>{query}</string>
<key>transient</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.output.clipboard</string>
<key>uid</key>
<string>1CE015A1-B893-4DD2-A3DC-80812E535EE4</string>
<key>version</key>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>alfredfiltersresults</key>
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
<integer>0</integer>
<key>escaping</key>
<integer>102</integer>
<key>keyword</key>
<string>moji</string>
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
<true/>
<key>queuedelaymode</key>
<integer>0</integer>
<key>queuemode</key>
<integer>1</integer>
<key>runningsubtext</key>
<string>搜索中</string>
<key>script</key>
<string>ITEM=`python3 -c 'import index3; index3.get_xml("{query}")'`
cat&lt;&lt;EOB
&lt;?xml version="1.0"?&gt;
&lt;items&gt;
$ITEM
&lt;/items&gt;
EOB</string>
<key>scriptargtype</key>
<integer>0</integer>
<key>scriptfile</key>
<string></string>
<key>subtext</key>
<string></string>
<key>title</key>
<string>Search suitable text</string>
<key>type</key>
<integer>5</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>B54CA4B1-38F0-4CAA-9033-B03930705DF1</string>
<key>version</key>
<integer>3</integer>
</dict>
</array>
<key>readme</key>
<string></string>
<key>uidata</key>
<dict>
<key>1CE015A1-B893-4DD2-A3DC-80812E535EE4</key>
<dict>
<key>xpos</key>
<integer>365</integer>
<key>ypos</key>
<integer>275</integer>
</dict>
<key>B54CA4B1-38F0-4CAA-9033-B03930705DF1</key>
<dict>
<key>xpos</key>
<integer>155</integer>
<key>ypos</key>
<integer>275</integer>
</dict>
</dict>
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string>v1.0.0</string>
<key>webaddress</key>
<string>https://github.com/fulln/sampleScrips</string>
</dict>
</plist>

0 comments on commit a7eddd4

Please sign in to comment.