File: main.py

package info (click to toggle)
virtualenvwrapper 4.8.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 796 kB
  • sloc: sh: 3,369; python: 595; makefile: 185
file content (27 lines) | stat: -rw-r--r-- 609 bytes parent folder | download | duplicates (2)
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
27
#!/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
    """
    print('Running test template with args %r' % args)
    project, project_dir = args
    filename = os.path.join(project_dir, 'TEST_FILE')
    print('Writing to %s' % filename)
    output = open(filename, 'w')
    try:
        output.write('\n'.join(args))
    finally:
        output.close()
    return