~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: 2009-03-06 06:48:25 UTC
  • mfrom: (4070.8.6 debug-config)
  • Revision ID: pqm@pqm.ubuntu.com-20090306064825-kbpwggw21dygeix6
(mbp) debug_flags configuration option

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Win32-specific helper functions
18
18
 
144
144
        trace.note('Cannot debug memory on win32 without ctypes'
145
145
                   ' or win32process')
146
146
        return
 
147
    trace.note('WorkingSize       %8d kB', info['WorkingSetSize'] / 1024)
 
148
    trace.note('PeakWorking       %8d kB', info['PeakWorkingSetSize'] / 1024)
147
149
    if short:
148
 
        trace.note('WorkingSize %7dKB'
149
 
                   '\tPeakWorking %7dKB\t%s',
150
 
                   info['WorkingSetSize'] / 1024,
151
 
                   info['PeakWorkingSetSize'] / 1024,
152
 
                   message)
153
150
        return
154
 
    if message:
155
 
        trace.note('%s', message)
156
 
    trace.note('WorkingSize       %8d KB', info['WorkingSetSize'] / 1024)
157
 
    trace.note('PeakWorking       %8d KB', info['PeakWorkingSetSize'] / 1024)
158
 
    trace.note('PagefileUsage     %8d KB', info.get('PagefileUsage', 0) / 1024)
159
 
    trace.note('PeakPagefileUsage %8d KB', info.get('PeakPagefileUsage', 0) / 1024)
160
 
    trace.note('PrivateUsage      %8d KB', info.get('PrivateUsage', 0) / 1024)
 
151
    trace.note('PagefileUsage     %8d kB', info.get('PagefileUsage', 0) / 1024)
 
152
    trace.note('PeakPagefileUsage %8d kB', info.get('PeakPagefileUsage', 0) / 1024)
 
153
    trace.note('PrivateUsage      %8d kB', info.get('PrivateUsage', 0) / 1024)
161
154
    trace.note('PageFaultCount    %8d', info.get('PageFaultCount', 0))
162
155
 
163
156
 
286
279
    If location cannot be obtained return system drive root,
287
280
    i.e. C:\
288
281
 
289
 
    Returned value can be unicode or plain string.
 
282
    Returned value can be unicode or plain sring.
290
283
    To convert plain string to unicode use
291
284
    s.decode(osutils.get_user_encoding())
292
285
    """
309
302
    """Return user name as login name.
310
303
    If name cannot be obtained return None.
311
304
 
312
 
    Returned value can be unicode or plain string.
 
305
    Returned value can be unicode or plain sring.
313
306
    To convert plain string to unicode use
314
307
    s.decode(osutils.get_user_encoding())
315
308
    """
454
447
 
455
448
def get_app_path(appname):
456
449
    """Look up in Windows registry for full path to application executable.
457
 
    Typically, applications create subkey with their basename
 
450
    Typicaly, applications create subkey with their basename
458
451
    in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
459
452
 
460
453
    :param  appname:    name of application (if no filename extension