pyobjc / Doc / ProjectBuilder-SyntaxHighlighting.html

The branch 'pyobjc-ancient' does not exist.
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Project Builder Python Support</title>
<meta name="Author" content="Bill Bumgarner" />
<meta name="Contact" content="&lt;bbum@codefab.com&gt;" />
<meta name="version" content="0.1 (unsupported)" />
<meta name="date" content="12/16/2002" />
<title>
Contents</title>
</head>
<body>
<h2>Project Builder Python Support</h2>
<table>
<tbody valign="top">
<tr><th >Author:</th>
<td>Bill Bumgarner</td></tr>
<tr><th >Contact:</th>
<td>&lt;<a href="mailto:bbum@codefab.com">bbum@codefab.com</a>&gt;</td></tr>
<tr><th >Version:</th>
<td>0.1 (unsupported)</td></tr>
<tr><th >Date:</th>
<td>12/16/2002</td></tr>
</tbody>
</table>
<table width="90%" border="1" align="center">
<tbody><tr><td><table width="100%"><tbody><tr>
<td bgcolor="#ffff33" width="15%">
Warning</td><td><p>None of this is documented or supported by <strong>Apple</strong>.  Don't ask <strong>Apple</strong> for
support and don't blame me if something breaks.  A lot could break as
<strong>Project Builder</strong> stores a tremendous amount of highly dynamic information in
both the user defaults and within project files.</p>
</td></tr></tbody></table></td></tr></tbody></table><h2>Contents</h2>
<ul>
<li><a href="#installation" id="id2" name="id2">Installation</a></li>
<li><a href="#documentation" id="id3" name="id3">Documentation</a></li>
<li><a href="#to-do" id="id4" name="id4">To Do</a></li>
<li><a href="#misc" id="id5" name="id5">Misc.</a></li>
</ul>
<p>Triple-quoted strings are not always treated correctly by Project Builder. This
seems to be a Project Builder bug.</p>
<h2><a href="#id2" name="installation">Installation</a></h2>
<p>Create the directory 'Specifications' within
<i>~/Developer/ProjectBuilder Extras/</i> or <i>/Developer/ProjectBuilder
Extras/</i>:</p>
<pre>
mkdir -p ~/Developer/ProjectBuilder\ Extras/Specifications/
</pre>
<p>Copy the specification files into that directory:</p>
<pre>
cp Python.pb*spec ~/Developer/ProjectBuilder\ Extras/Specifications/
</pre>
<p>The binary installer will install the specifications for you.</p>
<h2><a href="#id3" name="documentation">Documentation</a></h2>
<p>The version of Project Builder that ships with the December Developer Tools
modularizes the support for file types and syntax based colorizing of
source files.  The base mechanisms and definitions are found in:</p>
<p><a href="file:///System/Library/PrivateFrameworks/PBXCore.framework/Resources/">file:///System/Library/PrivateFrameworks/PBXCore.framework/Resources/</a></p>
<p>Not surprisingly, Apple has provided a mechanism for augmenting and
overriding the configuration information found within the PBXCore
framework.  By creating a 'Specifications' directory within any of the
<i>ProjectBuilder Extras</i> directories (<i>/Developer/ProjectBuilder Extras</i>
and <i>~/Developer/ProjectBuilder Extras</i> being the two most common).</p>
<p>All of the various specification files are simply property lists.  The file
names do not appear to be significant beyond the extension.  That is,
<i>Python.pblangspec</i> could have been called <i>Foo.pblangspec</i> and it would still
work as expected.</p>
<p>The contents of the two files were determined largely by looking through the
files found in the PBXCore framework.  The list of keywords for python was
generated by python itself:</p>
<pre>
In [1]: import keyword            
In [2]: keyword.kwlist
Out[2]: 
['and',
 'assert',
 'break',
 'class',
 'continue',
 'def',
 'del',
 'elif',
 'else',
 'except',
 'exec',
 'finally',
 'for',
 'from',
 'global',
 'if',
 'import',
 'in',
 'is',
 'lambda',
 'not',
 'or',
 'pass',
 'print',
 'raise',
 'return',
 'try',
 'while',
 'yield']
</pre>
<h2><a href="#id4" name="to-do">To Do</a></h2>
<ul>
<li>There are a number of other specification files found within the PBXCore.  Of
particular relevance to Python would be the Compiler Specifications.  It
would be extremely handy to be able to check syntax and compile Python code
from within PBX directly.   This appears to be a matter of both specifying
how the compiler should be invoked and providing a set of regular
expressions for parsing the output.</li>
<li>Instead of invoking Python directly, a compiler specification that used
<a href="http://pychecker.sourceforge.net/">PyChecker</a> would provide both syntactical checker and higher level script
integrity tests.</li>
<li>Expanding the language definition to include a list of alternative keywords
would provide for highlighting many common Python constructs and modules, as
well.</li>
<li>Looking at the internals to PBXCore, support for context-clicking (i.e. cmd-
and opt- double-clicking on keywords found in Python source) could be
supported if one were to build a custom Python Parser/Lexer as a PBX
plugin.</li>
<li>Support for Jython.  On the syntax front, this would be a matter of
duplicating a number of the keyword bits from the Java configuration.  On
the compiler front, support would focus on feeding through to the mechanism
that turns Python source into .class files.   All of this assumes that
Python and Jython source can (and should?) be differentiated.</li>
</ul>
<h2><a href="#id5" name="misc">Misc.</a></h2>
<p>This README is formatted as <a href="http://docutils.sourceforge.net/docs/rst/quickstart.html">reStructuredText</a> input.  From it, the HTML and other
formats can be automatically generated with the <a href="http://docutils.sourceforge.net/">docutils tools</a>.</p>
</body>
</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.