Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top-level code environment updates #3

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
; https://EditorConfig.org
root = true

[*.{py, css, scss, sass, less, js, ts, html, xhtml, json, txt, ini, yml, env, sh, cfg}]
charset = utf-8
max_line_length = 140

[*.py]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[Makefile]
indent_style = tab

[*.{css, scss, sass, less, js, ts, html, xhtml, json}]
indent_style = space
indent_size = 2
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
max-line-length = 140
exclude = venv*/*,
build/*,
dist/*,
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* Removed macshim.py
* Removed coldshot support


## Modifications since the Fork

* Python3 compatibility
Expand All @@ -19,3 +18,17 @@
* Replaced SafeConfigParser with ConfigParser
* Replaced logger.warn with logger.warning

## [2.1.0] - 2023-02-05

* wxPython 4.2.0 compatibility
* Fixed deprecation warning

## [2.2.0] - 2023-02-07

* Fixed top-level code environment
* Modernized `setup.py`: updated and fixed installation meta
* Modernized `version` control: rename `version.py` -> `vertion.txt`
* Added `requirements.txt`
* Added `.flake8` and fixed the code
* Added `.editorconfig`
* Updated application resource
5 changes: 3 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include MANIFEST.in
include license.txt
include readme.txt
include LICENSE
include CHANGELOG.md
include README.md
include setup.py
include *.desktop
include runsnakerun *.png
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ and up to current best practices and standards.

### Requirements

* Python3
* wxpython 4
* Python: 3.7+
* wxPython: 4.2+


### Modifications since the Fork
Expand All @@ -33,6 +33,12 @@ and up to current best practices and standards.

[RunSnakeRun]: http://www.vrplumber.com/programming/runsnakerun/

### Start

```shell
python -m snakerunner
```

### Screenshot

![Screenshot of runsnakerun on macOS Mojave with Python 3.7](screenshot.png)
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setuptools~=65.5.1
wxPython~=4.2.0
16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
from setuptools import setup, find_packages
from os.path import abspath, dirname, join

meta = {}
exec(open('./snakerunner/version.py').read(), meta)
meta['long_description'] = open('./README.md').read()
_root = dirname(abspath(__file__))
_version = open(join(_root, 'snakerunner', 'version.txt'), 'r').read()
_long_description = open(join(_root, 'README.md'), 'r').read()
_install_requires = open(join(_root, 'requirements.txt'), 'r').readlines()

setup(
name='snakerunner',
version=meta['__version__'],
version=_version,
author="Bastian Venthur",
author_email="venthur@debian.org",
description="GUI Viewer for Python profiling runs",
long_description=meta['long_description'],
long_description=_long_description,
keywords='profile,gui,wxPython,squaremap',
url="https://github.com/venthur/snakerunner",
packages=find_packages(exclude=['tests', "venv"]),
install_requires=[
'wxpython',
],
install_requires=_install_requires,
license="BSD",
zip_safe=False,
entry_points={
Expand Down
16 changes: 8 additions & 8 deletions snakerunner/snakerunner.py → snakerunner/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def LoadRSRIcon(self):
try:
from snakerunner.resources import rsricon_png
return getIcon(rsricon_png.data)
except Exception as err:
except Exception:
return None

sourceCodeControl = None
Expand Down Expand Up @@ -488,7 +488,7 @@ def OnBackView(self, event):
self.historyIndex -= 1
try:
self.RestoreHistory(self.history[self.historyIndex])
except IndexError as err:
except IndexError:
self.SetStatusText(_('No further history available'))

def OnRootView(self, event):
Expand All @@ -514,7 +514,7 @@ def SourceShowFile(self, node):
if filename and self.sourceFileShown != filename:
try:
data = open(filename).read()
except Exception as err:
except Exception:
# TODO: load from zips/eggs? What about .pyc issues?
return None
else:
Expand Down Expand Up @@ -570,7 +570,7 @@ def RecordHistory(self):
if self.historyIndex < -1:
try:
del self.history[self.historyIndex+1:]
except AttributeError as err:
except AttributeError:
pass
if (not self.history) or record != self.history[-1]:
self.history.append(record)
Expand Down Expand Up @@ -666,10 +666,10 @@ def LoadState(self, config_parser):
]
self.SetPosition((x, y))
self.SetSize((width, height))
except configparser.NoSectionError as err:
except configparser.NoSectionError:
# the file isn't written yet, so don't even warn...
pass
except Exception as err:
except Exception:
# this is just convenience, if it breaks in *any* way, ignore it...
log.error(
"Unable to load window preferences, ignoring: %s", traceback.format_exc()
Expand Down Expand Up @@ -698,15 +698,15 @@ def OnCloseWindow(self, event=None):
temp = config + '~'
self.config.write(open(temp, 'w'))
os.rename(temp, config)
except Exception as err:
except Exception:
log.error("Unable to write window preferences, ignoring: %s",
traceback.format_exc())
self.Destroy()


class RunSnakeRunApp(wx.App):
"""Basic application for holding the viewing Frame"""
#handler = wx.PNGHandler()
# handler = wx.PNGHandler()

def OnInit(self):
"""Initialise the application"""
Expand Down
12 changes: 6 additions & 6 deletions snakerunner/listviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def OnNodeActivated(self, event):
node = self.sorted[event.GetIndex()]
except AttributeError:
pass
except IndexError as err:
except IndexError:
log.warning(_('Invalid index in node activated: %(index)s'),
index=event.GetIndex())
else:
Expand All @@ -149,7 +149,7 @@ def OnNodeSelected(self, event):
node = self.sorted[event.GetIndex()]
except AttributeError:
pass
except IndexError as err:
except IndexError:
log.warning(_('Invalid index in node selected: %(index)s'),
index=event.GetIndex())
else:
Expand All @@ -166,7 +166,7 @@ def OnMouseMove(self, event):
if item > -1:
try:
node = self.sorted[item]
except IndexError as err:
except IndexError:
log.warning(_('Invalid index in mouse move.'))
else:
wx.PostEvent(
Expand Down Expand Up @@ -211,7 +211,7 @@ def OnReorder(self, event):
def ReorderByColumn(self, column):
"""Reorder the set of records by column"""
# TODO: store current selection and re-select after sorting...
single_column = self.SetNewOrder(column)
self.SetNewOrder(column)
self.reorder(single_column=True)
self.Refresh()

Expand Down Expand Up @@ -273,7 +273,7 @@ def OnGetItemText(self, item, col):
try:
column = self.columns[col]
value = column.get(self.sorted[item])
except IndexError as err:
except IndexError:
return ''
else:
if value is None:
Expand All @@ -283,7 +283,7 @@ def OnGetItemText(self, item, col):
if column.format:
try:
return column.format % (value,)
except Exception as err:
except Exception:
log.warning('Column %s could not format %r value: %r',
column.name, type(value), value)
value = column.get(self.sorted[item])
Expand Down
8 changes: 4 additions & 4 deletions snakerunner/pstatsloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, *filenames):
self.location_rows = {}
self.stats = pstats.Stats(*filenames)
self.tree = self.load(self.stats.stats)
self.location_tree = l = self.load_location()
self.location_tree = self.load_location()

ROOTS = ['functions', 'location']

Expand Down Expand Up @@ -54,7 +54,7 @@ def load(self, stats):
for func, raw in stats.items():
try:
rows[func] = row = PStatRow(func, raw)
except ValueError as err:
except ValueError:
log.info('Null row: %s', func)
for row in rows.values():
row.weave(rows)
Expand Down Expand Up @@ -177,7 +177,7 @@ def __init__(self, key, raw):
file, line, func = self.key = key
try:
dirname, basename = os.path.dirname(file), os.path.basename(file)
except ValueError as err:
except ValueError:
dirname = ''
basename = file
nc, cc, tt, ct, callers = raw
Expand Down Expand Up @@ -220,7 +220,7 @@ def child_cumulative_time(self, child):
if total:
try:
(cc, nc, tt, ct) = child.callers[self.key]
except TypeError as err:
except TypeError:
ct = child.callers[self.key]
return float(ct)/total
return 0
Expand Down
4 changes: 2 additions & 2 deletions snakerunner/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

# CUSTOMISATION POINT
# import specialised generators here, such as for wxPython
#from resourcepackage import wxgenerators
#generators.update( wxgenerators.generators )
# from resourcepackage import wxgenerators
# generators.update( wxgenerators.generators )
except ImportError:
pass
else:
Expand Down
28 changes: 2 additions & 26 deletions snakerunner/resources/rsricon_png.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
# -*- coding: ISO-8859-1 -*-
"""Resource rsricon_png (from file rsricon.png)"""
# written by resourcepackage: (1, 0, 1)
# flake8: noqa
source = 'rsricon.png'
package = 'runsnakerun.resources'
data = "�PNG\015\012\032\012\000\000\000\015IHDR\000\000\000 \000\000\000 \010\006\000\000\000szz�\000\000\000\004sBIT\010\010\010\010|\010d�\000\000\000\011pHYs\000\000\015\
�\000\000\015�\001B(�x\000\000\000\031tEXtSoftware\000www.inkscape.org��<\032\000\000\005NIDATX���m\
lSU\030�����;��e\033[��p\033\014�Xx\021\007\010\010d\012Q\003:#/J�BH4���|1~\000_\023��/hLHԠ\031D\
?\020\015\001\004�\011\014��\004�\030��\006s�ۺ��[o���^Y[��/=}���_{�s�\025RJ��\020¥�(5��\005\
\\�\031\012p8\024�w)��\010A\034!�\002��)�KJx��a6f\025�V6`�T�2���p�i��=\034\014z�\"��;�\000۶\
���r�\001E3g�N�l������*��\007�\012v0_Ji�\013��\017��ؚ�4h\0160�\015/-�W�>\035-\031�\
��\035�\017\000\010!Դ46�l�\005+J�1,�SBb���m��7&\000eeL��qe\007�N����CnZ�p�:2\014'{\
�\004`�B&��=�5kJ��ȏ(\032�\024)�\022@O�%���\015�����XTW;�v�\031Q�*\021)\000�Y\030���\0004C\
<����j�^�Y�޷���оw�b�x4.\000��/\01363w�� ���L��(j��~��A����ÍM\
Ofi\\\000\031E�쉀\006\033�:ʺu��\024��\010͡�q�\013�C�BA��x�\002�L��/U\035^j\033\006'��Pq\022���\
\006h<\007�18�m\"\020��w<\000�k�\012�\"UQ�g����z.8\022�P\025�t�\026�n��٠�}°����̭\\�\
\024\017��'�ʑɞy��&bt{O��\027\025Kh����#\036ŠdUe\036�����A��T\031�F\033)��\022�!ʝ��*\
.#�>lϛA�9��si��6;Ȼ�\"ﶓ�b1���ٺ���\036�|\000\000���R=�O\035�d;&bh\006:\002](\
(��@�\015\025\011\026\034���SY��\010�Z0&\000\003\011!�\0009�·/ng�W'��\\�\023O�I��\011\027\016�R�cE�}5�\
˾\031-@�å�ץ�Ǧ�!�pzts��\033�;\011��>{�IErSJ�Ք����\006\000\020Bh�\013p٣܎�\0216�\
J)�\000R�{{eʛc\002\000d�s�5�>JI�8ɣ\034������\002IJ�\007��\011\032\010 b�I�\026\003�IǗ-3��\
�5���@g�\007SW�aDN�M@�\030�\021\001H)ͺj�\000\023��\016\001B\001$\031\017z�\020�.��\0345\000��:�L\013ң�\
�(6H�']3��1���K\021{��Ԥ�sn\\�8\"����1�,�e_c\023��&�(\002�a�0�\031��=��'��\
z��\001\004�q�i\006��g21�\0112��}?�\014���|\004l���u�\013!�'�и�5R���zKd����Ez��h\
7�X�b&L(@����Ʃoi�62CJ�\033���\004R���\023\034���0\003��\011B���؋_ c��df\026G7\007�\
]L�������\000\000�\026���;Z4\025\026M\001�>\007S����r\005y�\025�Eh6�M\003�B����ޘK�\037�C����\
�6lb�߄s��\031|�����t՝����gEau���\011t\020�q�ʐ��6�O\024\033�\017\004�-t�s��\035��\
&�Զ•f0Ñ�\035\015X�\017p�����>>�RZB���4.-�B��\031�n`6]�����\021\001�A\030z2�fNf\
������co�\013-]�o��;X���\012�s$��{R�֡z-A��I���h�\000��\0166Yayv�\000C@4`��\
`���D(����n\037��\020\007�����\012@��\000�\007�\022��o�~�\000\000\000\000IEND�B`�"
# end
data = b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\x00\tpHYs\x00\x00\r\xd7\x00\x00\r\xd7\x01B(\x9bx\x00\x00\x00\x19tEXtSoftware\x00www.inkscape.org\x9b\xee<\x1a\x00\x00\x05NIDATX\x85\xad\x96mlSU\x18\xc7\x7f\xe7\xf6\xde\xde;\xb6\xb5e\x1b[\xc7\xc6p\x1b\x0c\xc6Xx\x11\x07\x08\x08d\nQ\x03:#/J\xe2\x8cBH4\x98\x88\xa2|1~\x00_\x13\xa2\x89/hLH\xd4\xa0\x19D?\x10\r\x01\x04\x82\t\x0c\xc3\xeb\x82\x04\xd8\x18\xd9\xc6\x06s\xac\xdb\xba\x8e\xb6[o\xef\xf1\xc3^Y[\xd8\xe8\x9e/=}\xce\xf3\xbf\xff_{\x9es\xce\x15RJ\x86\x87\x10\xc2\xa5\xd8(5\x9c\xac\x05\\\x80\x19\np8\x14\xe0w)\xe5\xcd\x08A\x1c!\x86\x02\xec\xdc)\xf2KJx\xfb\xe0a6f\x15\xa0V6`\xebT\xc02\xa1\xbd\x9ep\xfdi\xee\xf8=\x1c\x0cz\xd9"\xa5\xbc;\xa6\x00\xdb\xb6\x89\xf4\xf2r\x8e\x01E3g\xf6N\xdel\x86\xf7\x7f\x82\x8e\xf0\xa0\xa0\xe5*\xa1\xcb\x07\xa8\nv0_Ji\xc5\x0b\xa0\xf4\x0f\xca\xca\xd8\x9a\x944h\x0e0\xc9\r/-\xbcW\x90>\x1d-\x7f\x19\x85\x86\x83\x1d\xf1\x9a\x0f\x00\x08!\xd4\xb446\xd8l\x91\x05+J\xc01,\x97SBb\xb2\x9b\xd7m\x9a\x987&\x00eeL\xad\xa9qe\x07\x83N\x86\xf7\xa4\xaeCnZ\xa4p\xd6:2\x0c\'{\xc6\x04`\xe1B&\xed\xde=\x835kJ\xa9\xa8\xc8\x8f(\x1a\x9f\x14)\xd4\x12@O\xc6%\x84\xb0\xc7\r\xe0\xf5\xd2\xe3\xf1XTW;\xb8v\xcd\x19Q\xa4*\x11)\x00\x9cY\x18\xc0\xf4\xb8\x004C<\xfe\xe5\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\xc4\xde\x98K\xd0\x1f\x86C\xac\x9d\xbb\x94\xef6lb\xbc\xdf\x84s\xf5\xd0\x19|\x80\xb3\x84\xfa\xd3t\xd5\x9d\xa4\xd1\xec\xe1gEau\xd1\xf3\xcc\tt\x10\xbcq\x82\xca\x90\x9f\xfd6\x9dO\x14\x1b\xd5\x0f\x04\xe8\xa3-t\xe7s\xa0\xfc\x1d\xf2\xf2&\xa3\xd4\xb6\xc2\x95f0\xc3\x91\xb5\x1d\rX\x97\x0fp\xbb\xdb\xc7\xd7\xdd>>\x97RZB\x88\xc4\xc44.-\xdaB\xae\xaf\x19\xdan`6]\xc0\xdb\xd5\xc2\xd2\x11\x01\xf4A\x18z2\xeffNf\xf3\xca\xf5\xa4\xa7\xa4co\xbc\x0b-]\xe0o\x85\xae;X\xf5\x95\xdc\n\xb4s$\xd0\xc1{R\xca\xd6\xa1z-A\x94\xeaI\xfc\xa0\xeah\xa1\x00\xad\x81\x0e6Yayv\xc4\x00C@4`\xa9\xe1`\xb9\xa2\xb2D(\xa8\xd2\xe2\xdfn\x1f\x95\xe1\x10\x07\xa5\x94\xcd\xf7\xd1\n@\xe9\xbf\xc4\x00\xfe\x07\x8b\x12\xf3\xe1o\x85~\x9d\x00\x00\x00\x00IEND\xaeB`\x82'
9 changes: 3 additions & 6 deletions snakerunner/squaremap.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import wx.lib.newevent

log = logging.getLogger('squaremap')
#log.setLevel( logging.DEBUG )

SquareHighlightEvent, EVT_SQUARE_HIGHLIGHTED = wx.lib.newevent.NewEvent()
SquareSelectionEvent, EVT_SQUARE_SELECTED = wx.lib.newevent.NewEvent()
Expand Down Expand Up @@ -225,7 +224,7 @@ def SetModel(self, model, adapter=None):
self.UpdateDrawing()

def OnPaint(self, event):
dc = wx.BufferedPaintDC(self, self._buffer)
wx.BufferedPaintDC(self, self._buffer)

def OnSize(self, event):
# The buffer is initialized in here, so that the buffer is always
Expand Down Expand Up @@ -415,9 +414,7 @@ def LayoutChildren(self, dc, children, parent, x, y, w, h, hot_map, depth=0, nod
return

(firstSize, firstNode) = nodes[-1]
fraction = firstSize/float(total)
head_coord, tail_coord = split_box(
firstSize/float(total), x, y, w, h)
head_coord, tail_coord = split_box(firstSize/float(total), x, y, w, h)
if head_coord:
self.DrawBox(
dc, firstNode, head_coord[0], head_coord[1], head_coord[2], head_coord[3],
Expand Down Expand Up @@ -461,7 +458,7 @@ def split_box(fraction, x, y, w, h):

def split_by_value(total, nodes, headdivisor=2.0):
"""Produce, (sum,head),(sum,tail) for nodes to attempt binary partition"""
head_sum, tail_sum = 0, 0
head_sum = 0
divider = 0
for node in nodes[::-1]:
if head_sum < total/headdivisor:
Expand Down
1 change: 0 additions & 1 deletion snakerunner/version.py

This file was deleted.

1 change: 1 addition & 0 deletions snakerunner/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.2.0