Subversion Repositories basico

Rev

Rev 4 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4 Rev 74
Line 10... Line 10...
10
from gi.repository import Gio
10
from gi.repository import Gio
11
from gi.repository import Pango
11
from gi.repository import Pango
12
from gi.repository.GdkPixbuf import Pixbuf
12
from gi.repository.GdkPixbuf import Pixbuf
13
13
14
from .service import Service
14
from .service import Service
-
 
15
-
 
16
# Default settings for SAP module
-
 
17
LOGIN_PAGE_URL = "https://accounts.sap.com"
-
 
18
LOGOUT_PAGE_URL = "https://accounts.sap.com/ui/logout"
-
 
19
ODATA_NOTE_URL = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='E')" #$expand=LongText" #?$expand=LongText,RefTo,RefBy"
-
 
20
SAP_NOTE_URL = "https://launchpad.support.sap.com/#/notes/%s"
-
 
21
SAP_NOTE_URL_PDF = "https://launchpad.support.sap.com/services/pdf/notes/%s/E"
-
 
22
TIMEOUT = 5
-
 
23
15
24
16
class Settings(Service):
25
class Settings(Service):
17
    def initialize(self):
26
    def initialize(self):
18
        #~ self.gui = self.app.get_service('GUI')
-
 
19
        #~ sapnoteview = self.gui.get_widget('sapnoteview')
-
 
20
        view = self.get_config_value('View')
27
        view = self.get_config_value('View')
21
        #~ sapnoteview.set_view(view)
-
 
-
 
28
        self.log.debug("View: %s" % view)
-
 
29
-
 
30
    def get_default_settings(self):
-
 
31
        settings = {}
-
 
32
        # Deprecated as Basico uses now login with SAP Passport
-
 
33
        #~ settings['CNF_SAP_SUser'] = 'SXXXXXXXXXX'
-
 
34
        #~ settings['CNF_SAP_SPass'] = 'MyP455w0rD'
-
 
35
        utils = self.get_service('Utils')
-
 
36
        settings['CNF_SAP_LOGIN'] = LOGIN_PAGE_URL
-
 
37
        settings['CNF_SAP_LOGOUT'] = LOGOUT_PAGE_URL
-
 
38
        settings['CNF_SAP_ODATA_NOTES'] = ODATA_NOTE_URL
-
 
39
        settings['CNF_SAP_NOTE_URL'] = SAP_NOTE_URL
-
 
40
        settings['CNF_SAP_CONN_TIMEOUT'] = TIMEOUT
-
 
41
        settings['CNF_FF_PROFILE_DIR'] = utils.get_firefox_profile_dir()
-
 
42
-
 
43
        return settings
-
 
44
-
 
45
-
 
46
    def get_custom_settings(self):
-
 
47
        sap = self.get_service('SAP')
-
 
48
        utils = self.get_service('Utils')
-
 
49
-
 
50
        settings = {}
-
 
51
        settings['CNF_SAP_LOGIN'] = sap.get_config_value('CNF_SAP_LOGIN')
-
 
52
        settings['CNF_SAP_LOGOUT'] = sap.get_config_value('CNF_SAP_LOGOUT')
-
 
53
        settings['CNF_SAP_ODATA_NOTES'] = sap.get_config_value('CNF_SAP_ODATA_NOTES')
-
 
54
        settings['CNF_SAP_NOTE_URL'] = sap.get_config_value('CNF_SAP_NOTE_URL')
-
 
55
        settings['CNF_SAP_CONN_TIMEOUT'] = sap.get_config_value('CNF_SAP_CONN_TIMEOUT')
-
 
56
        settings['CNF_FF_PROFILE_DIR'] = sap.get_config_value('CNF_FF_PROFILE_DIR')
-
 
57
-
 
58
        return settings