James Kassemi wrote:
> Hello everyone,
> 
> I'm writing a paster plugin with PasteScript, and I'm running into a
> few issues with the filemaker FileOp class.
> 
> The following code produces no interactive prompts when attempting to
> copy over an existing file that contains different content. In fact,
> messages state that the content has not changed. The only way to force
> the newly rendered template data to be written to the destination file
> is to manually delete the existing destination file.
> 
>     source_dir = os.path.join(os.path.dirname(__file__), 'templates')
>     application_dir = find_my_application_root_directory()
> 
>     file_op = FileOp(source_dir=source_dir)
>     file_op.copy_file('crud/controller.py_tmpl',
>              dest=os.path.join(application_dir, 'controllers'),
>              template_renderer=paste_script_template_renderer)
> 
> The load_content method seems to load the data from the destination
> file without rendering the template if the destination file already
> exists. Shouldn't the behavior of this method be to simply return the
> rendered template data?
> 
> This is my first foray into the PasteScript plugin world, so I'd like
> to make sure I'm approaching this operation correctly before I begin
> filing bug reports.
> 
> Also, What's the current plan for the copy_dir method? Is it going to
> be removed, or will it begin to implement the functionality of the
> copydir.py module? I would be more than happy to implement this
> functionality if it's needed and nobody else has plans with it.

Well, right now you can do most of these operations using the Command 
instance, which has methods like ensure_file, etc.  But it specifically 
doesn't have copy commands, which is a bit of a problem.  And the 
copydir modules, as you've noticed, is too separate and itself has lots 
of functionality.

I'm not really sure what the future of the filemaker module will/should 
be.  I've moved the code into fassembler 
(https://svn.openplans.org/svn/fassembler/trunk/fassembler/filemaker.py) 
and that code is more complete and less buggy.  But it's also a bit tied 
to fassembler.


-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to