blogit_connect.diff
| b/plugin/blogit.vim | ||
|---|---|---|
| 65 | 65 |
class BlogIt: |
| 66 | 66 | |
| 67 | 67 |
def __init__(self): |
| 68 |
self.client = xmlrpclib.ServerProxy(self.blog_url()) |
|
| 68 |
self.connected = False |
|
| 69 | 69 |
self.current_post = None |
| 70 | 70 | |
| 71 |
def connect(self): |
|
| 72 |
self.client = xmlrpclib.ServerProxy(self.blog_url()) |
|
| 73 |
self.connected = True |
|
| 74 | ||
| 71 | 75 |
def command(self, command, *args): |
| 72 | 76 |
commands = self.getMethods('command_')
|
| 73 | 77 |
if not command in commands: |
| 74 | 78 |
sys.stderr.write("No such command: %s" % command)
|
| 79 |
return |
|
| 80 |
if not self.connected and command != 'help': |
|
| 81 |
self.connect() |
|
| 75 | 82 |
commands[command](*args) |
| 76 | 83 | |
| 77 | 84 |
def command_help(self): |