summaryrefslogtreecommitdiff
blob: 202c47a9c74f07db73b649fb4b31257eb296dec3 (plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
 bkchem/bkchem.py | 24 +++++++++++++-----------
 setup.py         | 23 -----------------------
 2 files changed, 13 insertions(+), 34 deletions(-)

diff --git a/bkchem/bkchem.py b/bkchem/bkchem.py
index b336b9c..bcb68b0 100644
--- a/bkchem/bkchem.py
+++ b/bkchem/bkchem.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python2
 #--------------------------------------------------------------------------
 #     This file is part of BKChem - a chemical drawing program
 #     Copyright (C) 2002-2009 Beda Kosata <beda@zirael.org>
@@ -18,18 +19,19 @@
 #--------------------------------------------------------------------------
 
 
-"""this is just a starter of the application"""
+#"""this is just a starter of the application"""
 
 ## support for loading from outside of bkchem dir
 
-import os_support, sys
+from bkchem import os_support
+import sys
 sys.path.insert( 1, os_support.get_module_path())
 
 
 ### now starting for real
 
-from singleton_store import Store
-import pref_manager
+from bkchem.singleton_store import Store
+from bkchem import pref_manager
 
 # at first preference manager
 Store.pm = pref_manager.pref_manager(
@@ -78,13 +80,13 @@ else:
 
 
 
-import config
+from bkchem import config
 
 if not config.debug:
   # checking of important modules availability
   # import modules
-  import import_checker
-  import messages
+  from bkchem import import_checker
+  from bkchem import messages
 
   # we need sets from the 2.3 version
   if not import_checker.python_version_ok:
@@ -103,16 +105,16 @@ if not config.debug:
 
   
 #import Tkinter
-from main import BKChem
-from splash import Splash
-from singleton_store import Store
+from bkchem.main import BKChem
+from bkchem.splash import Splash
+from bkchem.singleton_store import Store
 
 myapp = BKChem()
 myapp.withdraw()
 
 if __name__ == '__main__':
 
-  import messages
+  from bkchem import messages
   enc = sys.getfilesystemencoding()
   if not enc:
     enc = sys.getdefaultencoding()
diff --git a/setup.py b/setup.py
index d4b2a21..2319216 100755
--- a/setup.py
+++ b/setup.py
@@ -91,26 +91,3 @@ if len( sys.argv) > 1 and sys.argv[1] == 'install' and '--help' not in sys.argv:
   print "file %s created" % config_name
 
 
-  # the executable
-  if not os.path.isdir( bin_dir):
-    try:
-      os.mkdir( bin_dir)
-    except:
-      print "ERROR: could not create directory %s" % bin_dir
-      sys.exit( 201)      
-  exec_name = os.path.join( bin_dir, 'bkchem')
-  try:
-    file = open( exec_name, 'w')
-  except:
-    print "ERROR: couldn't open the file %s for write" %  exec_name
-    sys.exit( 201)
-  file.write( "#!/bin/sh\n")
-  file.write( 'python %s "$@"\n' % strip_path( os.path.join( py_dir, "bkchem", "bkchem.py")))
-  file.close()
-  print "file %s created" % exec_name
-  try:
-    os.chmod( os.path.join( bin_dir, 'bkchem'), 5+5*8+7*8*8)
-  except:
-    print "ERROR: failed to make %s executable" % exec_name
-    sys.exit( 201)
-  print "file %s made executable" % exec_name