https://github.com/reorx/dragline
file system monitor
https://github.com/reorx/dragline
Last synced: 18 days ago
JSON representation
file system monitor
- Host: GitHub
- URL: https://github.com/reorx/dragline
- Owner: reorx
- Created: 2012-11-16T16:17:45.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-31T02:20:24.000Z (about 12 years ago)
- Last Synced: 2025-02-10T07:30:26.890Z (2 months ago)
- Language: Python
- Size: 145 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Dragline: File system automation guard
======================================Usage:
1. Install dragline::
python setup install
or just try without touching your dist-packages::
python setup develop
2. Write a ``dragconfig.py`` file in the director you want to watch::
#!/usr/bin/env python
# -*- coding: utf-8 -*-from dragline.handlers import CommandHandler, StylusHandler, JadeHandler
class MyStylusHandler(StylusHandler):
paths = ['stylus']
plugins = ['nib']def added(self):
self.make()def modified(self):
self.make()def make(self):
output = self.rreplace(self.lreplace(self.filepath, 'stylus', 'public/stylesheets'),
'.styl', '.css')
self.stylus(self.filepath, output)class MyJadeHandler(JadeHandler):
template = 'tornado'def added(self):
self.make()def modified(self):
self.make()def make(self):
output = self.rreplace(self.lreplace(self.filepath, 'jade', 'public/html'),
'.jade', '.html')
self.jade(self.filepath, output)class MyJsHandler(CommandHandler):
def added(self):
self.make()def modified(self):
self.make()def make(self):
output = self.lreplace(self.filepath, 'javascripts', 'public/javascripts')
self.mkdir(output)
self.run_command(['cp', self.filepath, output])DEBUG = False
HANDLERS = [
('*.styl', MyStylusHandler),
('*.jade', MyJadeHandler),
('*.js', MyJsHandler),
]INTERVAL = 2000
RECURSIVE = True
3. Run ``dragline``
4. You are done, continue focusing on your work