Changes between Version 7 and Version 8 of GSOCWebSetupImplementation


Ignore:
Timestamp:
04/05/11 17:17:31 (10 years ago)
Author:
anubhav
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GSOCWebSetupImplementation

    v7 v8  
    5050In the modules the layout is not required, as they are stored when we run the modified form of 000_config in the models. The input types of these (name, Description, Access level) are quite fixed so they need not to be stored separately. Therefore not much help is required for the views to.
    5151
     52== '''MODELS''' ==
     53===     '''1st_run.py'''                                             (This will run before the modified version of 000_config) ===
    5254
    5355
     56==== Session variable : session.path_to_config ====
     57This will initialize a session variable that will help us get the status of the selector. If the session variable is “none” we can initialize it to “”,    and later in the controller it can be set to the path of 000_config of that particular eden they want the to the web-setup to run on.
     58This session variable will help us to get the path of the 000_config from the controllers.
     59
     60==== Parsing 000_config.py ====
     61
     62Once we get the path of 000_config we need to copy that file in the websetup models by the the name of modified_config.py so that it shall run after this file closes. Now open modified_config using os.path.join in the “w” mode and 000_config in the “r” mode. We need to read 000_config and
     63This would result in the creation of 2 dicts one is deployment_settings and the other one is for the modules  deployment_settings.modules .Now 6th and 7th steps will help us to maintain the dicts for modules that were turned off by commenting them.
     64{{{
     65#!html
     66<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'>---------------------------------------------------------------------------------------------------------------------------------------------------------</p>
     67<p style='color:#595959'>1.Remove the line containing <b>“s3base.s3config(” </b>from
     68the starting of the file</p>
     69
     70<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><span
     71style='color:#595959'>&nbsp;</span></p>
     72
     73<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><span
     74style='color:#595959'>2. Insert </span></p>
     75
     76<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><b><span
     77style='color:#595959'>“ from gluon.storage import Storage</span></b></p>
     78
     79<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><b><span
     80style='color:#595959'>from gluon.contrib.simplejson.ordered_dict import
     81OrderedDict</span></b></p>
     82
     83<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><b><span
     84style='color:#595959'>deployment_settings = Storage( “</span></b><span
     85style='color:#595959'>   </span></p>
     86
     87<p class=MsoListParagraphCxSpLast style='margin-left:0cm'><span
     88style='color:#595959'>before the first line where they find  “deployment_settings.”
     89Without a “<b>#</b>”  in the 000_config.py           </span></p>
     90
     91<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     92style='color:#595959'>3. And add <b>“ ) ”</b> Immediately before the import of
     93storage and remove the import of storage from there </span></p>
     94
     95<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     96style='color:#595959'>&nbsp;</span></p>
     97
     98<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     99style='color:#595959'>4. Add 4 spaces to each line between “<b>Storage(</b>“
     100and “<b>)</b>” even the commented ones </span></p>
     101
     102<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     103style='color:#595959'>&nbsp;</span></p>
     104
     105<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     106style='color:#595959'>5<b>.</b> Make the following to the lines except the ones
     107containing “#” before the use of “<b>deployment_settings.</b>”  </span></p>
     108
     109<p class=MsoListParagraphCxSpFirst style='margin-bottom:0cm;margin-bottom:.0001pt;
     110text-indent:-18.0pt'><span style='font-family:Wingdings;color:#595959'>v<span
     111style='font:7.0pt "Times New Roman"'>&nbsp; </span></span><span
     112style='color:#595959'>Wrap each word containing “<b>deployment_settings.</b>”
     113with “” </span></p>
     114
     115<p class=MsoListParagraphCxSpLast style='margin-bottom:0cm;margin-bottom:.0001pt;
     116text-indent:-18.0pt'><span style='font-family:Wingdings;color:#595959'>v<span
     117style='font:7.0pt "Times New Roman"'>&nbsp; </span></span><span
     118style='color:#595959'>Add a  <b>“,”(coma)</b> after the line </span></p>
     119
     120<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     121style='color:#595959'> </span></p>
     122
     123<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     124style='color:#595959'>6. Check if the    </span></p>
     125
     126<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span
     127style='color:#595959'>“&lt;?module_name?&gt; = Storage( \n” </span></b><span
     128style='color:#595959'>has a “#” in the same line then turn </span></p>
     129
     130<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     131style='color:#595959'>module[module_name] ( variable in layout.py in modules
     132)   off .</span></p>
     133
     134<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     135style='color:#595959'> </span></p>
     136
     137<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     138style='color:#595959'>7<b>.</b>Remove “#” from there till the line you get <b>“#),”
     139</b></span></p>
     140
     141<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>----------------------------------------------------------------------------------------------------------------------------------------------------------</p>
     142
     143}}}
     144       Handling database conflicts
     145There should be a list that will keep a list of databse_name and database_types of 2 eden application cannot be same at same time therefore a list of database types and databse names  needs to be made
     146
     147       For this we will first have to generate a list paths .We can search for “Copyright: 2010 (c) Sahana Software Foundation” in all the LICENSE files of applications.
     148 
     149Then we will have to search in the list of paths for specific keywords like “deployment_setting.database.database” This can be done using regex command in grep
     150
     151If  path(variable) is in the list of paths containing:
     152    Command_line = “grep ” +  “deployment_setting.database.database” + “path”
     153    Line = subprocess.Popen(command_line);
     154
     155Now search the file for deployment_settings.database.db_type .These list will help in validating for the database values.
     156 
     157
     158