Changeset 63
- Timestamp:
- 12/18/06 01:29:18 (2 years ago)
- Files:
-
- trunk/dcompiler.py (modified) (4 diffs)
- trunk/html_doc/celerid.html (modified) (1 diff)
- trunk/html_doc/class_wrapping.html (modified) (1 diff)
- trunk/raw_html/celerid.html (modified) (1 diff)
- trunk/raw_html/class_wrapping.html (modified) (1 diff)
- trunk/support.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dcompiler.py
r61 r63 155 155 sources.append(pythonHeaderPath) 156 156 157 # flags = ( no_pyd, no_st, no_meta)157 # flags = (with_pyd, with_st, with_meta) 158 158 flags = [f for f, category in macros if category == 'aux'][0] 159 159 # And Pyd! 160 if notflags[0]:160 if flags[0]: 161 161 # If we're not using StackThreads, don't use iteration.d in Pyd 162 if flags[1] or not self._st_support:162 if not flags[1] or not self._st_support: 163 163 _pydFiles.remove('iteration.d'); 164 164 for file in _pydFiles: … … 170 170 sources.append(filePath) 171 171 # And StackThreads 172 if self._st_support and notflags[1]:172 if self._st_support and flags[1]: 173 173 for file in _stFiles: 174 174 filePath = os.path.join(_infraDir, 'st', file) … … 181 181 macros.append(('Pyd_with_StackThreads', 'version')) 182 182 # And meta 183 if notflags[2]:183 if flags[2]: 184 184 for file in _metaFiles: 185 185 filePath = os.path.join(_infraDir, 'meta', file) … … 190 190 sources.append(filePath) 191 191 # Add the infraDir to the include path for pyd, st, and meta. 192 if False in flags:192 if True in flags: 193 193 includePathOpts += self._includeOpts 194 194 includePathOpts[-1] = includePathOpts[-1] % os.path.join(_infraDir) trunk/html_doc/celerid.html
r62 r63 55 55 <dt><code>version_flags</code></dt> <dd>This should be a list of strings, which will be passed to the D compiler as version flags.</dd> 56 56 <dt><code>debug_flags</code></dt> <dd>Similar to <code>version_flags</code>, the strings in this list will be passed to D as debug flags.</dd> 57 <dt><code>raw_only</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of Pyd, StackThreads, and meta. This is useful if you only want to write a raw Python/C extension without the overhead of Pyd and its auxiliary packages. This is equivalent to specifying <code> True</code> to the next three flags.</dd>58 <dt><code> no_pyd</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of Pyd. This is useful if you want to write a raw Python/C extension and don't want the overhead of compiling Pyd.</dd>59 <dt><code> no_st</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of StackThreads. Pyd uses StackThreads for its iteration wrapping support. By specifying this, opApply wrapping, <code>wrapped_class.iter</code>, and <code>wrapped_class.alt_iter</code> will be unavailable. If <code>no_pyd</code> and this are <code>False</code>, then the <code>Pyd_with_StackThreads</code> version flag will be defined (which is used internally by Pyd). <b>Important note:</b> StackThreads does not currently work with GDC! CeleriD will always set this flag to <code>True</code> when using GDC! This means that opApply wrapping is not available on Linux at this time.</dd>60 <dt><code> no_meta</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of <code>meta</code> (Pyd's metaprogramming package). Because Pyd depends on meta, an exception will be raised if this is specified and <code>no_pyd</code>is not.</dd>57 <dt><code>raw_only</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of Pyd, StackThreads, and meta. This is useful if you only want to write a raw Python/C extension without the overhead of Pyd and its auxiliary packages. This is equivalent to specifying <code>False</code> to the next three flags.</dd> 58 <dt><code>with_pyd</code></dt> <dd>This flag defaults to <code>True</code>. When <code>False</code>, it supresses the compilation and linkage of Pyd. This is useful if you want to write a raw Python/C extension and don't want the overhead of compiling Pyd.</dd> 59 <dt><code>with_st</code></dt> <dd>This flag defaults to <code>True</code>. When <code>False</code>, it supresses the compilation and linkage of StackThreads. Pyd uses StackThreads for its iteration wrapping support. By setting this to <code>False</code>, opApply wrapping, <code>wrapped_class.iter</code>, and <code>wrapped_class.alt_iter</code> will be unavailable. If <code>with_pyd</code> and this are <code>True</code>, then the <code>Pyd_with_StackThreads</code> version flag will be defined (which is used internally by Pyd). <b>Important note:</b> StackThreads does not currently work with GDC! CeleriD will always set this flag to <code>False</code> when using GDC! This means that opApply wrapping is not available on Linux at this time.</dd> 60 <dt><code>with_meta</code></dt> <dd>This flag defaults to <code>True</code>. When <code>False</code>, it supresses the compilation and linkage of <code>meta</code> (Pyd's metaprogramming package). Because Pyd depends on meta, an exception will be raised if <code>with_pyd</code> is <code>True</code> and this is not.</dd> 61 61 </dl> 62 62 </dd> trunk/html_doc/class_wrapping.html
r62 r63 100 100 101 101 <dl> 102 <dt><code>opApply</code></dt> <dd>Pyd wraps D's iteration protocol with the help of Mikola Lysenko's StackThreads package. This package does not work in GDC, and so opApply wrapping is not available in Linux. See also the <a href="celerid.html"><code> no_st</code></a> option offered by CeleriD.</dd>102 <dt><code>opApply</code></dt> <dd>Pyd wraps D's iteration protocol with the help of Mikola Lysenko's StackThreads package. This package does not work in GDC, and so opApply wrapping is not available in Linux. See also the <a href="celerid.html"><code>with_st</code></a> option offered by CeleriD.</dd> 103 103 <dt><code>opSlice, opSliceAssign</code></dt> <dd>Pyd only supports these overloads if both of their two indexes are implicitly convertable to type <code>int</code>. This is a limitation of the Python/C API. Note that this means the zero-argument form of opSlice (for allowing the "empty slice," e.g. <code>foo[]</code>) cannot be wrapped. <i>(I may work around this in the future.)</i> Because Pyd can only automatically wrap the lexically-first method in a class, it will fail to wrap opSlice and opSliceAssign if you define an empty form first.</dd> 104 104 <dt><code>opCat, opCatAssign</code></dt> <dd>Python does not have a dedicated array concatenation operator. The plus sign (<code>+</code>) is reused for this purpose. Therefore, odd behavior may result with classes that define both <code>opAdd/opAddAssign</code> and one or both of these operators. (Consider yourself warned.) However, the Python/C API considers addition and concatenation distinct operations, and so both of these sets of operator overloads are supported.</dd> trunk/raw_html/celerid.html
r62 r63 40 40 <dt><code>version_flags</code></dt> <dd>This should be a list of strings, which will be passed to the D compiler as version flags.</dd> 41 41 <dt><code>debug_flags</code></dt> <dd>Similar to <code>version_flags</code>, the strings in this list will be passed to D as debug flags.</dd> 42 <dt><code>raw_only</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of Pyd, StackThreads, and meta. This is useful if you only want to write a raw Python/C extension without the overhead of Pyd and its auxiliary packages. This is equivalent to specifying <code> True</code> to the next three flags.</dd>43 <dt><code> no_pyd</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of Pyd. This is useful if you want to write a raw Python/C extension and don't want the overhead of compiling Pyd.</dd>44 <dt><code> no_st</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of StackThreads. Pyd uses StackThreads for its iteration wrapping support. By specifying this, opApply wrapping, <code>wrapped_class.iter</code>, and <code>wrapped_class.alt_iter</code> will be unavailable. If <code>no_pyd</code> and this are <code>False</code>, then the <code>Pyd_with_StackThreads</code> version flag will be defined (which is used internally by Pyd). <b>Important note:</b> StackThreads does not currently work with GDC! CeleriD will always set this flag to <code>True</code> when using GDC! This means that opApply wrapping is not available on Linux at this time.</dd>45 <dt><code> no_meta</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of <code>meta</code> (Pyd's metaprogramming package). Because Pyd depends on meta, an exception will be raised if this is specified and <code>no_pyd</code>is not.</dd>42 <dt><code>raw_only</code></dt> <dd>This flag defaults to <code>False</code>. When <code>True</code>, it supresses the compilation and linkage of Pyd, StackThreads, and meta. This is useful if you only want to write a raw Python/C extension without the overhead of Pyd and its auxiliary packages. This is equivalent to specifying <code>False</code> to the next three flags.</dd> 43 <dt><code>with_pyd</code></dt> <dd>This flag defaults to <code>True</code>. When <code>False</code>, it supresses the compilation and linkage of Pyd. This is useful if you want to write a raw Python/C extension and don't want the overhead of compiling Pyd.</dd> 44 <dt><code>with_st</code></dt> <dd>This flag defaults to <code>True</code>. When <code>False</code>, it supresses the compilation and linkage of StackThreads. Pyd uses StackThreads for its iteration wrapping support. By setting this to <code>False</code>, opApply wrapping, <code>wrapped_class.iter</code>, and <code>wrapped_class.alt_iter</code> will be unavailable. If <code>with_pyd</code> and this are <code>True</code>, then the <code>Pyd_with_StackThreads</code> version flag will be defined (which is used internally by Pyd). <b>Important note:</b> StackThreads does not currently work with GDC! CeleriD will always set this flag to <code>False</code> when using GDC! This means that opApply wrapping is not available on Linux at this time.</dd> 45 <dt><code>with_meta</code></dt> <dd>This flag defaults to <code>True</code>. When <code>False</code>, it supresses the compilation and linkage of <code>meta</code> (Pyd's metaprogramming package). Because Pyd depends on meta, an exception will be raised if <code>with_pyd</code> is <code>True</code> and this is not.</dd> 46 46 </dl> 47 47 </dd> trunk/raw_html/class_wrapping.html
r62 r63 85 85 86 86 <dl> 87 <dt><code>opApply</code></dt> <dd>Pyd wraps D's iteration protocol with the help of Mikola Lysenko's StackThreads package. This package does not work in GDC, and so opApply wrapping is not available in Linux. See also the <a href="celerid.html"><code> no_st</code></a> option offered by CeleriD.</dd>87 <dt><code>opApply</code></dt> <dd>Pyd wraps D's iteration protocol with the help of Mikola Lysenko's StackThreads package. This package does not work in GDC, and so opApply wrapping is not available in Linux. See also the <a href="celerid.html"><code>with_st</code></a> option offered by CeleriD.</dd> 88 88 <dt><code>opSlice, opSliceAssign</code></dt> <dd>Pyd only supports these overloads if both of their two indexes are implicitly convertable to type <code>int</code>. This is a limitation of the Python/C API. Note that this means the zero-argument form of opSlice (for allowing the "empty slice," e.g. <code>foo[]</code>) cannot be wrapped. <i>(I may work around this in the future.)</i> Because Pyd can only automatically wrap the lexically-first method in a class, it will fail to wrap opSlice and opSliceAssign if you define an empty form first.</dd> 89 89 <dt><code>opCat, opCatAssign</code></dt> <dd>Python does not have a dedicated array concatenation operator. The plus sign (<code>+</code>) is reused for this purpose. Therefore, odd behavior may result with classes that define both <code>opAdd/opAddAssign</code> and one or both of these operators. (Consider yourself warned.) However, the Python/C API considers addition and concatenation distinct operations, and so both of these sets of operator overloads are supported.</dd> trunk/support.py
r48 r63 41 41 # Similarly, pass in no_pyd, &c, via define_macros. 42 42 if 'raw_only' in kwargs: 43 kwargs[' no_pyd'] = True44 kwargs[' no_st'] = True45 kwargs[' no_meta'] = True43 kwargs['with_pyd'] = False 44 kwargs['with_st'] = False 45 kwargs['with_meta'] = False 46 46 del kwargs['raw_only'] 47 no_pyd = kwargs.pop('no_pyd', False)48 no_st = kwargs.pop('no_st', False)49 no_meta = kwargs.pop('no_meta', False)50 if not no_pyd and no_meta:47 with_pyd = kwargs.pop('with_pyd', True) 48 with_st = kwargs.pop('with_st', True) 49 with_meta = kwargs.pop('with_meta', True) 50 if with_pyd and not with_meta: 51 51 raise DistutilsOptionError( 52 'Cannot specify no_metawhile using Pyd. Specify'53 ' raw_only or no_pydif you want to compile a raw Python/C'52 'Cannot specify with_meta=False while using Pyd. Specify' 53 ' raw_only=True or with_pyd=False if you want to compile a raw Python/C' 54 54 ' extension.' 55 55 ) 56 define_macros.append((( no_pyd, no_st, no_meta), 'aux'))56 define_macros.append(((with_pyd, with_st, with_meta), 'aux')) 57 57 kwargs['define_macros'] = define_macros 58 58
