1
# Copyright (C) 2006, 2007 Canonical Ltd
1
# Copyright (C) 2005-2010 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
137
135
'WorkingSetSize': mem_struct.WorkingSetSize,
138
136
'QuotaPeakPagedPoolUsage': mem_struct.QuotaPeakPagedPoolUsage,
139
137
'QuotaPagedPoolUsage': mem_struct.QuotaPagedPoolUsage,
140
'QuotaPeakNonPagedPoolUsage': mem_struct.QuotaPeakNonPagedPoolUsage,
138
'QuotaPeakNonPagedPoolUsage':
139
mem_struct.QuotaPeakNonPagedPoolUsage,
141
140
'QuotaNonPagedPoolUsage': mem_struct.QuotaNonPagedPoolUsage,
142
141
'PagefileUsage': mem_struct.PagefileUsage,
143
142
'PeakPagefileUsage': mem_struct.PeakPagefileUsage,
154
153
' or win32process')
157
trace.note('WorkingSize %7dKB'
158
'\tPeakWorking %7dKB\t%s',
156
# using base-2 units (see HACKING.txt).
157
trace.note('WorkingSize %7dKiB'
158
'\tPeakWorking %7dKiB\t%s',
159
159
info['WorkingSetSize'] / 1024,
160
160
info['PeakWorkingSetSize'] / 1024,
164
164
trace.note('%s', message)
165
trace.note('WorkingSize %8d KB', info['WorkingSetSize'] / 1024)
166
trace.note('PeakWorking %8d KB', info['PeakWorkingSetSize'] / 1024)
167
trace.note('PagefileUsage %8d KB', info.get('PagefileUsage', 0) / 1024)
168
trace.note('PeakPagefileUsage %8d KB', info.get('PeakPagefileUsage', 0) / 1024)
169
trace.note('PrivateUsage %8d KB', info.get('PrivateUsage', 0) / 1024)
165
trace.note('WorkingSize %8d KiB', info['WorkingSetSize'] / 1024)
166
trace.note('PeakWorking %8d KiB', info['PeakWorkingSetSize'] / 1024)
167
trace.note('PagefileUsage %8d KiB', info.get('PagefileUsage', 0) / 1024)
168
trace.note('PeakPagefileUsage %8d KiB',
169
info.get('PeakPagefileUsage', 0) / 1024)
170
trace.note('PrivateUsage %8d KiB', info.get('PrivateUsage', 0) / 1024)
170
171
trace.note('PageFaultCount %8d', info.get('PageFaultCount', 0))
182
183
return (defaultx, defaulty)
184
185
# To avoid problem with redirecting output via pipe
185
# need to use stderr instead of stdout
186
# we need to use stderr instead of stdout
186
187
h = ctypes.windll.kernel32.GetStdHandle(WIN32_STDERR_HANDLE)
187
188
csbi = ctypes.create_string_buffer(22)
188
189
res = ctypes.windll.kernel32.GetConsoleScreenBufferInfo(h, csbi)
191
192
(bufx, bufy, curx, cury, wattr,
192
left, top, right, bottom, maxx, maxy) = struct.unpack("hhhhHhhhhhh", csbi.raw)
193
left, top, right, bottom, maxx, maxy) = struct.unpack(
194
"hhhhHhhhhhh", csbi.raw)
193
195
sizex = right - left + 1
194
196
sizey = bottom - top + 1
195
197
return (sizex, sizey)
415
416
def _ensure_with_dir(path):
416
if not os.path.split(path)[0] or path.startswith(u'*') or path.startswith(u'?'):
417
if (not os.path.split(path)[0] or path.startswith(u'*')
418
or path.startswith(u'?')):
417
419
return u'./' + path, True
419
421
return path, False
648
650
prototype = ctypes.WINFUNCTYPE(POINTER(LPCWSTR), LPCWSTR, POINTER(INT))
649
651
command_line = GetCommandLine()
650
652
# Skip the first argument, since we only care about parameters
651
argv = _command_line_to_argv(GetCommandLine())[1:]
653
argv = _command_line_to_argv(command_line)[1:]
652
654
if getattr(sys, 'frozen', None) is None:
653
655
# Invoked via 'python.exe' which takes the form:
654
656
# python.exe [PYTHON_OPTIONS] C:\Path\bzr [BZR_OPTIONS]