diff --git a/libs/pytwmn.py b/libs/pytwmn.py
deleted file mode 100644
index 6b2d774..0000000
--- a/libs/pytwmn.py
+++ /dev/null
@@ -1,76 +0,0 @@
-import os, socket
-
-class TwmnError(Exception):
- UNWN_ERR = -1
- NO_TWMND = -2
- NO_CONF = -3
- def __init__(self, code):
- self.code = code
- def __str__(self):
- if self.code == TwmnError.NO_TWMND:
- return "Unable to connect to twmnd"
- elif self.code == TwmnError.NO_CONF:
- return "Could not find twmn configuration file"
- else:
- return "Unknown twmn error"
-
-
-def confExists():
- try:
- from xdg import BaseDirectory
- return os.path.join(BaseDirectory.xdg_config_home,"twmn/twmn.conf")
- except:
- return False
-
-def init(host="127.0.0.1", port=None):
- if not port:
- port = 9797
- try:
- fn = confExists()
- if not fn:
- return False
- with open(fn) as f:
- for line in f.readlines():
- if line.startswith("port=") and \
- line[5:-1].isdigit():
- port = int(line[5:-1])
- break
- except IOError:
- raise TwmnError(TwmnError.NO_CONF)
- if type(port) == type(str()):
- port = int(port)
- global s
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- s.connect((host, port))
-
-class Notification(object):
- def __init__(self, title="", msg="", icon=""):
- self.title = str(title)
- self.msg = str(msg)
- if icon.startswith("file://"):
- icon = icon[7:]
- self.icon = icon
- self.time = None
-
- def set_duration(self, time):
- self.time = time
-
- def show(self):
- try:
- if self.time is None:
- s.send("" + self.title + ""
- "" + self.msg + ""
- "" + self.icon + "")
- else:
- s.send("" + self.title + ""
- "" + self.msg + ""
- "" + self.icon + ""
- "" + str(self.time) + "")
- except:
- raise TwmnError(TwmnError.NO_TWMND)
-
-if __name__ == "__main__":
- init()
- n = Notification("PyTwmn", "This is a notification!")
- n.set_duration(1000)
- n.show()
diff --git a/menus.py b/menus.py
index 00c803a..b01bb5a 100644
--- a/menus.py
+++ b/menus.py
@@ -1756,7 +1756,7 @@ class AboutPesterchum(QtWidgets.QDialog):
self.mainwindow = parent
self.setStyleSheet(self.mainwindow.theme["main/defaultwindow/style"])
- self.title = QtWidgets.QLabel("P3ST3RCHUM V. %s" % (_pcVersion))
+ self.title = QtWidgets.QLabel("P3ST3RCHUM %s" % (_pcVersion))
self.credits = QtWidgets.QLabel("Programming by:\n\
illuminatedwax (ghostDunk)\n\
Kiooeht (evacipatedBox)\n\
@@ -1766,6 +1766,7 @@ class AboutPesterchum(QtWidgets.QDialog):
Cerxi (binaryCabalist)\n\
Arcane (arcaneAgilmente)\n\
karxi (Midna)\n\
+ Shou :)\n\
\n\
Art by:\n\
Grimlive (aquaMarinist)\n\
diff --git a/pesterchum.py b/pesterchum.py
index b27ea2f..9d54e97 100644
--- a/pesterchum.py
+++ b/pesterchum.py
@@ -74,6 +74,8 @@ if not ((major > 5) or (major == 5 and minor >= 0)):
print("You currently have version " + vnum + ". Please upgrade Qt.")
exit()
+from version import _pcVersion
+
import ostools
# Placed here before importing the rest of pesterchum, since bits of it need
# OSX's data directory and it doesn't hurt to have everything set up before
@@ -127,7 +129,7 @@ import nickservmsgs
# from updatecheck import MSPAChecker
from toast import PesterToastMachine, PesterToast
-from libs import pytwmn
+import pytwmn
from profile import *
canon_handles = ["apocalypseArisen", "arsenicCatnip", "arachnidsGrip", "adiosToreador", \
@@ -2975,7 +2977,7 @@ class MainProgram(QtCore.QObject):
# Back to our scheduled program.
self.app = QtWidgets.QApplication(sys.argv)
- self.app.setApplicationName("Pesterchum 3.14")
+ self.app.setApplicationName("Pesterchum " + _pcVersion)
self.app.setQuitOnLastWindowClosed(False)
options = self.oppts(sys.argv[1:])
diff --git a/setup.py b/setup.py
index cae815e..8092a11 100644
--- a/setup.py
+++ b/setup.py
@@ -1,11 +1,11 @@
# Windows-only cx_freeze setup file
from cx_Freeze import setup, Executable
import sys
-import os
-import shutil
+
+from version import buildVersion
if sys.version_info < (3, 0, 0):
- sys.exit("Python3 versions lower than 3 are not supported.")
+ sys.exit("Python versions lower than 3 are not supported.")
def is_64bit() -> bool:
return sys.maxsize > 2**32
@@ -13,47 +13,41 @@ def is_64bit() -> bool:
if sys.platform == "win32":
base = "Win32GUI"
else:
- base = "Console"
+ sys.exit("This script won't work on this platform 3")
+includefiles = ["quirks",
+ "smilies",
+ "themes",
+ "README.md",
+ "README-karxi.mkdn",
+ "README-pesterchum.mkdn",
+ "themes.txt",
+ "server.json",
+ "PCskins.png",
+ "Pesterchum.png"]
build_exe_options = {
- "includes": ["requests","urllib"],
- 'excludes': ['collections.sys',
- 'collections._sre',
- 'collections._json',
- 'collections._locale',
- 'collections._struct',
- 'collections.array',
- 'collections._weakref'],
+ "includes": ["requests","urllib","pytwmn"],
+ "excludes": ["collections.sys",
+ "collections._sre",
+ "collections._json",
+ "collections._locale",
+ "collections._struct",
+ "collections.array",
+ "collections._weakref"],
+ 'include_files': includefiles
+ #'build_exe': ["build"]
}
-if is_64bit() == true:
+#print("type(includefiles) = " + str(type(includefiles)))
+#print("type(build_exe_options) = " + str(type(build_exe_options))
+
+if is_64bit() == True:
setup(
- name = "PESTERCHUM",
- version = "3.41",
- description = "P3ST3RCHUM",
+ name = "PESTERCHUM ALT.",
+ version = buildVersion,
+ url = "https://github.com/Dpeta/pesterchum-alt-servers",
+ description = "P3ST3RCHUM ALT.",
options = {"build_exe": build_exe_options},
executables = [Executable("pesterchum.py",
base=base,
- compress=True,
- icon="pesterchum.ico",
- build_exe: 'build\Pesterchum\'
+ icon="pesterchum.ico"
)])
- if sys.platform == "win32":
- os.rename("build/exe.win-amd64-2.7", "build/pesterchum")
-else:
- pass
-#Replace exe.win-amd64-2.7 with whatever it seems to generate as for you.
-
-
-shutil.copytree("themes", "build/pesterchum/themes")
-shutil.copytree("smilies", "build/pesterchum/smilies")
-shutil.copytree("quirks", "build/pesterchum/quirks")
-shutil.copy("pesterchum.nsi", "build/pesterchum/")
-shutil.copy("pesterchum-update.nsi", "build/pesterchum/")
-os.mkdir("build/pesterchum/profiles")
-os.mkdir("build/pesterchum/logs")
-
-#Readme & txt
-shutil.copy("README.md", "build/pesterchum/")
-shutil.copy("README-pesterchum.mkdn", "build/pesterchum/")
-shutil.copy("README-karxi.mkdn", "build/pesterchum/")
-shutil.copy("themes.txt", "build/pesterchum/")
diff --git a/toast.py b/toast.py
index 454eee9..7300046 100644
--- a/toast.py
+++ b/toast.py
@@ -147,7 +147,7 @@ class ToastMachine(object):
return
#self.type = type = "default"
elif type == "twmn":
- from libs import pytwmn
+ import pytwmn
try:
pytwmn.init()
except pytwmn.ERROR as e:
diff --git a/version.py b/version.py
index f28bac1..dfe0831 100644
--- a/version.py
+++ b/version.py
@@ -1 +1,2 @@
_pcVersion = "Alt. 2.0"
+buildVersion = "2.0"