1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
From a0c44eac2a152291e2ce04bb7c320da896c77af2 Mon Sep 17 00:00:00 2001
From: Christian Ruppert <idl0r@gentoo.org>
Date: Tue, 26 Feb 2013 22:59:21 +0100
Subject: [PATCH] Fix BeautifulSoup import
Signed-off-by: Christian Ruppert <idl0r@gentoo.org>
---
Nagstamon/Nagstamon/Server/Ninja.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Nagstamon/Nagstamon/Server/Ninja.py b/Nagstamon/Nagstamon/Server/Ninja.py
index dd53cbe..4cee123 100644
--- a/Nagstamon/Nagstamon/Server/Ninja.py
+++ b/Nagstamon/Nagstamon/Server/Ninja.py
@@ -13,7 +13,7 @@ import cookielib
from Nagstamon import Actions
from Nagstamon.Objects import *
from Nagstamon.Server.Generic import GenericServer, not_empty
-from Nagstamon.BeautifulSoup import BeautifulSoup
+from BeautifulSoup import BeautifulSoup
class NinjaServer(GenericServer):
"""
--
1.7.12.4
diff --git a/Nagstamon/nagstamon.py b/Nagstamon/nagstamon.py
index 2206db5..66da87e 100755
--- a/Nagstamon/nagstamon.py
+++ b/Nagstamon/nagstamon.py
@@ -33,40 +33,7 @@ conf.Convert_Conf_to_Multiple_Servers()
conf.Convert_Conf_to_Custom_Actions()
# try to get resources path if nagstamon got be installed by setup.py
-Resources = ""
-try:
- import pkg_resources
- Resources = pkg_resources.resource_filename("Nagstamon", "resources")
-except Exception, err:
- # get resources directory from current directory - only if not being set before by pkg_resources
- # try-excepts necessary for platforms like Windows .EXE
- join = os.path.join
- normcase = os.path.normcase
- paths_to_check = [normcase(join(os.getcwd(), "Nagstamon", "resources")),
- normcase(join(os.getcwd(), "resources"))]
- try:
- # if resources dir is not available in CWD, try the
- # libs dir (site-packages) for the current Python
- from distutils.sysconfig import get_python_lib
- paths_to_check.append(normcase(join(get_python_lib(), "Nagstamon", "resources")))
- except:
- pass
-
- #if we're still out of luck, maybe this was a user scheme install
- try:
- import site
- site.getusersitepackages() #make sure USER_SITE is set
- paths_to_check.append(normcase(join(site.USER_SITE, "Nagstamon", "resources")))
- except:
- pass
-
- # add directory nagstamon.py where nagstamon.py resides for cases like 0install without installed pkg-resources
- paths_to_check.append(os.sep.join(sys.argv[0].split(os.sep)[:-1] + ["Nagstamon", "resources"]))
-
- for path in paths_to_check:
- if os.path.exists(path):
- Resources = path
- break
+Resources = "/usr/share/nagstamon/resources"
# initialize GUI and actions
# if modules are not available from central python install try the ones in the same directory
|