File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 11* .dist-info
2+ * .alfredworkflow
23
34# Byte-compiled / optimized / DLL files
45__pycache__ /
Original file line number Diff line number Diff line change 1+ #!/usr/bin/python
2+ # encoding: utf-8
3+
4+ from os import walk
5+ from os .path import join
6+ from zipfile import ZipFile
7+
8+ FILENAME_LIST = (
9+ 'info.plist' ,
10+
11+ 'entry_point.py' ,
12+ 'core.py' ,
13+
14+ )
15+
16+ PATH_LIST = (
17+ 'workflow' ,
18+ 'arrow' ,
19+ 'backports' ,
20+ 'dateutil' ,
21+ )
22+
23+
24+ def main ():
25+ with open ('version' ) as f :
26+ version = f .readline ().rstrip ('\n \r ' )
27+
28+ zip_filename = 'time-converter.{}.alfredworkflow' .format (version )
29+ z = ZipFile (zip_filename , mode = 'w' )
30+
31+ for filename in FILENAME_LIST :
32+ z .write (filename )
33+
34+ for pathname in PATH_LIST :
35+ for root , dirs , files in walk (pathname ):
36+ for filename in files :
37+ if filename .rfind ('.pyc' ) == - 1 :
38+ z .write (join (root , filename ))
39+
40+ z .close ()
41+
42+ print ('Create Alfred workflow({}) finished.' .format (zip_filename ))
43+
44+
45+ if __name__ == '__main__' :
46+ main ()
Original file line number Diff line number Diff line change 1+ 0.1.0
You can’t perform that action at this time.
0 commit comments