~barcc/gedit-debugger/trunk

« back to all changes in this revision

Viewing changes to pydebugger/run_pdb.py

  • Committer: B. Clausius
  • Date: 2016-06-06 19:40:00 UTC
  • Revision ID: barcc@gmx.de-20160606194000-5l2j5emtpdcct9ly
repr for values with newlines or type str

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: utf-8 -*-
2
2
 
3
 
#  Copyright © 2013, 2015  B. Clausius <barcc@gmx.de>
 
3
#  Copyright © 2013, 2015-2016  B. Clausius <barcc@gmx.de>
4
4
#
5
5
#  This program is free software: you can redistribute it and/or modify
6
6
#  it under the terms of the GNU General Public License as published by
63
63
    @staticmethod
64
64
    def valuestr(value):
65
65
        try:
66
 
            return str(value)[:100]
 
66
            res = str(value)[:100]
 
67
            if type(value) is str or '\n' in res:
 
68
                res = repr(res)
 
69
            return res
67
70
        except Exception:
68
71
            return '<unknown>'
69
72