summaryrefslogtreecommitdiff
path: root/src/configuration/Appconfig.py
blob: 0d3e0346dba8362933abb4485eb9443a3affc90b (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
#===============================================================================
#
#          FILE: Appconfig.py
# 
#         USAGE: --- 
# 
#   DESCRIPTION: This define all configuration used in Application. 
# 
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Fahim Khan, fahim.elex@gmail.com
#  ORGANIZATION: eSim team at FOSSEE, IIT Bombay.
#       CREATED: Wednesday 04 February 2015 
#      REVISION:  ---
#===============================================================================


from PyQt4 import QtGui
import os
import json


class Appconfig(QtGui.QWidget):
        """
        All configuration goes here.
        May change in future for code optimization.
        """
        
        #Home directory
        home = os.path.join(os.path.expanduser("~"),"eSim-Workspace")
        default_workspace = {"workspace":home}
        #Current Project detail
        current_project = {"ProjectName":None}
        #Current Subcircuit detail
        current_subcircuit = {"SubcircuitName":None}
        #Workspace detail
        workspace_text = '''eSim stores your project in a folder called a eSim-Workspace. You can choose a different workspace folder to use for this session.'''
        procThread_list = []
        dictPath = os.path.join(os.path.expanduser("~"), ".projectExplorer.txt")
        noteArea = {}
        try:
            project_explorer = json.load(open(dictPath))
        except:
            project_explorer= {}
        process_obj = []
        
        def __init__(self):
            super(Appconfig, self).__init__()
            #Application Details
            self._APPLICATION = 'eSim'
            self._VERSION = 'v1.1'
            self._AUTHOR = 'Fahim'
        
            #Application geometry setting
            self._app_xpos = 100
            self._app_ypos = 100
            self._app_width = 600
            self._app_heigth = 400
            
         
        def print_info(self, str):
            
            self.noteArea['Note'].append('[INFO]: ' + str)
            
            
        def print_warning(self, str):
            
            self.noteArea['Note'].append('[WARNING]: ' + str)
           
            
        def print_error(self, str):
             
            self.noteArea['Note'].append('[ERROR]: ' + str)