home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import os
- ignore_termtitle = True
-
- try:
- import ctypes
- SetConsoleTitleW = ctypes.windll.kernel32.SetConsoleTitleW
- SetConsoleTitleW.argtypes = [
- ctypes.c_wchar_p]
-
- def set_term_title(title):
- SetConsoleTitleW(title)
-
- except ImportError:
-
- def set_term_title(title):
- global ignore_termtitle
-
- try:
- curr = os.getcwd()
- os.chdir('C:')
- ret = os.system('title ' + title)
- finally:
- os.chdir(curr)
-
- if ret:
- ignore_termtitle = True
-
-
-
-
- def find_cmd(cmd):
-
- try:
- SearchPath = SearchPath
- import win32api
- except ImportError:
- raise ImportError('you need to have pywin32 installed for this to work')
-
- PATH = os.environ['PATH']
- extensions = [
- '.exe',
- '.com',
- '.bat',
- '.py']
- path = None
- for ext in extensions:
-
- try:
- path = SearchPath(PATH, cmd + ext)[0]
- continue
- continue
-
-
- if path is None:
- raise OSError('command %r not found' % cmd)
- path is None
- return path
-
-
- def get_long_path_name(path):
-
- try:
- import ctypes
- except ImportError:
- raise ImportError('you need to have ctypes installed for this to work')
-
- _GetLongPathName = ctypes.windll.kernel32.GetLongPathNameW
- _GetLongPathName.argtypes = [
- ctypes.c_wchar_p,
- ctypes.c_wchar_p,
- ctypes.c_uint]
- buf = ctypes.create_unicode_buffer(260)
- rv = _GetLongPathName(path, buf, 260)
- if rv == 0 or rv > 260:
- return path
- return buf.value
-
-
- def term_clear():
- os.system('cls')
-
-