# HG changeset patch # User Marcin Kuzminski # Date 2013-05-19 18:55:40 # Node ID c5dd289ca96e1a19c432d96a8d86d7935eb3037b # Parent 5a7d52cf084d89ff52475b56a50faad9512dddd1 lazy load pygments lib so we can use VCS without it installed diff --git a/rhodecode/lib/vcs/nodes.py b/rhodecode/lib/vcs/nodes.py --- a/rhodecode/lib/vcs/nodes.py +++ b/rhodecode/lib/vcs/nodes.py @@ -13,8 +13,6 @@ import stat import posixpath import mimetypes -from pygments import lexers - from rhodecode.lib.vcs.backends.base import EmptyChangeset from rhodecode.lib.vcs.exceptions import NodeError, RemovedFileNodeError from rhodecode.lib.vcs.utils.lazy import LazyProperty @@ -360,7 +358,7 @@ class FileNode(Node): Returns pygment's lexer class. Would try to guess lexer taking file's content, name and mimetype. """ - + from pygments import lexers try: lexer = lexers.guess_lexer_for_filename(self.name, self.content, stripnl=False) except lexers.ClassNotFound: