Try this:

scripts/import_static.py

I just committed it to trunk. Usage:

python scripts/import_static.py source_folder applications/web2py_app



On Tuesday, 6 August 2013 08:05:24 UTC-5, tim spear wrote:
>
> Hi Massimo, if you are still reading this stuff.
>
> I've been playing with web2py and was thinking it was missing an easy way 
> to import static sites and was thinking of writing one similar to your 
> proposed challenge. 
>
> Do you know if anyone did produce a functional solution? I see this thread 
> is from nearly three years ago and am not sure what the current state of 
> play is.
>
> Best, Tim Spear
>
>
>
>
> On Wednesday, November 24, 2010 8:05:21 PM UTC, mdipierro wrote:
>>
>> I have a challanage: 
>>
>> write a script that takes a folder that contains a static html file 
>> and converts it into an HTML site. 
>>
>> 1) moves all non .html files into static/ 
>> 2) moves all .html files into views/xxx/ 
>> 3) creates a controllers/xxx.py and for each yyy.html file add an 
>> action 
>>
>> def yyy(): return dict() 
>>
>> 4) loop over all .html files and fixes all the URL to {{=URL(...)}}} 
>>
>> OPTIONAL: 
>> 5) 
>> If all .html files start with a similar header and footer, tried to 
>> identify them, moves "<header>{{include}}<footer>" into views/ 
>> layout.html and rewrite the html files to {{extend 'layout.html'}} 
>>
>> The original folder and 'xxx' should be uer defined. This could be 
>> added to the wizard. 
>>
>> Massimo
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to