From 49a797dd544d8f1a355a3c452f7fdef6d7c0d040 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Tue, 30 Nov 2010 11:41:14 +0100
Subject: [PATCH] rename GnuPG.py to gpg.py. Fixes #6055

---
 src/common/connection.py        | 8 ++++----
 src/common/{GnuPG.py => gpg.py} | 7 +++----
 src/config.py                   | 4 ++--
 3 files changed, 9 insertions(+), 10 deletions(-)
 rename src/common/{GnuPG.py => gpg.py} (98%)

diff --git a/src/common/connection.py b/src/common/connection.py
index 83acc9fc6..4b5a16986 100644
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -54,7 +54,7 @@ if os.name != 'nt':
 import common.xmpp
 from common import helpers
 from common import gajim
-from common import GnuPG
+from common import gpg
 from common import passwords
 from common import exceptions
 
@@ -123,7 +123,7 @@ class CommonConnection:
         self.USE_GPG = False
         if gajim.HAVE_GPG:
             self.USE_GPG = True
-            self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
+            self.gpg = gpg.GnuPG(gajim.config.get('use_gpg_agent'))
         self.status = ''
         self.old_show = ''
         self.priority = gajim.get_priority(name, 'offline')
@@ -633,7 +633,7 @@ class CommonConnection:
             self.server_resource = self._compute_resource()
             if gajim.HAVE_GPG:
                 self.USE_GPG = True
-                self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
+                self.gpg = gpg.GnuPG(gajim.config.get('use_gpg_agent'))
             self.connect_and_init(show, msg, sign_msg)
             return
 
@@ -853,7 +853,7 @@ class Connection(CommonConnection, ConnectionHandlers):
                                 return
                             if gajim.HAVE_GPG:
                                 self.USE_GPG = True
-                                self.gpg = GnuPG.GnuPG(gajim.config.get(
+                                self.gpg = gpg.GnuPG(gajim.config.get(
                                         'use_gpg_agent'))
                             gajim.nec.push_incoming_event(
                                 AccountCreatedEvent(None, conn=self,
diff --git a/src/common/GnuPG.py b/src/common/gpg.py
similarity index 98%
rename from src/common/GnuPG.py
rename to src/common/gpg.py
index d029b8a5c..81272569e 100644
--- a/src/common/GnuPG.py
+++ b/src/common/gpg.py
@@ -1,4 +1,4 @@
-## src/common/GnuPG.py
+## src/common/gpg.py
 ##
 ## Copyright (C) 2003-2010 Yann Leboulanger <asterix AT lagaule.org>
 ## Copyright (C) 2005 Alex Mauer <hawke AT hawkesnest.net>
@@ -22,11 +22,10 @@
 ## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
 ##
 
-import gajim
+from gajim import HAVE_GPG
 import os
-from os import tmpfile
 
-if gajim.HAVE_GPG:
+if HAVE_GPG:
     import gnupg
 
     class GnuPG(gnupg.GPG):
diff --git a/src/config.py b/src/config.py
index 1493a7ba2..c283c2506 100644
--- a/src/config.py
+++ b/src/config.py
@@ -57,7 +57,7 @@ from common import connection
 from common import passwords
 from common.zeroconf import connection_zeroconf
 from common import dataforms
-from common import GnuPG
+from common import gpg
 from common import ged
 
 try:
@@ -2335,7 +2335,7 @@ class AccountsWindow:
         # self.current_account is None and/or gajim.connections is {}
         else:
             if gajim.HAVE_GPG:
-                secret_keys = GnuPG.GnuPG().get_secret_keys()
+                secret_keys = gpg.GnuPG().get_secret_keys()
             else:
                 secret_keys = []
         if not secret_keys: