Changeset 7e5b4bd for protocols/skype


Ignore:
Timestamp:
2013-02-11T12:56:03Z (12 years ago)
Author:
Miklos Vajna <vmiklos@…>
Branches:
master
Children:
3e23850
Parents:
b56c76c
git-author:
Mike Kazantsev <mk.fraggod@…> (11-02-13 12:56:03)
git-committer:
Miklos Vajna <vmiklos@…> (11-02-13 12:56:03)
Message:

skype: add --dont-start-skype option

For cases when case skype start/stop/restart is being handled externally.
Skype4Py seem to be able to handle client going on/off.

Location:
protocols/skype
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/skype/skyped.py

    rb56c76c r7e5b4bd  
    5252        if options.conn:
    5353                options.conn.close()
    54         # shut down client if it's running
    55         try:
    56                 skype.skype.Client.Shutdown()
    57         except NameError:
    58                 pass
     54        if not options.dont_start_skype:
     55                # shut down client if it's running
     56                try:
     57                        skype.skype.Client.Shutdown()
     58                except NameError:
     59                        pass
    5960        sys.exit("Exiting.")
    6061
     
    308309class SkypeApi:
    309310        def __init__(self, mock):
     311                global options
    310312                if not mock:
    311313                        self.skype = Skype4Py.Skype()
    312314                        self.skype.OnNotify = self.recv
    313                         self.skype.Client.Start()
     315                        if not options.dont_start_skype:
     316                                self.skype.Client.Start()
    314317                else:
    315318                        self.skype = MockedSkype(mock)
     
    445448        parser.add_argument('-n', '--nofork',
    446449                action='store_true', help="don't run as daemon in the background")
     450        parser.add_argument('-s', '--dont-start-skype', action='store_true',
     451                help="assume that skype is running independently, don't try to start/stop it")
    447452        parser.add_argument('-m', '--mock', help='fake interactions with skype (only useful for tests)')
    448453        parser.add_argument('-d', '--debug', action='store_true', help='enable debug messages')
  • protocols/skype/skyped.txt

    rb56c76c r7e5b4bd  
    7575        Don't run as daemon in the background
    7676
     77-s, --dont-start-skype::
     78        Assume that skype is running independently, don't try to start/stop it.
     79
    7780-p, --port::
    7881        Set the tcp port (default: 2727)
Note: See TracChangeset for help on using the changeset viewer.