File: _preamble.py

package info (click to toggle)
atropos 1.1.32%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,484 kB
  • sloc: python: 13,413; makefile: 230; sh: 228
file content (21 lines) | stat: -rw-r--r-- 826 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright (c) Twisted Matrix Laboratories.
#
# Copied from Twisted (http://twistedmatrix.com/), see
# http://twistedmatrix.com/trac/browser/trunk/LICENSE for the license.
#
# This makes sure that users don't have to set up their environment
# specially in order to run these programs from bin/.

# This helper is shared by many different actual scripts.  It is not intended to
# be packaged or installed, it is only a developer convenience.  By the time
# the package is actually installed somewhere, the environment should already be set
# up properly without the help of this tool.

import sys, os

path = os.path.abspath(sys.argv[0])
while os.path.dirname(path) != path:
    if os.path.exists(os.path.join(path, 'cutadapt', '__init__.py')):
        sys.path.insert(0, path)
        break
    path = os.path.dirname(path)