예제 #1
0
파일: iptest.py 프로젝트: AJRenold/ipython
def report():
    """Return a string with a summary report of test-related variables."""

    out = [ sys_info(), '\n']

    avail = []
    not_avail = []

    for k, is_avail in have.items():
        if is_avail:
            avail.append(k)
        else:
            not_avail.append(k)

    if avail:
        out.append('\nTools and libraries available at test time:\n')
        avail.sort()
        out.append('   ' + ' '.join(avail)+'\n')

    if not_avail:
        out.append('\nTools and libraries NOT available at test time:\n')
        not_avail.sort()
        out.append('   ' + ' '.join(not_avail)+'\n')

    return ''.join(out)
예제 #2
0
def report():
    """Return a string with a summary report of test-related variables."""

    out = [sys_info(), '\n']

    avail = []
    not_avail = []

    for k, is_avail in have.items():
        if is_avail:
            avail.append(k)
        else:
            not_avail.append(k)

    if avail:
        out.append('\nTools and libraries available at test time:\n')
        avail.sort()
        out.append('   ' + ' '.join(avail) + '\n')

    if not_avail:
        out.append('\nTools and libraries NOT available at test time:\n')
        not_avail.sort()
        out.append('   ' + ' '.join(not_avail) + '\n')

    return ''.join(out)
예제 #3
0
def ipython_info():
    """Get IPython info dict"""
    from IPython.utils import sysinfo
    try:
        return sysinfo.get_sys_info()
    except AttributeError:
        # IPython < 2.0
        return eval(sysinfo.sys_info())
예제 #4
0
def ipython_info():
    """Get IPython info dict"""
    from IPython.utils import sysinfo
    try:
        return sysinfo.get_sys_info()
    except AttributeError:
        # IPython < 2.0
        return eval(sysinfo.sys_info())
예제 #5
0
    def make_report(self, traceback):
        """Return a string containing a crash report."""

        sec_sep = self.section_sep

        report = ['*' * 75 + '\n\n' + 'IPython post-mortem report\n\n']
        rpt_add = report.append
        rpt_add(sys_info())

        try:
            config = pformat(self.app.config)
            rpt_add(sec_sep)
            rpt_add('Application name: %s\n\n' % self.app_name)
            rpt_add('Current user configuration structure:\n\n')
            rpt_add(config)
        except:
            pass
        rpt_add(sec_sep + 'Crash traceback:\n\n' + traceback)

        return ''.join(report)
예제 #6
0
    def make_report(self,traceback):
        """Return a string containing a crash report."""
        
        sec_sep = self.section_sep
        
        report = ['*'*75+'\n\n'+'IPython post-mortem report\n\n']
        rpt_add = report.append
        rpt_add(sys_info())
        
        try:
            config = pformat(self.app.config)
            rpt_add(sec_sep)
            rpt_add('Application name: %s\n\n' % self.app_name)
            rpt_add('Current user configuration structure:\n\n')
            rpt_add(config)
        except:
            pass
        rpt_add(sec_sep+'Crash traceback:\n\n' + traceback)

        return ''.join(report)
예제 #7
0
    def make_report(self, traceback):
        """Return a string containing a crash report."""

        sec_sep = self.section_sep

        report = ["*" * 75 + "\n\n" + "IPython post-mortem report\n\n"]
        rpt_add = report.append
        rpt_add(sys_info())

        try:
            config = pformat(self.app.config)
            rpt_add(sec_sep)
            rpt_add("Application name: %s\n\n" % self.app_name)
            rpt_add("Current user configuration structure:\n\n")
            rpt_add(config)
        except:
            pass
        rpt_add(sec_sep + "Crash traceback:\n\n" + traceback)

        return "".join(report)