Aha! Of course.  Your patch program just isn't converting the newlines
from LF to CRLF and thus is getting confused.  Use a program like
unix2dos to convert the patch files.  Or if you have perl installed
you can perl -pi -e 's/\n/\r\n/g' trac-0.10.3-report-plugin.patch

On 11/2/07, Andrew <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> To install Trac I use method 3 on this page; 
> http://trac.edgewall.org/wiki/TracOnWindows.
> I don't install Subversion and I download the Trac installer
> (trac-0.10.3.win32.exe) from http://ftp.edgewall.com/pub/trac/, the
> link on the page points to version 0.10. I hope that answers your
> question about where I get the source code from.
>
> Here's the report.py.rej file:
>
> ***************
> *** 32,37 ****
>   from trac.web.chrome import add_link, add_stylesheet,
> INavigationContributor
>   from trac.wiki import wiki_to_html, IWikiSyntaxProvider, Formatter
>
>   class ReportModule(Component):
>
>       implements(INavigationContributor, IPermissionRequestor,
> IRequestHandler,
> --- 32,57 ----
>   from trac.web.chrome import add_link, add_stylesheet,
> INavigationContributor
>   from trac.wiki import wiki_to_html, IWikiSyntaxProvider, Formatter
>
> + class ITicketReportRenderer(Interface):
> +     """Extension point interface for components that implement new
> report
> +     writing formats."""
> +
> +     def get_report_format():
> +         """Called to get the id for a report format, for
> example: .xls"""
> +
> +       def get_report_mimetype():
> +               """Called to get the mimetype string for a report format"""
> +
> +       def get_report_linkname():
> +               """Called to get the report link name that will appear on the
> UI"""
> +
> +       def get_report_linkclass():
> +               """Called to get the class of the link that will appear on the
> UI"""
> +
> +       def render(req, cols, rows):
> +               """Render the report, takes the request, columns and rows"""
> +
> +
>   class ReportModule(Component):
>
>       implements(INavigationContributor, IPermissionRequestor,
> IRequestHandler,
> ***************
> *** 111,116 ****
>           add_stylesheet(req, 'common/css/report.css')
>           return 'report.cs', None
>
>       # Internal methods
>
>       def _do_create(self, req, db):
> --- 131,138 ----
>           add_stylesheet(req, 'common/css/report.css')
>           return 'report.cs', None
>
> +     renderers = ExtensionPoint(ITicketReportRenderer)
> +
>       # Internal methods
>
>       def _do_create(self, req, db):
> ***************
> *** 364,370 ****
>           elif format == 'tab':
>               self._render_csv(req, cols, rows, '\t')
>               return None
> -
>           return 'report.cs', None
>
>       def add_alternate_links(self, req, args):
> --- 386,397 ----
>           elif format == 'tab':
>               self._render_csv(req, cols, rows, '\t')
>               return None
> +         else:
> +               for renderer in self.renderers:
> +                       if renderer.get_report_format()==format:
> +                               renderer.render(req,cols,rows)
> +                               return None
> +
>           return 'report.cs', None
>
>       def add_alternate_links(self, req, args):
> ***************
> *** 385,390 ****
>           if req.perm.has_permission('REPORT_SQL_VIEW'):
>               add_link(req, 'alternate', '?format=sql', 'SQL Query',
>                        'text/plain')
>
>       def execute_report(self, req, db, id, sql, args):
>           sql, args = self.sql_sub_vars(req, sql, args, db)
> --- 412,430 ----
>           if req.perm.has_permission('REPORT_SQL_VIEW'):
>               add_link(req, 'alternate', '?format=sql', 'SQL Query',
>                        'text/plain')
> +
> +         # add link for every loaded component
> +         # that implements ITicketReportRenderer
> +
> +         for renderer in self.renderers:
> +                       format = renderer.get_report_format()
> +                       mimetype = renderer.get_report_mimetype()
> +                       linkname = renderer.get_report_linkname()
> +                       linkclass = renderer.get_report_linkclass()
> +
> +                       add_link(req,'alternate','?format='+format+href,
> +                        linkname,mimetype,linkclass)
> +
>
>       def execute_report(self, req, db, id, sql, args):
>           sql, args = self.sql_sub_vars(req, sql, args, db)
>
>
> I've installed Cygwin to see if I would be able to apply the patches
> using that, but I get the same error message.
>
> On 2 Nov, 13:47, "Erik Bray" <[EMAIL PROTECTED]> wrote:
> > Hrm.  Could you post the rejects file that gets generated at
> > trac/ticket/report.py.rej ?  Also, where are you obtaining the source
> > code from?  Directly from t.e.o or some other source?  The commands
> > you ran look correct, so I'm not sure what you could be doing
> > wrong...maybe it's a Windows thing.
> >
> > On 11/2/07, Andrew <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> > > Hi Erik,
> >
> > > I installed Trac on a clean system and tried applying the report patch
> > > like you did, I still get the same error. I must be doing something
> > > wrong, I'm just not sure what...
> >
> > > Thanks
> >
> > > On 1 Nov, 16:06, "Erik Bray" <[EMAIL PROTECTED]> wrote:
> > > > On 11/1/07, Andrew <[EMAIL PROTECTED]> wrote:
> >
> > > > > Hi Erik,
> >
> > > > > Thanks for replying. I'm running Trac 0.10.3, so the report plugin
> > > > > should work. The no notify patch is for 0.10.4, I was more hopeful
> > > > > that the patch would apply.
> >
> > > > I tried out the report patch on a fresh checkout of 0.10.3 and had no
> > > > problems.  So either you're not using the final version of 0.10.3, or
> > > > it has other modifications already that conflict with the patch.  If
> > > > you check the rejects file you
> >
> > > > Erik- Hide quoted text -
> >
> > - Show quoted text -
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to