Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install trawl

How to install Trawl

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install trawl
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2.1 Available View build log
Windows (64-bit)
0.2.1 Available View build log
Mac OS X (10.5+)
0.2.1 Available View build log
Linux (32-bit)
0.2.1 Available View build log
Linux (64-bit)
0.2.1 Available View build log
 
Author
License
MIT
Imports
Lastest release
version 0.2.1 on Jan 5th, 2011

This is as straight of a clone of Rake that I could come up with.

Briefly:

# Trawlfile

System Message: ERROR/3 (<string>, line 10)

Inconsistent literal block quoting.

@task def bar(): print "BAR!"

Does as you might expect:

$ trawl -T

System Message: ERROR/3 (<string>, line 18)

Inconsistent literal block quoting.

bar $ trawl bar ** Execute bar BAR

And with dependencies:

# Trawlfile

System Message: ERROR/3 (<string>, line 27)

Inconsistent literal block quoting.

@task def bar(): print "BAR!"

@task([bar]) def foo(): print "FOO!"

Also does what you'd expect:

$ trawl -T

System Message: ERROR/3 (<string>, line 39)

Inconsistent literal block quoting.

bar foo $ trawl bar ** Execute bar BAR! $ trawl foo ** Execute bar BAR! ** Execute foo FOO!

Which is awesome sauce, but what about files?

# Trawlfile

System Message: ERROR/3 (<string>, line 54)

Inconsistent literal block quoting.

@build("myfile.txt", recreate=False) def run(task): with open(task.name) as out: out.write("MUNCTIONAL!")

@build("yup.cfg", ["myfile.txt"]) def more(task): with open(task.name) as out: with open(task.source) as src: out.write(src.read() + "!!!1!")

Will cause "myfile.txt" to be created but not overwritten if it exists. "yup.cfg" will then only be rebuilt when "myfile.txt" changes as determined by the file's mtime:

$ trawl yup.cfg

System Message: ERROR/3 (<string>, line 71)

Inconsistent literal block quoting.

** Execute myfile.txt ** Execute yup.cfg $ trawl yup.cfg $

The last major bit is in defining rules:

@rule('.o', '.c'):

System Message: ERROR/3 (<string>, line 80)

Inconsistent literal block quoting.

def compile(task): subprocess.check_call(["gcc", "-o", task.name, "-c", task.source])

objects = FileList("*.c").sub(".c$", ".o") @build("appname", objects) def link(task): subprocess.check_call(["gcc", "-o", task.name] + task.sources)

System Message: WARNING/2 (<string>, line 83); backlink

Inline emphasis start-string without end-string.

# Add a helpful handle for running task("run", ["appname"])

TODO

Some things that need to be done yet:

  • Task descriptions
  • Argument support
  • Test and add methods to FileList
  • Add a function to import tasks programatically

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.