- Timestamp:
- 2007-08-21T22:33:14Z (17 years ago)
- Branches:
- master
- Children:
- 43e2e9d
- Parents:
- 924d0f2
- Location:
- skype
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/HACKING
r924d0f2 r8237df5 1 1 I use the following commands to debug bitlbee itself: 2 2 3 gdb bitlbee3 gdb ./bitlbee 4 4 run -v -n -D 5 5 6 6 For skyped: 7 7 8 python skyped.py - d8 python skyped.py -n -d -
skype/NEWS
r924d0f2 r8237df5 1 1 VERSION DESCRIPTION 2 2 ----------------------------------------------------------------------------- 3 - skyped now runs as daemon in the background by default 3 4 - skyped now automatically reconnects on Skype restarts 4 5 0.1.0 - initial release -
skype/README
r924d0f2 r8237df5 122 122 == What needs to be done (aka. TODO) 123 123 124 - `--daemon` option for `skyped`125 126 124 - document how do I run skype on a server using vnc 127 125 -
skype/skyped.py
r924d0f2 r8237df5 25 25 # 26 26 27 # makepkg configuration28 """ GPL """29 27 import sys 28 import os 30 29 import signal 31 30 import locale … … 36 35 import gobject 37 36 import socket 37 import getopt 38 38 39 __version__ = "0.1.1" 39 40 40 41 SKYPE_SERVICE = 'com.Skype.API' … … 70 71 71 72 def dprint(msg): 72 if len(sys.argv) > 1 and sys.argv[1] == "-d": 73 global options 74 75 if options.debug: 73 76 print msg 74 77 … … 114 117 return reply 115 118 119 class Options: 120 def __init__(self): 121 self.daemon = True 122 self.debug = False 123 self.help = False 124 self.port = 2727 125 self.version = False 126 127 def usage(self, ret): 128 print """Usage: skyped [OPTION]... 129 130 skyped is a daemon that acts as a tcp server on top of a Skype instance. 131 132 Options: 133 -d --debug enable debug messages 134 -h --help this help 135 -n --nofork don't run as daemon in the background 136 -p --port set the tcp port (default: %d) 137 -v --version display version information""" % self.port 138 sys.exit(ret) 139 116 140 if __name__=='__main__': 141 options = Options() 142 try: 143 opts, args = getopt.getopt(sys.argv[1:], "dhnp:v", ["daemon", "help", "nofork", "port=", "version"]) 144 except getopt.GetoptError: 145 options.usage(1) 146 for opt, arg in opts: 147 if opt in ("-d", "--debug"): 148 options.debug = True 149 elif opt in ("-h", "--help"): 150 options.help = True 151 elif opt in ("-n", "--nofork"): 152 options.daemon = False 153 elif opt in ("-p", "--port"): 154 options.port = arg 155 elif opt in ("-v", "--version"): 156 options.version = True 157 if options.help: 158 options.usage(0) 159 elif options.version: 160 print "skyped %s" % __version__ 161 sys.exit(0) 162 elif options.daemon: 163 pid = os.fork() 164 if pid == 0: 165 nullin = file('/dev/null', 'r') 166 nullout = file('/dev/null', 'w') 167 os.dup2(nullin.fileno(), sys.stdin.fileno()) 168 os.dup2(nullout.fileno(), sys.stdout.fileno()) 169 os.dup2(nullout.fileno(), sys.stderr.fileno()) 170 else: 171 print 'skyped is started on port %s, pid: %d' % (options.port, pid) 172 sys.exit(0) 117 173 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) 118 174 signal.signal(signal.SIGINT, sig_handler) 119 175 mainloop = gobject.MainLoop() 120 server('localhost', 2727)176 server('localhost', options.port) 121 177 while True: 122 178 skype = SkypeApi()
Note: See TracChangeset
for help on using the changeset viewer.