diff -r 7685cec9fd3c -r f2ddfa555b0f doc/api/python/archive.scanners-pysrc.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/api/python/archive.scanners-pysrc.html Fri Sep 11 11:54:49 2009 +0100
@@ -0,0 +1,1730 @@
+
+
+
+
+ archive.scanners
+
+
+
+
+
+
+
+
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20 """ Implementation of the available scanner for """
+ 21
+ 22 import os
+ 23 import fileutils
+ 24 import selectors
+ 25 import logging
+ 26 import codecs
+ 27 import pathaddition
+ 28
+ 29 logger = logging . getLogger ( 'archive.scanners' )
+ 30 logger_abld = logging . getLogger ( 'archive.scanners.abld' )
+ 31 logging . basicConfig ( )
+ 32
+ 33
+ 34 - class Scanner ( fileutils . AbstractScanner ) :
+
35 """ Abstract class that represent and input source. """
+
36
+
41
+
54
+
72
+
74 """ Generator method that scan the relevant input source.
+
75 This method need to be overloaded by the specialized class.
+
76 return fullpath name
+
77 """
+
78 raise NotImplementedError ( )
+
79
+ 80
+
82 """ Scanning the filesystem. """
+
83
+
87
+
89 """
+
90 Abld what commands.
+
91 include property have not effect on the selection mechanism.
+
92 """
+
93 os . environ [ "SYMBIANBUILD_DEPENDENCYOFF" ] = "1"
+
94 for path in self . _config . get_list ( 'abld.exportpath' , [ ] ) :
+
95 logger_abld . debug ( "abld.exportpath: %s" % path )
+
96 if os . path . exists ( os . path . join ( self . root_dir , path , 'bld.inf' ) ) :
+
97 os . chdir ( os . path . join ( self . root_dir , path ) )
+
98 os . popen ( 'bldmake bldfiles -k' )
+
99 for result in self . _scan_abld_what ( "abld export -what -k" ) :
+
100 yield result
+
101
+
102 for path in self . _config . get_list ( 'abld.buildpath' , [ ] ) :
+
103 logger_abld . debug ( "abld.buildpath: %s" % path )
+
104 if os . path . exists ( os . path . join ( self . root_dir , path , 'bld.inf' ) ) :
+
105 for type_ in self . _config . get_list ( 'abld.type' , [ 'armv5' ] ) :
+
106 os . environ [ "EPOCROOT" ] = self . _config . get ( 'abld.epocroot' , '\\' )
+
107 os . environ [ "PATH" ] = os . environ [ "EPOCROOT" ] + "epoc32\\tools;" + os . environ [ "EPOCROOT" ] + "epoc32\\gcc\\bin;" + os . environ [ "PATH" ]
+
108 logger_abld . debug ( "abld.type: %s" % type_ )
+
109 os . chdir ( os . path . join ( self . root_dir , path ) )
+
110 os . popen ( "bldmake bldfiles -k" )
+
111 os . popen ( "abld makefile %s -k" % type_ )
+
112 for result in self . _scan_abld_what ( "abld build -what %s" % type_ ) :
+
113 yield result
+
114
+
116 """ Run command."""
+
117 logger_abld . debug ( "command: %s" % cmd )
+
118 process = os . popen ( cmd )
+
119 abld_output = process . read ( )
+
120 err = process . close ( )
+
121 return ( err , abld_output )
+
122
+
124 """ Abld what output parser."""
+
125 ( err , abld_output ) = self . _run_cmd ( cmd )
+
126 logger_abld . debug ( "abld_output: %s" % abld_output )
+
127 for what_path in abld_output . split ( "\n" ) :
+
128 what_path = what_path . strip ( )
+
129 if ( what_path . startswith ( '\\' ) or what_path . startswith ( '/' ) ) and self . is_filetype ( what_path ) \
+
130 and not self . is_excluded ( what_path ) and self . is_selected ( what_path ) :
+
131 if os . path . exists ( what_path ) :
+
132 logger_abld . debug ( "adding: %s" % what_path )
+
133 yield what_path
+
134 else :
+
135 logger . error ( "Could not find '%s'." % what_path )
+
136
+137
+
139 """ Scanning the filesystem. """
+
140
+
144
+
146 """
+
147 Implement the scanning of the filesystem.
+
148 Actually delegate scanning of a directory to Filescanner.
+
149 """
+
150 for path in fileutils . FileScanner . scan ( self ) :
+
151 yield path
+
152
+153
+
183
+184 __scanners = { 'default' : FileSystemScanner ,
+185 'input.file' : InputFileScanner ,
+186 'abld.what' : AbldWhatScanner ,
+187 }
+188
+
190 result = [ ]
+
191 for name in names :
+
192 if name in __scanners :
+
193 result . append ( __scanners [ name ] ( config ) )
+
194 else :
+
195 raise Exception ( "ERROR: Could not find scanner '%s'." % name )
+
196 return result
+
197
+
+
+
+
+
+
+
+
+
+