Right. What were you looking to do with this file? Are you comfortable debugging Python web applications?
Christian -- Christian Hammond - [email protected] Review Board - https://www.reviewboard.org Beanbag, Inc. - https://www.beanbaginc.com On Sat, Nov 14, 2015 at 11:50 PM, Wesly Chen <[email protected]> wrote: > On my review board system, it is in > /usr/lib/python2.6/site-packages/ReviewBoard-2.0.20-py2.6.egg/reviewboard/diffviewer/chunk_generator.py > (not in diffutils.py) > ------- > (started with line 219) > if self._get_enable_syntax_highlighting(old, new, a, b): > repository = self.filediff.diffset.repository > tool = repository.get_scmtool() > source_file = \ > tool.normalize_path_for_display(self.filediff.source_file) > dest_file = \ > tool.normalize_path_for_display(self.filediff.dest_file) > > try: > # TODO: Try to figure out the right lexer for these files > # once instead of twice. > if not source_file.endswith(self.STYLED_EXT_BLACKLIST): > markup_a = self._apply_pygments(old or '', source_file) > > if not dest_file.endswith(self.STYLED_EXT_BLACKLIST): > markup_b = self._apply_pygments(new or '', dest_file) > except: > pass > ... > (line 646) > def _apply_pygments(self, data, filename): > """Applies Pygments syntax-highlighting to a file's contents. > > The resulting HTML will be returned as a list of lines. > """ > lexer = get_lexer_for_filename(filename, > stripnl=False, > encoding='utf-8') > lexer.add_filter('codetagify') > > return split_line_endings( > highlight(data, lexer, NoWrapperHtmlFormatter())) > ------------------- > > Christian Hammond於 2015年11月14日星期六 UTC-8下午11時36分59秒寫道: >> >> It's in reviewboard/diffviewer/diffutils.py. Look for apply_pygments. >> >> Christian >> >> -- >> Christian Hammond - [email protected] >> Review Board - https://www.reviewboard.org >> Beanbag, Inc. - https://www.beanbaginc.com >> >> On Sat, Nov 14, 2015 at 11:35 PM, Wesly Chen <[email protected]> wrote: >> >>> Could you point out which python files under >>> >>> /usr/lib/python2.6/site-packages/ReviewBoard-2.0.20-py2.6.egg/reviewboard/ >>> is showing the syntax highlighting in Diff Viewer? >>> >>> Thanks, >>> >>> Wesly >>> >>> Christian Hammond於 2015年11月14日星期六 UTC-8下午11時09分49秒寫道: >>>> >>>> There's no file or configuration to check. This stuff is built to work >>>> in Review Board. The only option I can offer right now is to check a file >>>> that's having problems on our end to see if it's a regression in Review >>>> Board. >>>> >>>> Christian >>>> >>>> -- >>>> Christian Hammond - [email protected] >>>> Review Board - https://www.reviewboard.org >>>> Beanbag, Inc. - https://www.beanbaginc.com >>>> >>>> On Sat, Nov 14, 2015 at 11:08 PM, Wesly Chen <[email protected]> >>>> wrote: >>>> >>>>> Here is the python modules on the system. Which file I should check >>>>> for the configuration? I'm not familiar with python. >>>>> >>>>> # ls -lg /usr/lib/python2.6/site-packages/*ygment* >>>>> /usr/lib/python2.6/site-packages/pygments: >>>>> total 1080 >>>>> -rw-r--r-- 1 root 13055 Sep 15 2009 cmdline.py >>>>> -rw-r--r-- 2 root 10443 Aug 16 2010 cmdline.pyc >>>>> -rw-r--r-- 2 root 10443 Aug 16 2010 cmdline.pyo >>>>> -rw-r--r-- 1 root 1850 Sep 15 2009 console.py >>>>> -rw-r--r-- 2 root 2340 Aug 16 2010 console.pyc >>>>> -rw-r--r-- 2 root 2340 Aug 16 2010 console.pyo >>>>> -rw-r--r-- 1 root 2071 Sep 15 2009 filter.py >>>>> -rw-r--r-- 2 root 3184 Aug 16 2010 filter.pyc >>>>> -rw-r--r-- 2 root 3184 Aug 16 2010 filter.pyo >>>>> drwxr-xr-x 2 root 4096 Aug 12 23:28 filters >>>>> -rw-r--r-- 1 root 2790 Sep 15 2009 formatter.py >>>>> -rw-r--r-- 2 root 3344 Aug 16 2010 formatter.pyc >>>>> -rw-r--r-- 2 root 3344 Aug 16 2010 formatter.pyo >>>>> drwxr-xr-x 2 root 4096 Aug 12 23:28 formatters >>>>> -rw-r--r-- 1 root 2935 Sep 15 2009 __init__.py >>>>> -rw-r--r-- 2 root 3334 Aug 16 2010 __init__.pyc >>>>> -rw-r--r-- 2 root 3334 Aug 16 2010 __init__.pyo >>>>> -rw-r--r-- 1 root 22625 Sep 15 2009 lexer.py >>>>> -rw-r--r-- 1 root 20971 Aug 16 2010 lexer.pyc >>>>> -rw-r--r-- 1 root 20204 Aug 16 2010 lexer.pyo >>>>> drwxr-xr-x 2 root 4096 Aug 12 23:28 lexers >>>>> -rw-r--r-- 1 root 1862 Sep 15 2009 plugin.py >>>>> -rw-r--r-- 2 root 2373 Aug 16 2010 plugin.pyc >>>>> -rw-r--r-- 2 root 2373 Aug 16 2010 plugin.pyo >>>>> -rw-r--r-- 1 root 3114 Sep 15 2009 scanner.py >>>>> -rw-r--r-- 2 root 4174 Aug 16 2010 scanner.pyc >>>>> -rw-r--r-- 2 root 4174 Aug 16 2010 scanner.pyo >>>>> -rw-r--r-- 1 root 3745 Sep 15 2009 style.py >>>>> -rw-r--r-- 1 root 3943 Aug 16 2010 style.pyc >>>>> -rw-r--r-- 1 root 3867 Aug 16 2010 style.pyo >>>>> drwxr-xr-x 2 root 4096 Aug 12 23:28 styles >>>>> -rw-r--r-- 1 root 5784 Sep 15 2009 token.py >>>>> -rw-r--r-- 2 root 5408 Aug 16 2010 token.pyc >>>>> -rw-r--r-- 2 root 5408 Aug 16 2010 token.pyo >>>>> -rw-r--r-- 1 root 404249 Sep 15 2009 unistring.py >>>>> -rw-r--r-- 2 root 208515 Aug 16 2010 unistring.pyc >>>>> -rw-r--r-- 2 root 208515 Aug 16 2010 unistring.pyo >>>>> -rw-r--r-- 1 root 6431 Sep 15 2009 util.py >>>>> -rw-r--r-- 2 root 7706 Aug 16 2010 util.pyc >>>>> -rw-r--r-- 2 root 7706 Aug 16 2010 util.pyo >>>>> >>>>> /usr/lib/python2.6/site-packages/Pygments-1.1.1-py2.6.egg-info: >>>>> total 24 >>>>> -rw-r--r-- 1 root 1 Aug 16 2010 dependency_links.txt >>>>> -rw-r--r-- 1 root 1 Feb 6 2009 not-zip-safe >>>>> -rw-r--r-- 1 root 1831 Aug 16 2010 PKG-INFO >>>>> -rw-r--r-- 1 root 7520 Aug 16 2010 SOURCES.txt >>>>> -rw-r--r-- 1 root 9 Aug 16 2010 top_level.txt >>>>> >>>>> /usr/lib/python2.6/site-packages/Pygments-2.0.2-py2.6.egg: >>>>> total 8 >>>>> drwxr-xr-x 2 root 4096 Oct 8 23:54 EGG-INFO >>>>> drwxr-xr-x 6 root 4096 Oct 8 23:54 pygments >>>>> >>>>> >> -- > Supercharge your Review Board with Power Pack: > https://www.reviewboard.org/powerpack/ > Want us to host Review Board for you? Check out RBCommons: > https://rbcommons.com/ > Happy user? Let us know! https://www.reviewboard.org/users/ > --- > You received this message because you are subscribed to the Google Groups > "reviewboard" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > > For more options, visit https://groups.google.com/d/optout. > -- Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/ Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/ Happy user? Let us know! https://www.reviewboard.org/users/ --- You received this message because you are subscribed to the Google Groups "reviewboard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
