Browse Source

Renamed from ProxySwitcher to ToggleProxy

--HG--
rename : ProxySwitcher.py => ToggleProxy.py
tags/v1.0.0
Robert Klep 10 years ago
parent
commit
f46378309c
2 changed files with 5 additions and 6 deletions
  1. +4
    -4
      ToggleProxy.py
  2. +1
    -2
      setup.py

ProxySwitcher.py → ToggleProxy.py View File

@@ -5,7 +5,7 @@ from AppKit import *
from SystemConfiguration import *
import commands, re, time

class ProxySwitcher(NSObject):
class ToggleProxy(NSObject):

def applicationDidFinishLaunching_(self, notification):
# make status bar item
@@ -33,7 +33,7 @@ class ProxySwitcher(NSObject):
self.services[device] = service

def watchForProxyChanges(self):
store = SCDynamicStoreCreate(None, "name.klep.proxyswitcher", self.proxyStateChanged, None)
store = SCDynamicStoreCreate(None, "name.klep.toggleproxy", self.proxyStateChanged, None)
SCDynamicStoreSetNotificationKeys(store, None, [ 'State:/Network/Global/Proxies' ])

source = SCDynamicStoreCreateRunLoopSource(None, store, 0)
@@ -80,6 +80,6 @@ class ProxySwitcher(NSObject):

if __name__ == '__main__':
sharedapp = NSApplication.sharedApplication()
switcher = ProxySwitcher.alloc().init()
sharedapp.setDelegate_(switcher)
toggler = ToggleProxy.alloc().init()
sharedapp.setDelegate_(toggler)
sharedapp.run()

+ 1
- 2
setup.py View File

@@ -2,9 +2,8 @@ from distutils.core import setup
from glob import glob
import py2app, sys, os, commands

# define distutils setup structure
setup(
app = [ 'ProxySwitcher.py' ],
app = [ 'ToggleProxy.py' ],
options = dict(py2app = dict(
plist = dict(
LSBackgroundOnly = True


Loading…
Cancel
Save