Ejemplo n.º 1
0
def get_global_ignore():
    v = GLOBAL_IGNORES
    if wx.Platform == '__WXMSW__':
        from modules import winreg
        try:
            _key = winreg.Key(winreg.HKCU, r'Software\Tigris.org\Subversion\Config')
            if 'miscellany' not in _key:
                key = _key.add('miscellany')
            else:
                key = _key['miscellany']
        except:
            common.warn(tr("Maybe your subversion doesn't be installed or installed uncorrectly."))
            raise
        if 'global-ignores' in key.values:
            v = key.values['global-ignores'].getvalue()
    
    else:
        path = os.path.join(common.getHomeDir(), '.subversion')
        if os.path.exists(path):
            config = os.path.join(path, 'config')
            servers = os.path.join(path, 'servers')
            if os.path.exists(config) and os.path.exists(servers):
                ini = dict4ini.DictIni(config, normal=True)
                v = ini.miscellany.get('global-ignores', GLOBAL_IGNORES)
    return v
Ejemplo n.º 2
0
def get_global_ignore():
    v = GLOBAL_IGNORES
    if wx.Platform == '__WXMSW__':
        from modules import winreg
        try:
            _key = winreg.Key(winreg.HKCU,
                              r'Software\Tigris.org\Subversion\Config')
            if 'miscellany' not in _key:
                key = _key.add('miscellany')
            else:
                key = _key['miscellany']
        except:
            common.warn(
                tr("Maybe your subversion doesn't be installed or installed uncorrectly."
                   ))
            raise
        if 'global-ignores' in key.values:
            v = key.values['global-ignores'].getvalue()

    else:
        path = os.path.join(common.getHomeDir(), '.subversion')
        if os.path.exists(path):
            config = os.path.join(path, 'config')
            servers = os.path.join(path, 'servers')
            if os.path.exists(config) and os.path.exists(servers):
                ini = dict4ini.DictIni(config, normal=True)
                v = ini.miscellany.get('global-ignores', GLOBAL_IGNORES)
    return v
Ejemplo n.º 3
0
    def _get_info(self):
        v = {}
        v['proxy'] = False
        v['server'] = self.pref.svn_proxy_server
        v['port'] = self.pref.svn_proxy_port
        v['password'] = self.pref.svn_proxy_password
        v['timeout'] = self.pref.svn_proxy_timeout
        v['username'] = self.pref.svn_proxy_username

        if wx.Platform == '__WXMSW__':
            from modules import winreg
            try:
                _key = winreg.Key(winreg.HKCU, r'Software\Tigris.org\Subversion\Config')
                if 'miscellany' not in _key:
                    key = _key.add('miscellany')
                else:
                    key = _key['miscellany']
            except:
                common.warn(tr("Maybe your subversion doesn't be installed or installed uncorrectly."))
                raise
            if 'global-ignores' in key.values:
                v['svn_global_ignores'] = key.values['global-ignores'].getvalue()
            else:
                key.values.set('global-ignores', GLOBAL_IGNORES)
                v['svn_global_ignores'] = key.values['global-ignores'].getvalue()
            
            try:
                key = winreg.Key(winreg.HKCU, r'Software\Tigris.org\Subversion\Servers\global')
            except:
                common.warn(tr("Maybe your subversion doesn't be installed or installed uncorrectly."))
                raise
            
            if 'http-proxy-host' in key.values:
                v['proxy'] = True
                self.pref.svn_proxy_server = v['server'] = key.values['http-proxy-host'].getvalue()
                self.pref.svn_proxy_port = v['port'] = int(key.values['http-proxy-port'].getvalue())
                self.pref.svn_proxy_password = v['password'] = key.values['http-proxy-password'].getvalue()
                self.pref.svn_proxy_timeout = v['timeout'] = int(key.values['http-proxy-timeout'].getvalue())
                self.pref.svn_proxy_username = v['username'] = key.values['http-proxy-username'].getvalue()
                self.pref.save()
        
        else:
            path = os.path.join(common.getHomeDir(), '.subversion')
            if os.path.exists(path):
                config = os.path.join(path, 'config')
                servers = os.path.join(path, 'servers')
                if os.path.exists(config) and os.path.exists(servers):
                    ini = dict4ini.DictIni(config, normal=True)
                    v['svn_global_ignores'] = ini.miscellany.get('global-ignores', GLOBAL_IGNORES)
                    ini = dict4ini.DictIni(servers, normal=True)
                    if ini['global']:
                        v['proxy'] = True
                        self.pref.svn_proxy_server = v['server'] = ini['global'].get('http-proxy-host', '')
                        self.pref.svn_proxy_port = v['port'] = int(ini['global'].get('http-proxy-port', 0))
                        self.pref.svn_proxy_password = v['password'] = ini['global'].get('http-proxy-password', '')
                        self.pref.svn_proxy_username = v['username'] = ini['global'].get('http-proxy-username', '')
                        self.pref.save()
            
        return v
Ejemplo n.º 4
0
 def _save_info(self):
     v = self.sizer.GetValue()
     self.pref.svn_proxy_server = v['server']
     self.pref.svn_proxy_port = v['port']
     self.pref.svn_proxy_password = v['password']
     self.pref.svn_proxy_username = v['username']
     self.pref.svn_proxy_timeout = v['timeout']
     self.pref.save()
     
     if wx.Platform == '__WXMSW__':
         from modules import winreg
         try:
             _key = winreg.Key(winreg.HKCU, r'Software\Tigris.org\Subversion\Config')
             if 'miscellany' not in _key:
                 key = _key.add('miscellany')
             else:
                 key = _key['miscellany']
         except:
             common.warn(tr("Maybe your subversion doesn't be installed or installed uncorrectly."))
             raise
         key.values.set('global-ignores', v['svn_global_ignores'])
         
         try:
             key = winreg.Key(winreg.HKCU, r'Software\Tigris.org\Subversion\Servers\global')
         except:
             common.warn(tr("Maybe your subversion doesn't be installed or installed uncorrectly."))
             raise
         
         if v['proxy']:
             key.values.set('http-proxy-host', v['server'])
             key.values.set('http-proxy-port', str(v['port']))
             key.values.set('http-proxy-username', v['username'])
             key.values.set('http-proxy-password', v['password'])
             key.values.set('http-proxy-timeout', str(v['timeout']))
         else:
             for i in range(len(key.values)-1, -1, -1):
                 key.values[i].delete()
     else:
         path = os.path.join(common.getHomeDir(), '.subversion')
         if os.path.exists(path):
             config = os.path.join(path, 'config')
             servers = os.path.join(path, 'servers')
             if os.path.exists(config) and os.path.exists(servers):
                 ini = dict4ini.DictIni(config, normal=True)
                 ini.miscellany['global-ignores'] = v['svn_global_ignores']
                 ini.save()
                 ini = dict4ini.DictIni(servers, normal=True)
                 if v['proxy']:
                     ini['global']['http-proxy-host'] = v['server']
                     ini['global']['http-proxy-port'] = v['port']
                     ini['global']['http-proxy-username'] = v['username']
                     ini['global']['http-proxy-password'] = v['password']
                     ini.save()
                 else:
                     ini['global'] = {}
                     ini.save()
         else:
             common.warn(tr("Maybe your subversion doesn't be installed or installed uncorrectly."))
Ejemplo n.º 5
0
    def init(self, showSplash=True, load=True):

        #add modules path to sys.path
        self.workpath = workpath
        self.confpath = confpath
        self.curpath = curpath
        self.i18n = i18n

        self.processCommandLineArguments()

        if self.psycoflag:
            try:
                import psyco
                psyco.full()
            except:
                pass

        #change workpath
        self.userpath = self.workpath
        if self.multiuser:
            self.userpath = common.getHomeDir()

        #set globals variable
        Globals.userpath = self.userpath

        self.CheckPluginDir()

        Mixin.ENABLE = True
        try:
            import plugins
        except:
            Debug.error.traceback()
            common.showerror(
                None, tr('There was something wrong with importing plugins.'))

        #before running gui
        self.callplugin("beforegui", self)

        Mixin.ENABLE = False
        #-----------------------------------------------------------------------------

        if Debug.DEBUG:
            Mixin.printMixin()

        return self.execplugin('getmainframe', self, self.files)
Ejemplo n.º 6
0
    def init(self, showSplash=True, load=True):

        #add modules path to sys.path
        self.workpath = workpath
        self.confpath = confpath
        self.curpath = curpath
        self.i18n = i18n

        self.processCommandLineArguments()

        if self.psycoflag:
            try:
                import psyco
                psyco.full()
            except:
                pass

        #change workpath
        self.userpath = self.workpath
        if self.multiuser:
            self.userpath = common.getHomeDir()

        #set globals variable
        Globals.userpath = self.userpath

        self.CheckPluginDir()

        Mixin.ENABLE = True
        try:
            import plugins
        except:
            Debug.error.traceback()
            common.showerror(None, tr('There was something wrong with importing plugins.'))

        #before running gui
        self.callplugin("beforegui", self)

        Mixin.ENABLE = False
        #-----------------------------------------------------------------------------

        if Debug.DEBUG:
            Mixin.printMixin()

        return self.execplugin('getmainframe', self, self.files)
Ejemplo n.º 7
0
    def _save_info(self):
        v = self.sizer.GetValue()
        self.pref.svn_proxy_server = v['server']
        self.pref.svn_proxy_port = v['port']
        self.pref.svn_proxy_password = v['password']
        self.pref.svn_proxy_username = v['username']
        self.pref.svn_proxy_timeout = v['timeout']
        self.pref.save()

        if wx.Platform == '__WXMSW__':
            from modules import winreg
            try:
                _key = winreg.Key(winreg.HKCU,
                                  r'Software\Tigris.org\Subversion\Config')
                if 'miscellany' not in _key:
                    key = _key.add('miscellany')
                else:
                    key = _key['miscellany']
            except:
                common.warn(
                    tr("Maybe your subversion doesn't be installed or installed uncorrectly."
                       ))
                raise
            key.values.set('global-ignores', v['svn_global_ignores'])

            try:
                key = winreg.Key(
                    winreg.HKCU,
                    r'Software\Tigris.org\Subversion\Servers\global')
            except:
                common.warn(
                    tr("Maybe your subversion doesn't be installed or installed uncorrectly."
                       ))
                raise

            if v['proxy']:
                key.values.set('http-proxy-host', v['server'])
                key.values.set('http-proxy-port', str(v['port']))
                key.values.set('http-proxy-username', v['username'])
                key.values.set('http-proxy-password', v['password'])
                key.values.set('http-proxy-timeout', str(v['timeout']))
            else:
                for i in range(len(key.values) - 1, -1, -1):
                    key.values[i].delete()
        else:
            path = os.path.join(common.getHomeDir(), '.subversion')
            if os.path.exists(path):
                config = os.path.join(path, 'config')
                servers = os.path.join(path, 'servers')
                if os.path.exists(config) and os.path.exists(servers):
                    ini = dict4ini.DictIni(config, normal=True)
                    ini.miscellany['global-ignores'] = v['svn_global_ignores']
                    ini.save()
                    ini = dict4ini.DictIni(servers, normal=True)
                    if v['proxy']:
                        ini['global']['http-proxy-host'] = v['server']
                        ini['global']['http-proxy-port'] = v['port']
                        ini['global']['http-proxy-username'] = v['username']
                        ini['global']['http-proxy-password'] = v['password']
                        ini.save()
                    else:
                        ini['global'] = {}
                        ini.save()
            else:
                common.warn(
                    tr("Maybe your subversion doesn't be installed or installed uncorrectly."
                       ))
Ejemplo n.º 8
0
    def _get_info(self):
        v = {}
        v['proxy'] = False
        v['server'] = self.pref.svn_proxy_server
        v['port'] = self.pref.svn_proxy_port
        v['password'] = self.pref.svn_proxy_password
        v['timeout'] = self.pref.svn_proxy_timeout
        v['username'] = self.pref.svn_proxy_username

        if wx.Platform == '__WXMSW__':
            from modules import winreg
            try:
                _key = winreg.Key(winreg.HKCU,
                                  r'Software\Tigris.org\Subversion\Config')
                if 'miscellany' not in _key:
                    key = _key.add('miscellany')
                else:
                    key = _key['miscellany']
            except:
                common.warn(
                    tr("Maybe your subversion doesn't be installed or installed uncorrectly."
                       ))
                raise
            if 'global-ignores' in key.values:
                v['svn_global_ignores'] = key.values[
                    'global-ignores'].getvalue()
            else:
                key.values.set('global-ignores', GLOBAL_IGNORES)
                v['svn_global_ignores'] = key.values[
                    'global-ignores'].getvalue()

            try:
                key = winreg.Key(
                    winreg.HKCU,
                    r'Software\Tigris.org\Subversion\Servers\global')
            except:
                common.warn(
                    tr("Maybe your subversion doesn't be installed or installed uncorrectly."
                       ))
                raise

            if 'http-proxy-host' in key.values:
                v['proxy'] = True
                self.pref.svn_proxy_server = v['server'] = key.values[
                    'http-proxy-host'].getvalue()
                self.pref.svn_proxy_port = v['port'] = int(
                    key.values['http-proxy-port'].getvalue())
                self.pref.svn_proxy_password = v['password'] = key.values[
                    'http-proxy-password'].getvalue()
                self.pref.svn_proxy_timeout = v['timeout'] = int(
                    key.values['http-proxy-timeout'].getvalue())
                self.pref.svn_proxy_username = v['username'] = key.values[
                    'http-proxy-username'].getvalue()
                self.pref.save()

        else:
            path = os.path.join(common.getHomeDir(), '.subversion')
            if os.path.exists(path):
                config = os.path.join(path, 'config')
                servers = os.path.join(path, 'servers')
                if os.path.exists(config) and os.path.exists(servers):
                    ini = dict4ini.DictIni(config, normal=True)
                    v['svn_global_ignores'] = ini.miscellany.get(
                        'global-ignores', GLOBAL_IGNORES)
                    ini = dict4ini.DictIni(servers, normal=True)
                    if ini['global']:
                        v['proxy'] = True
                        self.pref.svn_proxy_server = v['server'] = ini[
                            'global'].get('http-proxy-host', '')
                        self.pref.svn_proxy_port = v['port'] = int(
                            ini['global'].get('http-proxy-port', 0))
                        self.pref.svn_proxy_password = v['password'] = ini[
                            'global'].get('http-proxy-password', '')
                        self.pref.svn_proxy_username = v['username'] = ini[
                            'global'].get('http-proxy-username', '')
                        self.pref.save()

        return v