Commits

Anonymous committed 20f26f8

contl10n01: c: -> cygdrive

Comments (0)

Files changed (1)

l10ntools/scripts/tool/commands.py

 # Abstract class 
 class Command:
     """Abstract class for a single step. The commands contains all the logic needed for the build bot"""
-    
+
     state_name = ""
     _log = None    
     state_config_location = ""
 
     def pre(self, tool_cfg, state_cfg, env, log, model):
         """Init the step with needed parameters. Reads the data from prev state from state_cfg and tool_cfg."""
-        
+
         raise NotImplementedException
-    
+
     def do(self, env):
         """Here you have to implement the logic of the step"""
-        
+
         raise NotImplementedException
-    
+
     def post(self, tool_cfg, state_cfg, env):
         """Save the context of the current step in the state_cfg. Those data can be read in the next step again"""
-        
+
         raise NotImplementedException
-    
+
     def write_state_cfg(self, state_cfg):
         """Writes out the current state_cfg. Don't overwrite this method!"""
-        
+
         if state_cfg.has_section("Runtime") == False:  
             state_cfg.add_section("Runtime") 
         state_cfg.set("Runtime", "current_state", self.state_name)
-        
+
         if Command.state_config_location == "":
             Command.state_config_location = os.getcwd()+"/state.cfg"
 
 
     def unpack_list(self,string):
         """Helper method for unpacking a list element from a string"""
-        
+
         mylist = list()
         group_list = re.findall("'([^']*)'[\s ]*[,\]]",string)
         [mylist.append(group) for group in group_list]
         [mydict.__setitem__(group[0], group[1]) for group in group_list]
         return mydict
 
-    
+
 class GetSdf(Command):
     """This step is responsible for retriveing sdf files from various sources"""
     state_name = "GETSDF"
         self._gunzip            =  utils.Util.replace_variables(tool_cfg.get("Download Server", "gunzip"), env, tool_cfg, self._log)  
         self._bunzip2           =  utils.Util.replace_variables(tool_cfg.get("Download Server", "bunzip2"), env, tool_cfg, self._log)  
         self._log = log 
-        
+
     def do(self, env):
         """Supported locations for downloading sdf files are scp, zipfile and local filesystem"""
-        
+
         if self._dest_path[1] == ":":
             self._dest_path = "/cygdrive/" + self._dest_path[0] + self._dest_path[2:]
         utils.Util.makedirs(self._dest_path, self._log)
                 except IOError:
                     #self._log.warning("File "+file+" seems to be no gzip file ... skipping")
                     pass
-                
+
         #sys.exit(-1)
 
     def post(self, tool_cfg, state_cfg, env):
             f.close()
         except:
             self._log.die("Can't read sdf file list")
-        
+
         for line in lines:
             if not line.startswith("#"):
                 triple = line.split(" ")
         self._lic_header = utils.Util.replace_variables(tool_cfg.get("L10N Dir", "lic_header_rel_path"), env, tool_cfg, self._log)
         self._dest_path  = utils.Util.replace_variables(tool_cfg.get("Download Server", "dest_path"), env, tool_cfg, self._log)  
 
+        if self._cws_root_dir[1] == ":":
+            self._cws_root_dir = "/cygdrive/" + self._cws_root_dir[0] + self._cws_root_dir[2:]
+
     def read_enabled_langs(self):
         """This method reads the languages enabled in the resource system. There are more places 
         that potential have to be checked but the setup_native/source/win32/msi-encodinglist.txt 
 
     def do(self, env):
         """Reads, checks, filter out and then merges the sdf files into the source code."""
-        
+
         enabled_langs = self.read_enabled_langs()
         # cleanup of previous run
         [utils.Util.rm(file, self._log) for file in glob.glob(self._dest_path + "/*_ok.sdf")]
         [utils.Util.exe_ignore_errors(self._cws_root + "/solenv/bin/gsicheck -l none -k -wc -we " + file, self._log, env, True) 
                 for file in glob.glob(self._dest_path + "/*.sdf") if not file.endswith("_ok.sdf")] 
         files = glob.glob(self._dest_path + "/*_ok.sdf")
-        
+
         # Gsicheck all err.sdf again and write the gsicheck log
         err_files = glob.glob(self._dest_path + "/*_err.sdf")
         for err_file in err_files:
         if len(new_files) > 0:
             self._log.debug("New files:" + str(new_files))
         return mod_files, new_files
-    
+
     def post(self, tool_cfg, state_cfg, env):
         modified_files, new_files = self.test_on_changes()
         if len(modified_files) == 0 and len(new_files) == 0:
         state_cfg.set("MERGE","files_modified",str(modified_files)) 
         state_cfg.set("MERGE","new_files",str(new_files))        
         self.write_state_cfg(state_cfg)
-        
+
 class Compile(Command):
     """This steps builds with activated languages. In case there is no error then a bunch of language packs are packed.
     If an error occurs the steps tries to find this error and removes that offending language."""
 
     state_name = "COMPILE"
-    
+
     def pre(self, tool_cfg, state_cfg, env, log, model):
         self._log = log
         self._model = model
         self._languages_proccessed = self.unpack_list(state_cfg.get("MERGE","languages_proccessed"))
         self._new_files = self.unpack_list(state_cfg.get("MERGE","new_files"))
         self._num_of_procs = utils.Util.replace_variables(tool_cfg.get("BOT","num_of_procs"), env, tool_cfg, self._log)
-        
-        
+
+
     def modifiy_pack_lst(self):
         """Create languagespacks with each 10 languages """
 
         utils.Util.rm(self._cws_root + "/instsetoo_native/util/pack.lst.bak", self._log)
         utils.Util.rename(self._cws_root + "/instsetoo_native/util/pack.lst", self._cws_root + "/instsetoo_native/util/pack.lst.bak", self._log)
-        
+
         pack_lst_pre = "OpenOfficeLanguagepack   unxlngi6.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxlngx6.pro,unxmacxi.pro  "
         pack_lst_post = "  ooolanguagepack"
         langs = self._files_modified + self._new_files
         MAX_LANGS_PER_LPACK = 10
-        
+
         lang_list = []
         for n in range(0,len(langs), MAX_LANGS_PER_LPACK-1):
             list = []
                     list.append(langs[n+x]) 
             lang_list.append("en-US_" + "_".join(list)) 
             list = []
-
         try:
             fh = open(self._cws_root + "/instsetoo_native/util/pack.lst","wb")
             fh.write(pack_lst_pre + "|".join(lang_list) + pack_lst_post)
 
         old_path = os.getcwd()
         os.chdir(self._cws_root + "/instsetoo_native")
-        
+
         self.modifiy_pack_lst()
-        
+
         # setup source_config
         utils.Util.exe("perl "+self._cws_root + "/solenv/bin/build.pl product=full --genconf --removeall", self._log, env)
         #utils.Util.exe("perl "+self._cws_root + "/solenv/bin/build.pl product=full --genconf --add l10n", self._log, env)
         #utils.Util.exe("perl "+self._cws_root + "/solenv/bin/build.pl product=full --genconf --add readlicense_oo", self._log, env)
         utils.Util.exe("perl "+self._cws_root + "/solenv/bin/build.pl product=full --genconf --add --from l10n", self._log, env)
-        
+
         env["WITH_LANG"]=str(" ".join(self._files_modified + self._new_files))
-        
+
         # setup statics
         b_stats = BuildStats(self._log)
         b_stats.setup_stats(self._cws_root, env)
         self._log.info("Building "+str(len(self._files_modified)+len(self._new_files))+" language(s) using "+self._num_of_procs+" process(es)")
         self._log.info("Building language(s) "+str(env["WITH_LANG"]))
-        
+
         # Number of processes
         if self._num_of_procs == 1 or self._num_of_procs == "1" or self._num_of_procs == "":
             procs = ""
         # Start build
         start_time = time.time()
         p = utils.Util.exe_no_blocking("perl "+self._cws_root + "/solenv/bin/build.pl product=full " + procs + " --all", self._log, env)      
-        
+
         # Start the stdout / stderr reader
         t = TReaderControl(p, b_stats, self._log)
         t.start()
         os.chdir(old_path)
-        
+
         # Process running
         while p.poll() == None:               
             time.sleep(1)
-        
+
         # Process ended.    
         end_time = time.time()
         self._log.info("Process ended")
-  
+
         # Shutdown stdout / stderr reader
         t.stop()
-        
+
         # Anything left in stdout / stderr ?!? 
         [b_stats.parse_output(line.strip()) for line in p.stdout.readlines()]
         [b_stats.parse_output(line.strip()) for line in p.stderr.readlines()]       
-        
+
         # Process failed?        
         if p.returncode > 0:
             for dir in b_stats.bad_dirs:         
             out_lang.append(bad_langs)
             self._model.contl10n_status.set_bad_langs_out(bad_langs)
             self._model.contl10n_status.set_state(self._model.contl10n_status.FOUND_BAD_LANGUAGES)
-            
+
             if self._state_cfg.has_option("MERGE","bad_langs"):
                 prev = self.unpack_list(self._state_cfg.get("MERGE","bad_langs"))
                 prev.append(bad_langs)
                 self._state_cfg.set("MERGE","bad_langs",prev)
             else:
                 self._state_cfg.set("MERGE","bad_langs",bad_langs)
-                
+
             lang_list = set(env["WITH_LANG"].split()) - set(bad_langs)
             env["WITH_LANG"] = " ".join(lang_list)
             self.revert_langs(bad_langs, env)
             b_stats.bad_dirs = []
             self.do(env) 
-        
+
         # No!
         b_stats.log_build_duration(start_time, end_time)
 
         if env.has_key("WITH_LANG"):
             del env["WITH_LANG"]
-                    
+
     def search_error(self, env, bad_dirs):
         """Entry point for error search"""
 
         offending_module = offending_dir_rel 
         offending_module = offending_module[:offending_module.find("/")]
         lang_list = self._files_modified + self._new_files
-        
+
         if not offending_dir_abs.find("instsetoo_native") == -1:
             self._log.die("Build error in instsetoo_native. Maybe you have some new languages that are not yet part of the build system")
 
             sdf_root_dir = self._cws_root_dir + "/l10n/l10n/" + env["COMMON_OUTDIR"]+".pro/misc/sdf/" + offending_module
         else:
             sdf_root_dir = self._cws_root_dir + "/l10n/l10n/" + env["INPATH"]+"/misc/sdf/" + offending_module
-        
+
         src_dir = sdf_root_dir
         src_orig = sdf_root_dir+"_original"
-        
+
         if os.path.isdir(src_orig):
             self._log.warning("Detected previous aborted search! Cleaning up")
             utils.Util.rmtree(src_dir, self._log)
             utils.Util.rename(src_orig, src_dir, self._log)
-        
+
         self._log.info("Rename " +src_dir+ " to "+src_orig)    
         utils.Util.rename(src_dir, src_orig, self._log)
         # Room for optimization here. Possible test on each module, test on single dir
         utils.Util.rmtree(src_dir, self._log)
         utils.Util.rename(src_orig, src_dir, self._log)
         return bad_langs
-    
+
     def revert_langs(self, langs, env):
         """Revert languages in l10n module by performing a hg revert"""
 
             l = []
             l.append(langs)
             langs = l
-            
+
         old_langs = env["WITH_LANG"] 
         env["WITH_LANG"] = str(" ".join(langs))
 
         old_path = os.getcwd()
         os.chdir(self._cws_root + "/" + module)
-        
+
         # setup statics
         b_stats = BuildStats(self._log)
         b_stats.setup_stats(self._cws_root, env)
         langs = env["WITH_LANG"].split()
-                    
+
         self._log.info("Building "+str(len(langs))+" language(s) using "+self._num_of_procs+" process(es)")
         self._log.info("Building language(s) "+str(env["WITH_LANG"]))
 
         # Start build
         #start_time = time.time()
         p = utils.Util.exe_no_blocking("perl "+self._cws_root + "/solenv/bin/build.pl product=full " + procs, self._log, env)      
-        
+
         # Start the stdout / stderr reader
         t = TReaderControl(p, b_stats, self._log)
         t.start()
         # Process running
         while p.poll() == None:               
             time.sleep(1)
-        
+
         # Process ended.    
         #end_time = time.time()
         #self._log.info("Process ended")
-  
+
         # Shutdown stdout / stderr reader
         t.stop()
-        
+
         # Anything left in stdout / stderr ?!? 
         [b_stats.parse_output(line.strip()) for line in p.stdout.readlines()]
         [b_stats.parse_output(line.strip()) for line in p.stderr.readlines()]       
-        
-        
+
+
         env["WITH_LANG"] = old_langs 
-        
+
         # Process failed?        
         if p.returncode == 0:
             return True
         else:
             return False
-        
+
     def _test_on_subset_dir_module(self, langs, module, src_dir, src_orig, env):
         """Test a single module. Copy only the subset of languages into the l10n module and test if this breaks or not"""
 
             self._log.info("Testing on subset "+" "+lang_str+ " failed!")
             self._log.info("************************************")
         return is_ok
-    
+
     def _search_evil_langs(self, lang_list, module, test_on_subset, src_dir, src_orig, env):
         """Try to find the offending languages by repeating building on subsets of the languages 
         till the offending language is found"""
         subset_queue = []
         bad_langs    = []
         subset_queue.append(lang_list)
-        
+
         while len(subset_queue) > 0:
             list = subset_queue.pop()
             hi = len(list)
             lo = 0
             mid = (lo+hi)/2
-              
+
             if isinstance(list, str) or len(list) == 1:
                 if not list[0] == "":
                     res = test_on_subset(list[0], module, src_dir, src_orig, env)
                     subset_queue.append(list[lo:mid])
                 if not is_right_ok:
                     subset_queue.append(list[mid:hi])
-        
+
         # Final cleanup
         for dir in glob.glob(self._cws_root + "/"+module+"/*.pro"):
             self._log.debug("Removing output trees of "+ dir)
             utils.Util.rmtree(dir, self._log)
- 
+
         return bad_langs
-    
+
     def post(self, tool_cfg, state_cfg, env):
         # write status into state_cfg
         pass
-   
+
 class Upload(Command):
     """This step is responsible for uploading the builded instsets, err sdf files found by gsicheck 
     and the build log to a scp location"""
 
     state_name = "UPLOAD"
-        
+
     def pre(self, tool_cfg, state_cfg, env, log, model):
         self._cws_root          = utils.Util.replace_variables(tool_cfg.get("CWS","cws_root"), env, tool_cfg, self._log)  
         self._server_url        = utils.Util.replace_variables(tool_cfg.get("Upload Server", "server_url"), env, tool_cfg, self._log)
         self._sdf_error_files.append(" ".join(glob.glob(self._sdf_error_log_pattern)))
         self._log_files = glob.glob(self._log_file_pattern)
         self._log = log
-        
+
     def do(self, env):
         if len(self._files) == 0:
             self._log.die("Error in Upload. There is simply nothing to upload in "+self._cws_root+"/"+self._source_pattern+"\nNow what?")
         if len(self._log_files) > 0:
             self._log.info("Copying log file " + str(self._log_files[0]))
             my_log_file = self._log_files[0]
-            
+
             if my_log_file.startswith("./"):
                 my_log_file = my_log_file[2:]
-            
+
             if utils.Util.get_platform() == "windows":
                 utils.Util.copyfile(self._log_files[0], self._log_windows_path+"/"+env["CWS_WORK_STAMP"]+"_"+my_log_file, self._log)
             else:
         if not state_cfg.has_section:
             state_cfg.add_section(self.state_name)
 
-    
+
 class CommitSDF(Command):
     state_name = "COMMITSDF"
     """This step is responsible for add and commiting of the sdf files"""
                 add_list.append(self._cws_root_dir+"/l10n/l10n/source/"+lang+"/localize.sdf")
             add_errmsg = "Execution failed of hg add files " + str(" ".join(add_list)) + "'\n"
             out_v = utils.Util.hg_cmd(commands.add, self._log, add_errmsg, myui, repo, *add_list)        
-        
+
         #### hg commit ###
         if self._commit_all == "True":         # commit all
             path = self._cws_root_dir + "/l10n/" + self._l10n_path
                 self._log.die("There is nothing to hg commit ?!?! Is this correct?!")
             commit_errmsg = "Execution failed of hg commit '" + " ".join(file_list) + "'\n"             
             out_v = utils.Util.hg_cmd(commands.commit, self._log, commit_errmsg, myui, repo, *file_list , message=self._commit_msg)
-        
+
         ### hg verify ###
         if len(self._new_files) > 0 or len(self._files_modified) > 0:
             verify_errmsg = "Execution failed of hg verify\n"
             out_v = utils.Util.hg_cmd(commands.verify, self._log, verify_errmsg, myui, repo)
-         
+
 
         ### hg outgoing ###
         #if len(self._new_files) > 0 or len(self._files_modified) > 0 and len(self._dest_repo) > 0: 
         #    outgoing_errmsg = "Execution failed of hg outgoing " + self._dest_repo + "'\n"
         #    out_v_outgoing = utils.Util.hg_cmd(commands.outgoing, self._log, outgoing_errmsg, myui, repo, self._dest_repo)
         #    # nice for log and good test if there is a server!
-        
+
         ### hg push ###
         if len(self._new_files) > 0 or len(self._files_modified) > 0 and len(self._dest_repo) > 0:
             push_errmsg = "Execution failed of hg push " + self._dest_repo + "'\n" 
             out_v = utils.Util.hg_cmd(commands.push, self._log, push_errmsg, myui, repo, self._dest_repo)
             self._log.info("Changesets pushed to " + self._dest_repo + ":")
             self._log.info(out_v)
-        
+
         os.chdir(old_path)
-        
+
     def post(self, tool_cfg, state_cfg, env):
         # write status into state_cfg
         pass
         eis_con = eis.Eis.get_eis(eiswrapper.EisWrapper.url, eiswrapper.EisWrapper.namespace, "", "")
         eisc = eiswrapper.EisWrapper(eis_con,self._cws_name)
         self._log.info("CWS "+self._cws_name+":")
-        
+
         eisc.set_qa_responsible_email("ivo.hinkelmann@oracle.com")
         self._log.info("Setting QA to ivo.hinkelmann@oracle.com")
-         
+
         eisc.set_owner_email("ivo.hinkelmann@oracle.com")
         self._log.info("Setting Owner to ivo.hinkelmann@oracle.com")
-        
+
         #eisc.set_member_emails("dd@membermail.de")
         #eisc.set_cc_list("ee@cclist.de")
-        
+
         date_string = datetime.date.fromtimestamp(time.time()).isoformat()
         eisc.set_due_date(date_string)
-        
+
         self._log.info("Setting due date to "+ date_string)
         eisc.set_due_date_qa(date_string)
-        
+
         self._log.info("Setting qa date to "+ date_string)
         eisc.set_release_ooo(self._release)
-        
+
         self._log.info("Release "+self._release)
         eisc.set_scope(eiswrapper.Scope.WHOLE_OFFICE)
-        
+
         self._log.info("Scope "+eiswrapper.Scope.WHOLE_OFFICE)
         eisc.set_public(True)
-        
+
         self._log.info("set public")
         string =  "L10N cws produced by ContL10N"
-        
+
         eisc.set_description(string)
         self._log.info("Desciption\n"+string)
 
     def post(self, tool_cfg, state_cfg, env):
         pass
 
-  
+
 class SetStati(Command):
     """In this step all bots add a comment about the status of their build to the cws"""
 
     state_name = "SETSTATI"
-    
+
     def pre(self, tool_cfg, state_cfg, env, log, model):
         self._log = log
         self._files_modified = self.unpack_list(state_cfg.get("MERGE","files_modified"))
         eis_con = eis.Eis.get_eis(eiswrapper.EisWrapper.url,eiswrapper.EisWrapper.namespace,"","")
         eisc = eiswrapper.EisWrapper(eis_con,self._cws_name)
         self._log.info("CWS "+self._cws_name+":")
-        
+
         string =  "Plattform:<br>"
         string += utils.Util.get_platform()+"<p>"
         string += "Languages processed:<br>"+" ".join(self._languages_proccessed)+"<p>"
         eisc.add_comment(string, "Ivo Hinkelmann", "ivo.hinkelmann@openoffice.org")
         string = string.replace("<br>","\n")
         self._log.info(string)
-        
+
     def post(self, tool_cfg, state_cfg, env):
         # write status into state_cfg
         pass
 class End(Command):
     """This step don't do anything usefull but is needed to mark the end""" 
     state_name = "END"
-    
+
     def pre(self, tool_cfg, state_cfg, env, log, model):
         self._log = log        
         # read all the stuff from tool_cfg
 class Start(Command):
     """This step don't do anything usefull but is needed to mark the beginning"""
     state_name = "START"
-    
+
     def pre(self, tool_cfg, state_cfg, env, log, model):
         self._log = log
         # read all the stuff from tool_cfg
-       
+
     def do(self, env):
         pass
 
     and to find build issues not related to localization."""
 
     state_name = "PREBUILD"
-    
+
     def pre(self, tool_cfg, state_cfg, env, log, model):
         self._log = log
         self._cws_root = utils.Util.replace_variables(tool_cfg.get("CWS","cws_root"), env, tool_cfg, self._log)
         self._num_of_procs = utils.Util.replace_variables(tool_cfg.get("BOT","num_of_procs"), env, tool_cfg, self._log)
-    
+
     def modifiy_pack_lst(self):
         """Create en-US insetset """
 
         utils.Util.rm(self._cws_root + "/instsetoo_native/util/pack.lst.bak", self._log)
         utils.Util.rename(self._cws_root + "/instsetoo_native/util/pack.lst", self._cws_root + "/instsetoo_native/util/pack.lst.bak", self._log)
-        
+
         pack_lst = "OpenOffice   unxlngi6.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxlngx6.pro,unxmacxi.pro  en-US openoffice"
 
         try:
         except IOError:
             self._log.die("Can not write file "+self._cws_root + "/instsetoo_native/util/pack.lst")
 
-    
+
 
     def do(self, env):
         # REMOVE ME
         #return 
-        
+
         self.modifiy_pack_lst()
 
         old_path = os.getcwd()
         # build without languages
         if env.has_key("WITH_LANG"):
             del env["WITH_LANG"]
-        
+
         # setup statics
         b_stats = BuildStats(self._log)
         b_stats.setup_stats(self._cws_root, env)
-        
+
         # Number of processes
         self._log.info("Building with disabled languages using "+self._num_of_procs+" process(es)")
-        
+
         if self._num_of_procs == 1 or self._num_of_procs == "":
             procs = ""
         else:
             procs = "--stoponerror -P" + self._num_of_procs
-        
+
         # Start build
         start_time = time.time()
         p = utils.Util.exe_no_blocking("perl "+self._cws_root + "/solenv/bin/build.pl product=full " + procs + " --all", self._log, env)      
-        
+
         # Start the stdout / stderr reader
         t = TReaderControl(p, b_stats, self._log)
         t.start()
         # Process running
         while p.poll() == None:               
             time.sleep(1)
-        
+
         # Process ended.    
         end_time = time.time()
         self._log.info("Process ended")
 
         # Shutdown stdout / stderr reader
         t.stop()
-        
+
         # Anything left in stdout / stderr ?!? Do I need to check this ? 
         [b_stats.parse_output(line.strip()) for line in p.stdout.readlines()]
         [b_stats.parse_output(line.strip()) for line in p.stderr.readlines()]       
-        
+
         # Process failed?        
         if p.returncode > 0:
             for dir in b_stats.bad_dirs:         
                 self._log.error("Building directory " + dir + " failed!")
             b_stats.log_build_duration(start_time, end_time)
             self._log.die("Good bye cruel world")
-        
+
         # No!
         b_stats.log_build_duration(start_time, end_time)
-        
+
     def post(self, tool_cfg, state_cfg, env):
         # write status into state_cfg
         pass
         state_cfg.set("Runtime", "milestone", milestone)
         self._cws_create_string = utils.Util.replace_variables(tool_cfg.get("CWS","cws_create_string"), env, tool_cfg, self._log)
         self._cws_create_string = self._cws_create_string.replace(env["WORK_STAMP"],env["WORK_STAMP"].lower())
-         
+
     def create_cws(self, env):
         cws_create_str = self._cws_root + "/" + self._cws_create_string
         self._log.info("cws create would look like this:")
         self._log.info(cws_create_str)
         #utils.Util.exe(cws_create_str, self._log) 
-    
+
     def prepare_env(self, tool_cfg, state_cfg, env):#, milestone, work_stamp): 
         # set up environment 
         setsolar_str  = utils.Util.replace_variables(tool_cfg.get("BOT","setsolar_string"), env, tool_cfg, self._log)
                 self._log.die("ERROR: Can not copy unowinreg.dll to " + cws_root + "/external/unowinreg\n" + str(e))
         else:
             self._log.debug("Found a unowinreg.dll in " + cws_root + "/external/unowinreg/unowinreg.dll")
-        
+
         env.set(utils.Env(configure_str, setsolar_str, cws_root, use_env, self._log))
         env_file = env.generate()
         self._log.debug("DBG: env file = " + env_file)
         env["UPDMINOR"] = state_cfg.get("Runtime","milestone")
         state_cfg.set("Runtime", "env_file", env_file)
 
-            
+
     def do(self, env):     
         #self.prepare_env(self._tool_cfg, self._state_cfg, env)
         self.create_cws(env)
         return
 
-        
+
         myui = ui.ui()
         dest_repo = self._cws_root + "/" 
         ### hg clone ###
         self._t2.stop()
         self._t1.join()
         self._t2.join()
-    
+
 class TReader(threading.Thread):
     """Threaded class to read stdin/stderr from a process"""
 
         self._log = log
         self._stop_e = threading.Event()
         threading.Thread.__init__(self)
-            
+
     def stop(self):
         self._stop_e.set()
-        
+
     def run(self):
         self._log.debug("Starting read thread")
         while not self._stop_e.is_set():
     all_directories = dict()
     bad_dirs = list()
     out_buf = list()
-    
+
     # Guarded values
     _dirs_builded = 0
     _mods_builded = 0
     _dirs_builded_lock = None
     _mods_builded_lock = None
 
-    
+
     def __init__(self, log):
         self._mod_pattern, self._dir_pattern, self._err_pattern = self.pre_compile_regex()
         self._log = log
             self._dirs_builded = self._dirs_builded + 1
         finally:
             self._dirs_builded_lock.release()
-    
+
     def inc_mods_builded(self):
         self._mods_builded_lock.acquire()
         try:
         finally:
             self._dirs_builded_lock.release()
         return dirs
-    
+
     def get_mods_builded(self):
         mods = 0
         self._mods_builded_lock.acquire()
         finally:
             self._mods_builded_lock.release()
         return mods
-    
+
     def pre_compile_regex(self):
         #"l10n deliver"
         #"Module 'l10n' delivered successfully. 0 files copied, 64 files unchanged"
         dir_pattern = re.compile("^Entering ([^ \t$]+)[ \t]*$")
         err_pattern = re.compile("^ERROR: error \d* occurred while making ([^ \t$]+)[ \t$]*")
         return mod_pattern, dir_pattern, err_pattern
-        
+
     def parse_output(self,line):
         current_dir = ""
         current_mod = ""
         m_mod = self._mod_pattern.search(line)
         m_dir = self._dir_pattern.search(line)
         m_err = self._err_pattern.search(line)
-        
+
         if not m_mod == None:
             current_mod = m_mod.group(1)
             m_str = '[ %(mods_builded)04d/%(num_of_mods)04d ] Module %(module)s' % \
         duration = strftime("%H:%M:%S", gmtime(end_time - start_time)) # if you need "days" here buy a new build machine
         self._log.info("Build start: "+start+" end: "+end)
         self._log.info("Total build time: "+duration)
-    
+
     def setup_stats(self, cws_root, env):
         self._log.info("Setting up statistics ...")
         rc, stdout_value, stderr_value = utils.Util.exe("perl " + cws_root + "/solenv/bin/build.pl product=full --all --show ", self._log, env)
         self._log.debug(string)    
         self._log.info("Building %(num)04d directories" % { 'num': self.num_of_dirs})
         self._log.debug(str("\n".join(self.all_directories.keys())))
-        
+