| | 418 | # these three are to deal with twisted stuff, will have to rewrite this |
|---|
| | 419 | # to make use of the twisted options stuff |
|---|
| | 420 | opt_dummy_n = clee.make_option("-n", "--dummyn", dest="dummyn") |
|---|
| | 421 | opt_dummy_o = clee.make_option("-o", "--dummyo", dest="dummyo") |
|---|
| | 422 | opt_dummy_y = clee.make_option("-y", "--dummyy", dest="dummyy") |
|---|
| | 423 | |
|---|
| 538 | | add_help_option=False) |
|---|
| 539 | | options, args = cli.parse_args([]) |
|---|
| 540 | | |
|---|
| 541 | | config = JibotConfig(options.config) |
|---|
| 542 | | config.loadOptions(cli) |
|---|
| 543 | | |
|---|
| 544 | | |
|---|
| | 545 | add_help_option=False) |
|---|
| | 546 | options, args = cli.parse_args() |
|---|
| | 547 | |
|---|
| | 548 | config = Config(options.config) |
|---|
| | 549 | |
|---|
| | 550 | for k, defaultValue in cli.defaults.iteritems(): |
|---|
| | 551 | parsedValue = getattr(options, k) |
|---|
| | 552 | if parsedValue != defaultValue or not hasattr(config, k): |
|---|
| | 553 | setattr(config, k, parsedValue) |
|---|
| | 554 | #elif parsedValue == defaultValue and hasattr(config, k) and getattr(config, k) != parsedValue: |
|---|
| | 555 | # setattr(config, k, parsedValue) |
|---|
| | 556 | |
|---|
| | 557 | |
|---|
| 546 | | f = JibotFactory(config, args) |
|---|
| 547 | | |
|---|
| 548 | | internet.TCPClient(config.host, int(config.port), |
|---|
| 549 | | f).setServiceParent(application) |
|---|
| | 559 | f = ClientFactory(config, args) |
|---|
| | 560 | |
|---|
| | 561 | #print options.enable |
|---|
| | 562 | #enabled = options.enable or [] |
|---|
| | 563 | #for m in enabled: |
|---|
| | 564 | |
|---|
| | 565 | #for m in dir(f): |
|---|
| | 566 | # print m, getattr(f, m) |
|---|
| | 567 | |
|---|
| | 568 | ## connect the factory to the server |
|---|
| | 569 | #reactor.connectTCP("irc.freenode.net",6667, f) |
|---|
| | 570 | #reactor.connectTCP(config.host, int(config.port), f) |
|---|
| | 571 | i = internet.TCPClient(config.host, int(config.port), f) |
|---|
| | 572 | i.setServiceParent(application) |
|---|