Hi,

On 14.11.2008, at 11:21, Ted Pavlic wrote:

> Okay... So I think I need to give you a specification. How about this?

That looks great. I've written a small python script that converts  
this to plist format; both script and output are attached.

The plist assumes that the icons are in mvim's Resource bundle and  
named doc-bm-<current-name>, perhaps you (Ted) can rename them, zip  
them up, and send them here?

Nico



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

                <dict>
                        <key>CFBundleTypeName</key>
                        <string>AppleScript source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>applescript</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-applescript</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>ActionScript source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>as</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-as</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>ASP document</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>asp</string>
                                <string>asa</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-asp</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>ASP.NET document</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>aspx</string>
                                <string>ascx</string>
                                <string>asmx</string>
                                <string>ashx</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-asp</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>BibTeX bibliography</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>bib</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-bib</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>C source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>c</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-c</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>C++ source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>cc</string>
                                <string>cp</string>
                                <string>cpp</string>
                                <string>cxx</string>
                                <string>c++</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-pp</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>C# source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>cs</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-cs</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Context Free Design Grammar</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>cfdg</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-csfg</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Comma separated values</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>csv</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-csv</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Tab separated values</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>tsv</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-tsv</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>CGI script</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>cgi</string>
                                <string>fcgi</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-cgi</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Configuration file</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>cfg</string>
                                <string>conf</string>
                                <string>config</string>
                                <string>htaccess</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-cfg</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Cascading style sheet</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>css</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-css</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Differences file</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>diff</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-diff</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Document Type Definition</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>dtd</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-dtd</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Dylan source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>dylan</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-dylan</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Erlang source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>erl</string>
                                <string>hrl</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-erl</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>F-Script source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>fscript</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-fscript</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Fortran source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>f</string>
                                <string>for</string>
                                <string>fpp</string>
                                <string>f77</string>
                                <string>f90</string>
                                <string>f95</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-f</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Header</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>h</string>
                                <string>pch</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-h</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>C++ header</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>hh</string>
                                <string>hpp</string>
                                <string>hxx</string>
                                <string>h++</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-hh</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>GTD document</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>gtd</string>
                                <string>gtdlog</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-gtd</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Haskell source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>hs</string>
                                <string>lhs</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-hs</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>HTML document</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>htm</string>
                                <string>pht</string>
                                <string>sht</string>
                                <string>xht</string>
                                <string>phtm</string>
                                <string>shtm</string>
                                <string>xhtm</string>
                                <string>html</string>
                                <string>phtml</string>
                                <string>shtml</string>
                                <string>xhtml</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-html</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Include file</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>inc</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-inc</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>iCalendar schedule</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>ics</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-ics</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>MS Windows initialization file</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>ini</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-ini</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Io source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>io</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-io</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Java source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>java</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-java</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>BeanShell script</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>bsh</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-bsh</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Java properties file</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>properties</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-properties</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>JavaScript source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>js</string>
                                <string>htc</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-js</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Java Server Page</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>jsp</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-jsp</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>LISP source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>lisp</string>
                                <string>cl</string>
                                <string>l</string>
                                <string>lsp</string>
                                <string>mud</string>
                                <string>el</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-lisp</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Log file</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>log</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-log</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Mediawiki document</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>wiki</string>
                                <string>wikipedia</string>
                                <string>mediawiki</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-wiki</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Objective-C source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>m</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-m</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Objective-C++ source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>mm</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-mm</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Patch file</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>patch</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-patch</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Perl source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>pl</string>
                                <string>pod</string>
                                <string>perl</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-perl</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Perl module</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>pm</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-perl</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>PHP source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>php</string>
                                <string>php3</string>
                                <string>php4</string>
                                <string>php5</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-php</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>PostScript source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>ps</string>
                                <string>eps</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-ps</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Property list</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>dict</string>
                                <string>plist</string>
                                <string>scriptSuite</string>
                                <string>scriptTerminology</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-plist</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Python source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>py</string>
                                <string>rpy</string>
                                <string>cpy</string>
                                <string>python</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-py</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Ruby source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>rb</string>
                                <string>rbx</string>
                                <string>rjs</string>
                                <string>rxml</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-rb</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Scheme source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>scm</string>
                                <string>sch</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-sch</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Shell script</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>sh</string>
                                <string>ss</string>
                                <string>bashrc</string>
                                <string>bash_profile</string>
                                <string>bash_login</string>
                                <string>profile</string>
                                <string>bash_logout</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-bash</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>SQL source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>sql</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-sql</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Tcl source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>tcl</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-tcl</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>TeX document</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>tex</string>
                                <string>sty</string>
                                <string>cls</string>
                                <string>ltx</string>
                                <string>ins</string>
                                <string>dtx</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-tex</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>XML document</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>xml</string>
                                <string>rss</string>
                                <string>tld</string>
                                <string>pt</string>
                                <string>cpt</string>
                                <string>dtml</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-xml</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>XSL stylesheet</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>xsl</string>
                                <string>xslt</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-xsl</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Electronic business card</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>vcf</string>
                                <string>vcard</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-vcf</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>Visual Basic source</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>vb</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-vb</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>YAML document</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>yaml</string>
                                <string>yml</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-yaml</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
                <dict>
                        <key>CFBundleTypeName</key>
                        <string>VIM Script</string>
                        <key>CFBundleTypeExtensions</key>
                        <array>
                                <string>vim</string>
                        </array>
                        <key>CFBundleTypeIconFile</key>
                        <string>doc-bm-vim</string>
                        <key>CFBundleTypeRole</key>
                        <string>Editor</string>
                </dict>
import os
import re
from urlparse import urlparse

# Use tabs to be "compatible" with XCode
TYPE = """\t\t<dict>
\t\t\t<key>CFBundleTypeName</key>
\t\t\t<string>%s</string>
\t\t\t<key>CFBundleTypeExtensions</key>
\t\t\t<array>
%s
\t\t\t</array>
\t\t\t<key>CFBundleTypeIconFile</key>
\t\t\t<string>%s</string>
\t\t\t<key>CFBundleTypeRole</key>
\t\t\t<string>Editor</string>
\t\t</dict>"""

p = re.compile(r'''
-----
Type: (.*)
Extensions: (.*)
Icon file at: (.*)
-----
''')

for m in p.finditer(open('filetypes.txt').read()):
  name = m.group(1)
  exts = m.group(2).split(r', ')
  exts = '\n'.join(['\t\t\t\t<string>%s</string>' % ext for ext in exts])
  _, icon = os.path.split(urlparse(m.group(3)).path)
  icon, _ = os.path.splitext(icon)
  print TYPE % (name, exts, 'doc-bm-' + icon)
-----
Type: ADA source
Extensions: adb, ads
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/ada.icns
-----

-----
Type: AppleScript source
Extensions: applescript
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/applescript.icns
-----

-----
Type: ActionScript source
Extensions: as
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/as.icns
-----

-----
Type: ASP document
Extensions: asp, asa
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/asp.icns
-----

-----
Type: ASP.NET document
Extensions: aspx, ascx, asmx, ashx
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/asp.icns
-----

-----
Type: BibTeX bibliography
Extensions: bib
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/bib.icns
-----

-----
Type: C source
Extensions: c
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/c.icns
-----

-----
Type: C++ source
Extensions: cc, cp, cpp, cxx, c++
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/pp.icns
-----

-----
Type: C# source
Extensions: cs
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/cs.icns
-----

-----
Type: Context Free Design Grammar
Extensions: cfdg
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/csfg.icns
-----

-----
Type: Comma separated values
Extensions: csv
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/csv.icns
-----

-----
Type: Tab separated values
Extensions: tsv
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/tsv.icns
-----

-----
Type: CGI script
Extensions: cgi, fcgi
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/cgi.icns
-----

-----
Type: Configuration file
Extensions: cfg, conf, config, htaccess
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/cfg.icns
-----

-----
Type: Cascading style sheet
Extensions: css
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/css.icns
-----

-----
Type: Differences file
Extensions: diff
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/diff.icns
-----

-----
Type: Document Type Definition
Extensions: dtd
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/dtd.icns
-----

-----
Type: Dylan source
Extensions: dylan
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/dylan.icns
-----

-----
Type: Erlang source
Extensions: erl, hrl
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/erl.icns
-----

-----
Type: F-Script source
Extensions: fscript
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/fscript.icns
-----

-----
Type: Fortran source
Extensions: f, for, fpp, f77, f90, f95
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/f.icns
-----

-----
Type: Header
Extensions: h, pch
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/h.icns
-----

-----
Type: C++ header
Extensions: hh, hpp, hxx, h++
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/hh.icns
-----

-----
Type: GTD document
Extensions: gtd, gtdlog
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/gtd.icns
-----

-----
Type: Haskell source
Extensions: hs, lhs
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/hs.icns
-----

-----
Type: HTML document
Extensions: htm, pht, sht, xht, phtm, shtm, xhtm, html, phtml, shtml, xhtml
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/html.icns
-----

-----
Type: Include file
Extensions: inc
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/inc.icns
-----

-----
Type: iCalendar schedule
Extensions: ics
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/ics.icns
-----

-----
Type: MS Windows initialization file
Extensions: ini
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/ini.icns
-----

-----
Type: Io source
Extensions: io
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/io.icns
-----

-----
Type: Java source
Extensions: java
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/java.icns
-----

-----
Type: BeanShell script
Extensions: bsh
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/bsh.icns
-----

-----
Type: Java properties file
Extensions: properties
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/properties.icns
-----

-----
Type: JavaScript source
Extensions: js, htc
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/js.icns
-----

-----
Type: Java Server Page
Extensions: jsp
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/jsp.icns
-----

-----
Type: LISP source
Extensions: lisp, cl, l, lsp, mud, el
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/lisp.icns
-----

-----
Type: Log file
Extensions: log
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/log.icns
-----

-----
Type: Mediawiki document
Extensions: wiki, wikipedia, mediawiki
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/wiki.icns
-----

-----
Type: Objective-C source
Extensions: m
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/m.icns
-----

-----
Type: Objective-C++ source
Extensions: mm
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/mm.icns
-----

-----
Type: Patch file
Extensions: patch
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/patch.icns
-----

-----
Type: Perl source
Extensions: pl, pod, perl
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/perl.icns
-----

-----
Type: Perl module
Extensions: pm
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/perl.icns
-----

-----
Type: PHP source
Extensions: php, php3, php4, php5
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/php.icns
-----

-----
Type: PostScript source
Extensions: ps, eps
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/ps.icns
-----

-----
Type: Property list
Extensions: dict, plist, scriptSuite, scriptTerminology
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/plist.icns
-----

-----
Type: Python source
Extensions: py, rpy, cpy, python
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/py.icns
-----

-----
Type: Ruby source
Extensions: rb, rbx, rjs, rxml
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/rb.icns
-----

-----
Type: Scheme source
Extensions: scm, sch
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/sch.icns
-----

-----
Type: Shell script
Extensions: sh, ss, bashrc, bash_profile, bash_login, profile, bash_logout
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/bash.icns
-----

-----
Type: SQL source
Extensions: sql
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/sql.icns
-----

-----
Type: Tcl source
Extensions: tcl
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/tcl.icns
-----

-----
Type: TeX document
Extensions: tex, sty, cls, ltx, ins, dtx
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/tex.icns
-----

-----
Type: Plain text document
Extensions: text, txt, utf8
MIME Types: text/plain
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/txt.icns
-----

-----
Type: XML document
Extensions: xml, rss, tld, pt, cpt, dtml
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/xml.icns
-----

-----
Type: XSL stylesheet
Extensions: xsl, xslt
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/xsl.icns
-----

-----
Type: Electronic business card
Extensions: vcf, vcard
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/vcf.icns
-----

-----
Type: Visual Basic source
Extensions: vb
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/vb.icns
-----

-----
Type: YAML document
Extensions: yaml, yml
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/yaml.icns
-----

-----
Type: VIM Script
Extensions: vim
Icon file at: http://www.tedpavlic.com/examples/mvim/icns/vim.icns
-----

Reply via email to