~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-04 16:06:36 UTC
  • mfrom: (5007 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5023.
  • Revision ID: john@arbash-meinel.com-20100204160636-xqeuwz8bwt8bbts4
Merge bzr.dev 5007, resolve conflict, update NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
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
135
135
                'WorkingSetSize': mem_struct.WorkingSetSize,
136
136
                'QuotaPeakPagedPoolUsage': mem_struct.QuotaPeakPagedPoolUsage,
137
137
                'QuotaPagedPoolUsage': mem_struct.QuotaPagedPoolUsage,
138
 
                'QuotaPeakNonPagedPoolUsage': mem_struct.QuotaPeakNonPagedPoolUsage,
 
138
                'QuotaPeakNonPagedPoolUsage':
 
139
                    mem_struct.QuotaPeakNonPagedPoolUsage,
139
140
                'QuotaNonPagedPoolUsage': mem_struct.QuotaNonPagedPoolUsage,
140
141
                'PagefileUsage': mem_struct.PagefileUsage,
141
142
                'PeakPagefileUsage': mem_struct.PeakPagefileUsage,
152
153
                   ' or win32process')
153
154
        return
154
155
    if short:
155
 
        trace.note('WorkingSize %7dKB'
156
 
                   '\tPeakWorking %7dKB\t%s',
 
156
        # using base-2 units (see HACKING.txt).
 
157
        trace.note('WorkingSize %7dKiB'
 
158
                   '\tPeakWorking %7dKiB\t%s',
157
159
                   info['WorkingSetSize'] / 1024,
158
160
                   info['PeakWorkingSetSize'] / 1024,
159
161
                   message)
160
162
        return
161
163
    if message:
162
164
        trace.note('%s', message)
163
 
    trace.note('WorkingSize       %8d KB', info['WorkingSetSize'] / 1024)
164
 
    trace.note('PeakWorking       %8d KB', info['PeakWorkingSetSize'] / 1024)
165
 
    trace.note('PagefileUsage     %8d KB', info.get('PagefileUsage', 0) / 1024)
166
 
    trace.note('PeakPagefileUsage %8d KB', info.get('PeakPagefileUsage', 0) / 1024)
167
 
    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)
168
171
    trace.note('PageFaultCount    %8d', info.get('PageFaultCount', 0))
169
172
 
170
173
 
187
190
 
188
191
    if res:
189
192
        (bufx, bufy, curx, cury, wattr,
190
 
        left, top, right, bottom, maxx, maxy) = struct.unpack("hhhhHhhhhhh", csbi.raw)
 
193
        left, top, right, bottom, maxx, maxy) = struct.unpack(
 
194
            "hhhhHhhhhhh", csbi.raw)
191
195
        sizex = right - left + 1
192
196
        sizey = bottom - top + 1
193
197
        return (sizex, sizey)
410
414
 
411
415
 
412
416
def _ensure_with_dir(path):
413
 
    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'?')):
414
419
        return u'./' + path, True
415
420
    else:
416
421
        return path, False