Compare commits

..
6 Commits
Author SHA1 Message Date
fwarren aa503941ee move from pywmdockapps to wmdocklib 2026-04-17 19:50:38 -04:00
fwarren 5002d5a8fe fixed wmoo imports 2026-04-17 19:37:50 -04:00
fwarren 1da8287a9d fix __init__.py 2026-04-17 19:31:03 -04:00
fwarren 679ce285b4 further changes to go from wmdocklib to pywmdockapps 2026-04-17 19:29:20 -04:00
fwarren 7a00d8b440 changed wmdocklib to pywmdockapps 2026-04-17 19:16:28 -04:00
fwarren 16ca19db37 added _MEIPASS to read xpm/rgb for pyinstaller 2025-03-09 21:40:26 -06:00
4 changed files with 32 additions and 18 deletions

No files matched your search

+5 -4
View File
@@ -1,12 +1,13 @@
#!/usr/bin/env python #!/usr/bin/env python
from __future__ import absolute_import
from setuptools import setup, Extension
# Set these so they match your system. # Set these so they match your system.
from __future__ import absolute_import
XLibDir = '/usr/lib/x11' XLibDir = '/usr/lib/x11'
XIncludes = '/usr/include/x11' XIncludes = '/usr/include/x11'
from setuptools import setup, Extension # Changed 'wmdocklib.pywmgeneral' -> 'pywmdockapps.pywmgeneral'
# Changed source path 'wmdocklib/pywmgeneral.c' -> 'pywmdockapps/pywmgeneral.c'
pywmgeneral = Extension('wmdocklib.pywmgeneral', pywmgeneral = Extension('wmdocklib.pywmgeneral',
libraries = ['Xpm', 'Xext', 'X11'], libraries = ['Xpm', 'Xext', 'X11'],
library_dirs = [XLibDir], library_dirs = [XLibDir],
@@ -16,7 +17,7 @@ pywmgeneral = Extension('wmdocklib.pywmgeneral',
setup( setup(
name="pywmdockapps", name="pywmdockapps",
version = "$Revision: 1.99 $"[11:-2], version = "$Revision: 1.99 $"[11:-2],
description="This helper functions for windowmaker dockapps\nRead the whole story at http://pywmdockapps.sourceforge.net/", description="This helper functions for windowmaker dockapps",
author="Kristoffer Erlandsson & al.", author="Kristoffer Erlandsson & al.",
author_email="mfrasca@zonnet.nl", author_email="mfrasca@zonnet.nl",
url="http://pywmdockapps.sourceforge.net", url="http://pywmdockapps.sourceforge.net",
+9 -8
View File
@@ -1,12 +1,13 @@
"""\
wmdocklib is a python module that will help you develop WindowMaker dockapps
in python. It is mostly a wrapper around the functions from the popular
wmgeneral.c, but some new functions are added too.
to get help about a contained package, try:
help(wmdocklib.<name>)
""" """
pywmdockapps is a python module that will help you develop WindowMaker dockapps
in python. It is a wrapper around the functions from wmgeneral.c.
To get help about a contained package, try:
help(pywmdockapps.<name>)
"""
from .pywmgeneral import * from .pywmgeneral import *
from .pywmhelpers import * from .pywmhelpers import *
__all__ = ['wmoo'] # __all__ controls what 'from pywmdockapps import *' pulls in.
# If you want users to see 'pywmgeneral' and 'pywmhelpers' too, add them here.
__all__ = ['wmoo', 'pywmgeneral', 'pywmhelpers']
+16 -4
View File
@@ -26,14 +26,14 @@ Some changes to handle the additional event handling in pywmgeneral
First workingish version First workingish version
""" """
import os, re import os, re, sys
import configparser import configparser
charset_start = None charset_start = None
charset_width = None charset_width = None
pattern_start = None pattern_start = None
import wmdocklib.pywmgeneral as pywmgeneral from . import pywmgeneral
defaultRGBFileList = [ defaultRGBFileList = [
'/etc/X11/rgb.txt', '/etc/X11/rgb.txt',
'/usr/lib/X11/rgb.txt', '/usr/lib/X11/rgb.txt',
@@ -145,7 +145,13 @@ def readXPM(fileName):
Raise IOError if we run into trouble when trying to read the file. This Raise IOError if we run into trouble when trying to read the file. This
function has not been tested extensively. do not try to use more than function has not been tested extensively. do not try to use more than
""" """
with open(fileName, 'r') as f: if hasattr(sys, '_MEIPASS'):
base_path = os.path.join(sys._MEIPASS, "wmdocklib")
else:
base_path = "wmdocklib"
filePath = os.path.join(base_path, fileName)
with open(filePath, 'r') as f:
lines = [l.rstrip('\n') for l in f.readlines()] lines = [l.rstrip('\n') for l in f.readlines()]
s = ''.join(lines) s = ''.join(lines)
res = [] res = []
@@ -436,7 +442,13 @@ def getColorCode(colorName, rgbFileName=None):
if rgbFileName is None: if rgbFileName is None:
raise ValueError('cannot find rgb file') raise ValueError('cannot find rgb file')
with open(rgbFileName, 'r') as f: if hasattr(sys, '_MEIPASS'):
base_path = os.path.join(sys._MEIPASS, "wmdocklib")
else:
base_path = "wmdocklib"
rgbFilePath = os.path.join(base_path, rgbFileName)
with open(rgbFilePath, 'r') as f:
lines = f.readlines() lines = f.readlines()
for l in lines: for l in lines:
if l[0] != '!': if l[0] != '!':
+2 -2
View File
@@ -1,6 +1,6 @@
import sys, time import sys, time
import wmdocklib.pywmhelpers as pywmhelpers from . import pywmhelpers as pywmhelpers
import wmdocklib.pywmgeneral as pywmgeneral from . import pywmgeneral as pywmgeneral
debug = 0 debug = 0