On Tue, Jan 13, 2009 at 9:53 PM, Abdul Halim <[email protected]> wrote:

> Steve. How about this patch?
> Me still trying to get rid of copy and paste.. :-)
>
> # HG changeset patch
> # User halim <[email protected]>
> # Date 1231904814 -28800
> # Node ID 357c17dcf551e2afdb395076663c25d0ef7e3ad2
> # Parent  7335932c6d07feef59e112bd8d3919de21f3de5a
> nautilus: fix import hggtk.hglib error if run from home directory
>
> diff -r 7335932c6d07 -r 357c17dcf551 contrib/nautilus-thg.py
> --- a/contrib/nautilus-thg.py   Tue Jan 13 14:54:56 2009 +0800
> +++ b/contrib/nautilus-thg.py   Wed Jan 14 11:46:54 2009 +0800
> @@ -21,7 +21,11 @@
>  import tempfile
>  import time
>  import urllib
> -from hggtk.hglib import displaytime
> +
> +try:
> +    from hggtk.hglib import displaytime
> +except ImportError:
> +    from ~/tools/tortoisehg-dev/hggtk.hglib import displaytime
>
>  TORTOISEHG_PATH = '~/tools/tortoisehg-dev'
>  TERMINAL_KEY = '/desktop/gnome/applications/terminal/exec'
>


Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ~/tools/tortoisehg-dev/hggtk.hglib import displaytime
  File "<stdin>", line 1
    from ~/tools/tortoisehg-dev/hggtk.hglib import displaytime
         ^
SyntaxError: invalid syntax
>>>

Hint:
Take a look at contrib/hgtk about line 115, then apply that to
nautilus-thg.py
around line 41.  Then do the import.

--
Steve
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to