File: main.py

package info (click to toggle)
virtualenvwrapper 3.4-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,140 kB
  • sloc: sh: 3,801; python: 991; makefile: 27
file content (26 lines) | stat: -rw-r--r-- 575 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann.  All rights reserved.
#
"""virtualenvwrapper.project plugin for tests
"""

import logging
import os

log = logging.getLogger(__name__)

def template(args):
    """Creates a test file containing the args passed to us
    """
    log.info('Running test template with args %r', args)
    project = args[0]
    filename = 'TEST_FILE'
    log.info('Writing to %s', filename)
    output = open(filename, 'w')
    try:
        output.write('\n'.join(args))
    finally:
        output.close()
    return