Skip to content

Commit f31162d

Browse files
committed
Add venv folder
1 parent 8280798 commit f31162d

File tree

3,005 files changed

+946587
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,005 files changed

+946587
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.venv
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Metadata-Version: 2.1
2+
Name: MouseInfo
3+
Version: 0.1.3
4+
Summary: An application to display XY position and RGB color information for the pixel currently under the mouse. Works on Python 2 and 3.
5+
Home-page: https://github.com/asweigart/mouseinfo
6+
Author: Al Sweigart
7+
Author-email: al@inventwithpython.com
8+
License: GPLv3+
9+
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
10+
Classifier: Programming Language :: Python
11+
Classifier: Programming Language :: Python :: 2
12+
Classifier: Programming Language :: Python :: 2.7
13+
Classifier: Programming Language :: Python :: 3
14+
Classifier: Programming Language :: Python :: 3.2
15+
Classifier: Programming Language :: Python :: 3.3
16+
Classifier: Programming Language :: Python :: 3.4
17+
Classifier: Programming Language :: Python :: 3.5
18+
Classifier: Programming Language :: Python :: 3.6
19+
Classifier: Programming Language :: Python :: 3.7
20+
Description-Content-Type: text/markdown
21+
22+
MouseInfo
23+
======
24+
25+
An application to display XY position and RGB color information for the pixel currently under the mouse. Works on Python 2 and 3. This is useful for GUI automation planning.
26+
27+
The full documentation is at https://mouseinfo.readthedocs.io/en/latest/
28+
29+
Installation
30+
------------
31+
32+
To install with pip, run:
33+
34+
pip install mouseinfo
35+
36+
Quickstart Guide
37+
----------------
38+
39+
To run this application, enter the following into the terminal:
40+
41+
python3 -m mouseinfo
42+
43+
Or for Python 2, run:
44+
45+
python -m mouseinfo
46+
47+
Alternatively, to run it from the interactive shell or a Python program:
48+
49+
>>> import mouseinfo
50+
>>> mouseinfo.mouseInfo()
51+
52+
The Mouse Info application displays the current XY coordinates of the mouse cursor, as well as the RGB color information of the pixel directly under the cursor. This can be useful for planning out GUI automation tests where the mouse is controlled by a script (such as a Python script with PyAutoGUI) to click on the screen at specific coordinates.
53+
54+
The "Copy" buttons will copy this mouse information to the clipboard, while the "Log" buttons will add this mouse information to the text field in the application. The RGB color information is given as a comman-delimited, three-integer red, green, and blue values as decimals from 0 to 255. The hex values of the RGB value is also given.
55+
56+
For practical use, you should set the keyboard focus on these buttons by tabbing over them. This leaves you free to move the mouse into position and then press space or Enter to log the current mouse coordinates/RGB value.
57+
58+
The contents of the log text field can be saved by clicking "Save Log". This will automatically overwrite any file with the provided name. A screenshot can also be saved by clicking "Save Screenshot"
59+
60+
Contribute
61+
----------
62+
63+
If you'd like to contribute to MouseInfo, check out https://github.com/asweigart/mouseinfo
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
MANIFEST.in
2+
README.md
3+
setup.cfg
4+
setup.py
5+
src/MouseInfo.egg-info/PKG-INFO
6+
src/MouseInfo.egg-info/SOURCES.txt
7+
src/MouseInfo.egg-info/dependency_links.txt
8+
src/MouseInfo.egg-info/requires.txt
9+
src/MouseInfo.egg-info/top_level.txt
10+
src/mouseinfo/__init__.py
11+
src/mouseinfo/__main__.py
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
..\mouseinfo\__init__.py
2+
..\mouseinfo\__main__.py
3+
..\mouseinfo\__pycache__\__init__.cpython-310.pyc
4+
..\mouseinfo\__pycache__\__main__.cpython-310.pyc
5+
PKG-INFO
6+
SOURCES.txt
7+
dependency_links.txt
8+
requires.txt
9+
top_level.txt
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
pyperclip
2+
3+
[:platform_system == "Darwin"]
4+
rubicon-objc
5+
6+
[:platform_system == "Linux" and python_version < "3.0"]
7+
Xlib
8+
9+
[:platform_system == "Linux" and python_version >= "3.0"]
10+
python3-Xlib
11+
12+
[:python_version == "2.7"]
13+
Pillow>=2.0.0
14+
15+
[:python_version == "3.2"]
16+
Pillow<=3.4.2,>=2.0.0
17+
18+
[:python_version == "3.3"]
19+
Pillow<=4.3.0,>=2.0.0
20+
21+
[:python_version == "3.4"]
22+
Pillow<=5.4.1,>=2.5.0
23+
24+
[:python_version == "3.5"]
25+
Pillow>=3.2.0
26+
27+
[:python_version == "3.6"]
28+
Pillow>=4.0.0
29+
30+
[:python_version == "3.7"]
31+
Pillow>=5.2.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mouseinfo
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
#
2+
# The Python Imaging Library
3+
# $Id$
4+
#
5+
# bitmap distribution font (bdf) file parser
6+
#
7+
# history:
8+
# 1996-05-16 fl created (as bdf2pil)
9+
# 1997-08-25 fl converted to FontFile driver
10+
# 2001-05-25 fl removed bogus __init__ call
11+
# 2002-11-20 fl robustification (from Kevin Cazabon, Dmitry Vasiliev)
12+
# 2003-04-22 fl more robustification (from Graham Dumpleton)
13+
#
14+
# Copyright (c) 1997-2003 by Secret Labs AB.
15+
# Copyright (c) 1997-2003 by Fredrik Lundh.
16+
#
17+
# See the README file for information on usage and redistribution.
18+
#
19+
20+
"""
21+
Parse X Bitmap Distribution Format (BDF)
22+
"""
23+
24+
25+
from . import FontFile, Image
26+
27+
bdf_slant = {
28+
"R": "Roman",
29+
"I": "Italic",
30+
"O": "Oblique",
31+
"RI": "Reverse Italic",
32+
"RO": "Reverse Oblique",
33+
"OT": "Other",
34+
}
35+
36+
bdf_spacing = {"P": "Proportional", "M": "Monospaced", "C": "Cell"}
37+
38+
39+
def bdf_char(f):
40+
# skip to STARTCHAR
41+
while True:
42+
s = f.readline()
43+
if not s:
44+
return None
45+
if s[:9] == b"STARTCHAR":
46+
break
47+
id = s[9:].strip().decode("ascii")
48+
49+
# load symbol properties
50+
props = {}
51+
while True:
52+
s = f.readline()
53+
if not s or s[:6] == b"BITMAP":
54+
break
55+
i = s.find(b" ")
56+
props[s[:i].decode("ascii")] = s[i + 1 : -1].decode("ascii")
57+
58+
# load bitmap
59+
bitmap = []
60+
while True:
61+
s = f.readline()
62+
if not s or s[:7] == b"ENDCHAR":
63+
break
64+
bitmap.append(s[:-1])
65+
bitmap = b"".join(bitmap)
66+
67+
[x, y, l, d] = [int(p) for p in props["BBX"].split()]
68+
[dx, dy] = [int(p) for p in props["DWIDTH"].split()]
69+
70+
bbox = (dx, dy), (l, -d - y, x + l, -d), (0, 0, x, y)
71+
72+
try:
73+
im = Image.frombytes("1", (x, y), bitmap, "hex", "1")
74+
except ValueError:
75+
# deal with zero-width characters
76+
im = Image.new("1", (x, y))
77+
78+
return id, int(props["ENCODING"]), bbox, im
79+
80+
81+
class BdfFontFile(FontFile.FontFile):
82+
"""Font file plugin for the X11 BDF format."""
83+
84+
def __init__(self, fp):
85+
super().__init__()
86+
87+
s = fp.readline()
88+
if s[:13] != b"STARTFONT 2.1":
89+
msg = "not a valid BDF file"
90+
raise SyntaxError(msg)
91+
92+
props = {}
93+
comments = []
94+
95+
while True:
96+
s = fp.readline()
97+
if not s or s[:13] == b"ENDPROPERTIES":
98+
break
99+
i = s.find(b" ")
100+
props[s[:i].decode("ascii")] = s[i + 1 : -1].decode("ascii")
101+
if s[:i] in [b"COMMENT", b"COPYRIGHT"]:
102+
if s.find(b"LogicalFontDescription") < 0:
103+
comments.append(s[i + 1 : -1].decode("ascii"))
104+
105+
while True:
106+
c = bdf_char(fp)
107+
if not c:
108+
break
109+
id, ch, (xy, dst, src), im = c
110+
if 0 <= ch < len(self.glyph):
111+
self.glyph[ch] = xy, dst, src, im

0 commit comments

Comments
 (0)