~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32console.py

  • Committer: Robert Collins
  • Date: 2007-01-30 11:52:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2246.
  • Revision ID: robertc@robertcollins.net-20070130115230-2052dzn5xo9h6o07
Add install_hook to the BranchHooks class as the official means for installing a hook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2006 Canonical Ltd
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
 
1
17
 
2
18
"""
3
19
Set of functions to work with console on Windows.
7
23
 
8
24
import struct
9
25
 
 
26
# We can cope without it; use a separate variable to help pyflakes
10
27
try:
11
28
   import ctypes
 
29
   has_ctypes = True
12
30
except ImportError:
13
 
   ctypes = None
 
31
    has_ctypes = False
14
32
 
15
33
 
16
34
WIN32_STDIN_HANDLE = -10
27
45
 
28
46
   Dependencies: ctypes should be installed.
29
47
   """
30
 
   if ctypes is None:
 
48
   if not has_ctypes:
31
49
       # no ctypes is found
32
50
       return (defaultx, defaulty)
33
51