~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-04 14:01:00 UTC
  • mfrom: (5004.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100204140100-xiij51gtzay09vgi
(doxxx) Change the units displayed for transport activity and debug
        memory

Show diffs side-by-side

added added

removed removed

Lines of Context:
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