Skip to content

Commit

Permalink
Ensure new files are added to a transports configuration. Closes #96. C…
Browse files Browse the repository at this point in the history
…loses #101
  • Loading branch information
josegonzalez committed Feb 24, 2013
1 parent 55b88af commit 0bc6395
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions beaver/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def run_queue(queue, beaver_config, file_config, logger=None):
transport.interrupt()

sys.exit(0)
elif command == "addglob":
transport.addglob(*data)
elif command == "exit":
break
except KeyboardInterrupt:
Expand Down
3 changes: 3 additions & 0 deletions beaver/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ def format(self, filename, timestamp, line):
'@message': line.strip(os.linesep),
})

def addglob(self, globname, globbed):
self._file_config.addglob(globname, globbed)


class TransportException(Exception):
pass
1 change: 1 addition & 0 deletions beaver/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def update_files(self):
globbed = [os.path.realpath(filename) for filename in eglob(name)]
files.extend(globbed)
self._file_config.addglob(name, globbed)
self._callback(("addglob", (name, globbed)))
else:
for name in self.listdir():
files.append(os.path.realpath(os.path.join(self._folder, name)))
Expand Down

0 comments on commit 0bc6395

Please sign in to comment.