[Pythonmac-SIG] Spotlight and Python

Jonathan Wight jwight_lists at toxicsoftware.com
Wed May 11 17:23:53 CEST 2005


On May 11, 2005, at 11:16, Schollnick, Benjamin wrote:

>>> had time to index my drive by now. It does seem to have indexed
>>> files that are part of python packages but it hasn't index Python
>>> files in my home directory and subdirectories. Is it
>>>
>> skipping these
>>
>>> on purpose or does it somehow not realize they are Python files
>>> (most of them were created with emacs and many on Linux systems
>>> before I switched to a Mac)? They all do have a .py extension.
>>>
>
> So, to summarize...
>
> 1) It has indexed files that are part of Python packages
> 2) It has not indexed files in his home directory
>     a) Most were created with Emacs / Linux systems
>
> So the UTI for python files may not be attached to those files
> MetaData....
>
> Could that be preventing the indexer from operating?

I'd be surprised. The python UTI declaration is in the system (not in  
Xcode as I originally believed) and it looks like this:

         <dict>
             <key>UTTypeConformsTo</key>
             <array>
                 <string>public.shell-script</string>
             </array>
             <key>UTTypeDescription</key>
             <string>Python script</string>
             <key>UTTypeIdentifier</key>
             <string>public.python-script</string>
             <key>UTTypeTagSpecification</key>
             <dict>
                 <key>public.filename-extension</key>
                 <array>
                     <string>py</string>
                 </array>
                 <key>public.mime-type</key>
                 <array>
                     <string>text/x-python-script</string>
                 </array>
             </dict>
         </dict>

So basically anything with a .py extension should be indexed.

Use mdls and mdfind to find out files are not being indexed.

     Jon.


More information about the Pythonmac-SIG mailing list