Merge branch 'master' of git://github.com/Lexicality/pesterchum
|
@ -19,5 +19,5 @@ if [ -e makefile ]
|
||||||
then
|
then
|
||||||
make clean
|
make clean
|
||||||
fi
|
fi
|
||||||
./configure --enable-framework --enable-universalsdk=/ --with-universal-archs=intel MACOSX_DEPLOYMENT_TARGET=10.6
|
./configure --enable-framework --enable-universalsdk=/ --with-universal-archs=intel MACOSX_DEPLOYMENT_TARGET=10.5
|
||||||
echo "---~ Done ~---"
|
echo "---~ Done ~---"
|
||||||
|
|
|
@ -16,6 +16,6 @@ then
|
||||||
make clean
|
make clean
|
||||||
fi
|
fi
|
||||||
python configure.py --arch=i386 --arch=x86_64 \
|
python configure.py --arch=i386 --arch=x86_64 \
|
||||||
--universal --deployment-target=10.6 \
|
--universal --deployment-target=10.5 \
|
||||||
--destdir=/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/
|
--destdir=/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/
|
||||||
echo "---~ Done ~---"
|
echo "---~ Done ~---"
|
||||||
|
|
23
MacBuild/conv3rt.sh
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Lex's gif->png script
|
||||||
|
|
||||||
|
for file in *.gif
|
||||||
|
do
|
||||||
|
convert ${file} ${file:0:$((${#file}-3))}"png"
|
||||||
|
done
|
||||||
|
|
||||||
|
for file in `ls | grep -G -e "-[1-9]\+.png"`
|
||||||
|
do
|
||||||
|
rm $file
|
||||||
|
done
|
||||||
|
|
||||||
|
for file in `ls | grep -e "-0.png"`
|
||||||
|
do
|
||||||
|
newfile=`echo $file | sed -e 's|\(.*\)-0.png|\1.png|'`
|
||||||
|
mv $file $newfile
|
||||||
|
done
|
||||||
|
|
||||||
|
# for file in *.gif
|
||||||
|
# do
|
||||||
|
# rm ${file:0:$((${#file}-3))}"png"
|
||||||
|
# done
|
4
convo.py
|
@ -345,6 +345,10 @@ class PesterText(QtGui.QTextEdit):
|
||||||
"%s: " % (initials)]
|
"%s: " % (initials)]
|
||||||
lexmsg.append(colorEnd("</c>"))
|
lexmsg.append(colorEnd("</c>"))
|
||||||
self.append("<span style=\"color:#000000\">" + time + convertTags(lexmsg) + "</span>")
|
self.append("<span style=\"color:#000000\">" + time + convertTags(lexmsg) + "</span>")
|
||||||
|
#self.append('<img src="/Users/lexi/pesterchum-lex/smilies/tab.gif" />'
|
||||||
|
# + '<img src="/Users/lexi/pesterchum/smilies/tab.gif" />'
|
||||||
|
# + '<img src="/Applications/Pesterchum.app/Contents/Resources/smilies/tab.gif" />'
|
||||||
|
# + '<img src="smilies/tab.gif" />');
|
||||||
if chum is me:
|
if chum is me:
|
||||||
window.chatlog.log(parent.chum.handle, lexmsg)
|
window.chatlog.log(parent.chum.handle, lexmsg)
|
||||||
else:
|
else:
|
||||||
|
|
6
irc.py
|
@ -11,6 +11,10 @@ from dataobjs import Mood, PesterProfile
|
||||||
from generic import PesterList
|
from generic import PesterList
|
||||||
from version import _pcVersion
|
from version import _pcVersion
|
||||||
|
|
||||||
|
import ostools
|
||||||
|
if ostools.isOSXBundle():
|
||||||
|
logging.basicConfig(level=logging.WARNING)
|
||||||
|
else:
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
class PesterIRC(QtCore.QThread):
|
class PesterIRC(QtCore.QThread):
|
||||||
|
@ -396,7 +400,7 @@ class PesterHandler(DefaultCommandHandler):
|
||||||
helpers.nick(self.client, newnick)
|
helpers.nick(self.client, newnick)
|
||||||
self.parent.nickCollision.emit(nick, newnick)
|
self.parent.nickCollision.emit(nick, newnick)
|
||||||
def quit(self, nick, reason):
|
def quit(self, nick, reason):
|
||||||
print reason
|
#print reason
|
||||||
handle = nick[0:nick.find("!")]
|
handle = nick[0:nick.find("!")]
|
||||||
server = self.parent.mainwindow.config.server()
|
server = self.parent.mainwindow.config.server()
|
||||||
baseserver = server[server.rfind(".", 0, server.rfind(".")):]
|
baseserver = server[server.rfind(".", 0, server.rfind(".")):]
|
||||||
|
|
11
logviewer.py
|
@ -1,6 +1,7 @@
|
||||||
import os, sys
|
import os, sys
|
||||||
import codecs
|
import codecs
|
||||||
import re
|
import re
|
||||||
|
import ostools
|
||||||
from time import strftime, strptime
|
from time import strftime, strptime
|
||||||
from PyQt4 import QtGui, QtCore
|
from PyQt4 import QtGui, QtCore
|
||||||
from generic import RightClickList, RightClickTree
|
from generic import RightClickList, RightClickTree
|
||||||
|
@ -41,9 +42,6 @@ class PesterLogUserSelect(QtGui.QDialog):
|
||||||
self.theme = theme
|
self.theme = theme
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.handle = parent.profile().handle
|
self.handle = parent.profile().handle
|
||||||
if sys.platform != "darwin":
|
|
||||||
self.logpath = "logs"
|
|
||||||
else:
|
|
||||||
self.logpath = _datadir+"logs"
|
self.logpath = _datadir+"logs"
|
||||||
|
|
||||||
self.setStyleSheet(self.theme["main/defaultwindow/style"])
|
self.setStyleSheet(self.theme["main/defaultwindow/style"])
|
||||||
|
@ -125,8 +123,8 @@ class PesterLogUserSelect(QtGui.QDialog):
|
||||||
|
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def openDir(self):
|
def openDir(self):
|
||||||
if sys.platform == "darwin":
|
if ostools.isOSX():
|
||||||
_datadir = os.path.join(str(QtGui.QDesktopServices.storageLocation(QtGui.QDesktopServices.DataLocation)),"Pesterchum/")
|
_datadir = ostools.getDataDir()
|
||||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + os.path.join(_datadir, "logs"), QtCore.QUrl.TolerantMode))
|
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + os.path.join(_datadir, "logs"), QtCore.QUrl.TolerantMode))
|
||||||
else:
|
else:
|
||||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + os.path.join(os.getcwd(), "logs"), QtCore.QUrl.TolerantMode))
|
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + os.path.join(os.getcwd(), "logs"), QtCore.QUrl.TolerantMode))
|
||||||
|
@ -143,9 +141,6 @@ class PesterLogViewer(QtGui.QDialog):
|
||||||
self.handle = parent.profile().handle
|
self.handle = parent.profile().handle
|
||||||
self.chum = chum
|
self.chum = chum
|
||||||
self.convos = {}
|
self.convos = {}
|
||||||
if sys.platform != "darwin":
|
|
||||||
self.logpath = "logs"
|
|
||||||
else:
|
|
||||||
self.logpath = _datadir+"logs"
|
self.logpath = _datadir+"logs"
|
||||||
|
|
||||||
self.setStyleSheet(self.theme["main/defaultwindow/style"])
|
self.setStyleSheet(self.theme["main/defaultwindow/style"])
|
||||||
|
|
1
memos.py
|
@ -1244,3 +1244,4 @@ class PesterMemo(PesterConvo):
|
||||||
timelist = ["0:00", "0:01", "0:02", "0:04", "0:06", "0:10", "0:14", "0:22", "0:30", "0:41", "1:00", "1:34", "2:16", "3:14", "4:13", "4:20", "5:25", "6:12", "7:30", "8:44", "10:25", "11:34", "14:13", "16:12", "17:44", "22:22", "25:10", "33:33", "42:00", "43:14", "50:00", "62:12", "75:00", "88:44", "100", "133", "143", "188", "200", "222", "250", "314", "333", "413", "420", "500", "600", "612", "888", "1000", "1025"]
|
timelist = ["0:00", "0:01", "0:02", "0:04", "0:06", "0:10", "0:14", "0:22", "0:30", "0:41", "1:00", "1:34", "2:16", "3:14", "4:13", "4:20", "5:25", "6:12", "7:30", "8:44", "10:25", "11:34", "14:13", "16:12", "17:44", "22:22", "25:10", "33:33", "42:00", "43:14", "50:00", "62:12", "75:00", "88:44", "100", "133", "143", "188", "200", "222", "250", "314", "333", "413", "420", "500", "600", "612", "888", "1000", "1025"]
|
||||||
|
|
||||||
timedlist = [timedelta(0), timedelta(0, 60), timedelta(0, 120), timedelta(0, 240), timedelta(0, 360), timedelta(0, 600), timedelta(0, 840), timedelta(0, 1320), timedelta(0, 1800), timedelta(0, 2460), timedelta(0, 3600), timedelta(0, 5640), timedelta(0, 8160), timedelta(0, 11640), timedelta(0, 15180), timedelta(0, 15600), timedelta(0, 19500), timedelta(0, 22320), timedelta(0, 27000), timedelta(0, 31440), timedelta(0, 37500), timedelta(0, 41640), timedelta(0, 51180), timedelta(0, 58320), timedelta(0, 63840), timedelta(0, 80520), timedelta(1, 4200), timedelta(1, 34380), timedelta(1, 64800), timedelta(1, 69240), timedelta(2, 7200), timedelta(2, 51120), timedelta(3, 10800), timedelta(3, 60240), timedelta(4, 14400), timedelta(5, 46800), timedelta(5, 82800), timedelta(7, 72000), timedelta(8, 28800), timedelta(9, 21600), timedelta(10, 36000), timedelta(13, 7200), timedelta(13, 75600), timedelta(17, 18000), timedelta(17, 43200), timedelta(20, 72000), timedelta(25), timedelta(25, 43200), timedelta(37), timedelta(41, 57600), timedelta(42, 61200)]
|
timedlist = [timedelta(0), timedelta(0, 60), timedelta(0, 120), timedelta(0, 240), timedelta(0, 360), timedelta(0, 600), timedelta(0, 840), timedelta(0, 1320), timedelta(0, 1800), timedelta(0, 2460), timedelta(0, 3600), timedelta(0, 5640), timedelta(0, 8160), timedelta(0, 11640), timedelta(0, 15180), timedelta(0, 15600), timedelta(0, 19500), timedelta(0, 22320), timedelta(0, 27000), timedelta(0, 31440), timedelta(0, 37500), timedelta(0, 41640), timedelta(0, 51180), timedelta(0, 58320), timedelta(0, 63840), timedelta(0, 80520), timedelta(1, 4200), timedelta(1, 34380), timedelta(1, 64800), timedelta(1, 69240), timedelta(2, 7200), timedelta(2, 51120), timedelta(3, 10800), timedelta(3, 60240), timedelta(4, 14400), timedelta(5, 46800), timedelta(5, 82800), timedelta(7, 72000), timedelta(8, 28800), timedelta(9, 21600), timedelta(10, 36000), timedelta(13, 7200), timedelta(13, 75600), timedelta(17, 18000), timedelta(17, 43200), timedelta(20, 72000), timedelta(25), timedelta(25, 43200), timedelta(37), timedelta(41, 57600), timedelta(42, 61200)]
|
||||||
|
|
||||||
|
|
4
menus.py
|
@ -1,5 +1,5 @@
|
||||||
from PyQt4 import QtGui, QtCore
|
from PyQt4 import QtGui, QtCore
|
||||||
import re
|
import re, ostools
|
||||||
|
|
||||||
from os import remove
|
from os import remove
|
||||||
from generic import RightClickList, RightClickTree, MultiTextDialog
|
from generic import RightClickList, RightClickTree, MultiTextDialog
|
||||||
|
@ -984,6 +984,7 @@ class PesterOptions(QtGui.QDialog):
|
||||||
if self.config.opvoiceMessages():
|
if self.config.opvoiceMessages():
|
||||||
self.memomessagecheck.setChecked(True)
|
self.memomessagecheck.setChecked(True)
|
||||||
|
|
||||||
|
if not ostools.isOSXBundle():
|
||||||
self.animationscheck = QtGui.QCheckBox("Use animated smilies", self)
|
self.animationscheck = QtGui.QCheckBox("Use animated smilies", self)
|
||||||
if self.config.animations():
|
if self.config.animations():
|
||||||
self.animationscheck.setChecked(True)
|
self.animationscheck.setChecked(True)
|
||||||
|
@ -1121,6 +1122,7 @@ class PesterOptions(QtGui.QDialog):
|
||||||
layout_chat.addWidget(self.timestampBox)
|
layout_chat.addWidget(self.timestampBox)
|
||||||
layout_chat.addWidget(self.secondscheck)
|
layout_chat.addWidget(self.secondscheck)
|
||||||
layout_chat.addWidget(self.memomessagecheck)
|
layout_chat.addWidget(self.memomessagecheck)
|
||||||
|
if not ostools.isOSXBundle():
|
||||||
layout_chat.addWidget(self.animationscheck)
|
layout_chat.addWidget(self.animationscheck)
|
||||||
layout_chat.addWidget(animateLabel)
|
layout_chat.addWidget(animateLabel)
|
||||||
if parent.randhandler.running:
|
if parent.randhandler.running:
|
||||||
|
|
18
ostools.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
from os import path
|
||||||
|
from sys import platform
|
||||||
|
from PyQt4.QtGui import QDesktopServices
|
||||||
|
|
||||||
|
def isOSX():
|
||||||
|
return platform == "darwin"
|
||||||
|
|
||||||
|
def isWin32():
|
||||||
|
return platform == "win32"
|
||||||
|
|
||||||
|
def isOSXBundle():
|
||||||
|
return isOSX() and (path.abspath('.').find(".app") != -1)
|
||||||
|
|
||||||
|
def getDataDir():
|
||||||
|
if isOSX():
|
||||||
|
return path.join(str(QDesktopServices.storageLocation(QDesktopServices.DataLocation)), "Pesterchum/")
|
||||||
|
else:
|
||||||
|
return ''
|
|
@ -1,5 +1,6 @@
|
||||||
import re
|
import re
|
||||||
import random
|
import random
|
||||||
|
import ostools
|
||||||
from copy import copy
|
from copy import copy
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
@ -372,45 +373,45 @@ def img2smiley(string):
|
||||||
return string
|
return string
|
||||||
|
|
||||||
smiledict = {
|
smiledict = {
|
||||||
":rancorous:": "pc_rancorous.gif",
|
":rancorous:": "pc_rancorous.png",
|
||||||
":apple:": "apple.gif",
|
":apple:": "apple.png",
|
||||||
":bathearst:": "bathearst.gif",
|
":bathearst:": "bathearst.png",
|
||||||
":cathearst:": "cathearst.png",
|
":cathearst:": "cathearst.png",
|
||||||
":woeful:": "pc_bemused.gif",
|
":woeful:": "pc_bemused.png",
|
||||||
":sorrow:": "blacktear.gif",
|
":sorrow:": "blacktear.png",
|
||||||
":pleasant:": "pc_pleasant.gif",
|
":pleasant:": "pc_pleasant.png",
|
||||||
":blueghost:": "blueslimer.gif",
|
":blueghost:": "blueslimer.gif",
|
||||||
":slimer:": "slimer.gif",
|
":slimer:": "slimer.gif",
|
||||||
":candycorn:": "candycorn.gif",
|
":candycorn:": "candycorn.png",
|
||||||
":cheer:": "cheer.gif",
|
":cheer:": "cheer.gif",
|
||||||
":duhjohn:": "confusedjohn.gif",
|
":duhjohn:": "confusedjohn.gif",
|
||||||
":datrump:": "datrump.gif",
|
":datrump:": "datrump.png",
|
||||||
":facepalm:": "facepalm.gif",
|
":facepalm:": "facepalm.png",
|
||||||
":bonk:": "headbonk.gif",
|
":bonk:": "headbonk.gif",
|
||||||
":mspa:": "mspa_face.gif",
|
":mspa:": "mspa_face.png",
|
||||||
":gun:": "mspa_reader.gif",
|
":gun:": "mspa_reader.gif",
|
||||||
":cal:": "lilcal.png",
|
":cal:": "lilcal.png",
|
||||||
":amazedfirman:": "pc_amazedfirman.gif",
|
":amazedfirman:": "pc_amazedfirman.png",
|
||||||
":amazed:": "pc_amazed.gif",
|
":amazed:": "pc_amazed.png",
|
||||||
":chummy:": "pc_chummy.gif",
|
":chummy:": "pc_chummy.png",
|
||||||
":cool:": "pccool.gif",
|
":cool:": "pccool.png",
|
||||||
":smooth:": "pccool.gif",
|
":smooth:": "pccool.png",
|
||||||
":distraughtfirman": "pc_distraughtfirman.gif",
|
":distraughtfirman": "pc_distraughtfirman.png",
|
||||||
":distraught:": "pc_distraught.gif",
|
":distraught:": "pc_distraught.png",
|
||||||
":insolent:": "pc_insolent.gif",
|
":insolent:": "pc_insolent.png",
|
||||||
":bemused:": "pc_bemused.gif",
|
":bemused:": "pc_bemused.png",
|
||||||
":3:": "pckitty.gif",
|
":3:": "pckitty.png",
|
||||||
":mystified:": "pc_mystified.gif",
|
":mystified:": "pc_mystified.png",
|
||||||
":pranky:": "pc_pranky.gif",
|
":pranky:": "pc_pranky.png",
|
||||||
":tense:": "pc_tense.gif",
|
":tense:": "pc_tense.png",
|
||||||
":record:": "record.gif",
|
":record:": "record.gif",
|
||||||
":squiddle:": "squiddle.gif",
|
":squiddle:": "squiddle.gif",
|
||||||
":tab:": "tab.gif",
|
":tab:": "tab.gif",
|
||||||
":beetip:": "theprofessor.gif",
|
":beetip:": "theprofessor.png",
|
||||||
":flipout:": "weasel.gif",
|
":flipout:": "weasel.gif",
|
||||||
":befuddled:": "what.gif",
|
":befuddled:": "what.png",
|
||||||
":pumpkin:": "whatpumpkin.gif",
|
":pumpkin:": "whatpumpkin.png",
|
||||||
":trollcool:": "trollcool.gif",
|
":trollcool:": "trollcool.png",
|
||||||
":jadecry:": "jadespritehead.gif",
|
":jadecry:": "jadespritehead.gif",
|
||||||
":ecstatic:": "ecstatic.png",
|
":ecstatic:": "ecstatic.png",
|
||||||
":relaxed:": "relaxed.png",
|
":relaxed:": "relaxed.png",
|
||||||
|
@ -422,9 +423,19 @@ smiledict = {
|
||||||
":manipulative:": "manipulative.png",
|
":manipulative:": "manipulative.png",
|
||||||
":vigorous:": "vigorous.png",
|
":vigorous:": "vigorous.png",
|
||||||
":perky:": "perky.png",
|
":perky:": "perky.png",
|
||||||
":acceptant:": "acceptant.gif",
|
":acceptant:": "acceptant.png",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ostools.isOSXBundle():
|
||||||
|
for emote in smiledict:
|
||||||
|
graphic = smiledict[emote]
|
||||||
|
if graphic.find(".gif"):
|
||||||
|
graphic = graphic.replace(".gif", ".png")
|
||||||
|
smiledict[emote] = graphic
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
reverse_smiley = dict((v,k) for k, v in smiledict.iteritems())
|
reverse_smiley = dict((v,k) for k, v in smiledict.iteritems())
|
||||||
_smilere = re.compile("|".join(smiledict.keys()))
|
_smilere = re.compile("|".join(smiledict.keys()))
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import codecs
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
import platform
|
import platform
|
||||||
|
import ostools
|
||||||
from time import strftime, time
|
from time import strftime, time
|
||||||
import threading, Queue
|
import threading, Queue
|
||||||
|
|
||||||
|
@ -47,8 +48,9 @@ if not ((major > 4) or (major == 4 and minor >= 6)):
|
||||||
# OSX's data directory and it doesn't hurt to have everything set up before
|
# OSX's data directory and it doesn't hurt to have everything set up before
|
||||||
# plowing on. :o)
|
# plowing on. :o)
|
||||||
# ~Lex
|
# ~Lex
|
||||||
_datadir = os.path.join(str(QtGui.QDesktopServices.storageLocation(QtGui.QDesktopServices.DataLocation)),"Pesterchum/")
|
_datadir = ostools.getDataDir()
|
||||||
if sys.platform == "darwin":
|
# See, what I've done here is that _datadir is '' if we're not on OSX, so the
|
||||||
|
# concatination is the same as if it wasn't there.
|
||||||
if not os.path.exists(_datadir):
|
if not os.path.exists(_datadir):
|
||||||
os.mkdir(_datadir)
|
os.mkdir(_datadir)
|
||||||
if not os.path.exists(_datadir+"profiles"):
|
if not os.path.exists(_datadir+"profiles"):
|
||||||
|
@ -57,15 +59,8 @@ if sys.platform == "darwin":
|
||||||
f = open(_datadir+"pesterchum.js", 'w')
|
f = open(_datadir+"pesterchum.js", 'w')
|
||||||
f.write("{}")
|
f.write("{}")
|
||||||
f.close()
|
f.close()
|
||||||
else:
|
if not os.path.exists(_datadir+"logs"):
|
||||||
if not os.path.exists("logs"):
|
os.mkdir(_datadir+"logs")
|
||||||
os.mkdir("logs")
|
|
||||||
if not os.path.exists("profiles"):
|
|
||||||
os.mkdir("profiles")
|
|
||||||
if not os.path.exists("pesterchum.js"):
|
|
||||||
f = open("pesterchum.js", 'w')
|
|
||||||
f.write("{}")
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
from menus import PesterChooseQuirks, PesterChooseTheme, \
|
from menus import PesterChooseQuirks, PesterChooseTheme, \
|
||||||
PesterChooseProfile, PesterOptions, PesterUserlist, PesterMemoList, \
|
PesterChooseProfile, PesterOptions, PesterUserlist, PesterMemoList, \
|
||||||
|
@ -126,9 +121,6 @@ class PesterLog(object):
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.handle = handle
|
self.handle = handle
|
||||||
self.convos = {}
|
self.convos = {}
|
||||||
if sys.platform != "darwin":
|
|
||||||
self.logpath = "logs"
|
|
||||||
else:
|
|
||||||
self.logpath = _datadir+"logs"
|
self.logpath = _datadir+"logs"
|
||||||
|
|
||||||
def log(self, handle, msg):
|
def log(self, handle, msg):
|
||||||
|
@ -183,9 +175,6 @@ class PesterLog(object):
|
||||||
|
|
||||||
class PesterProfileDB(dict):
|
class PesterProfileDB(dict):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
if sys.platform != "darwin":
|
|
||||||
self.logpath = "logs"
|
|
||||||
else:
|
|
||||||
self.logpath = _datadir+"logs"
|
self.logpath = _datadir+"logs"
|
||||||
|
|
||||||
if not os.path.exists(self.logpath):
|
if not os.path.exists(self.logpath):
|
||||||
|
@ -250,9 +239,6 @@ class PesterProfileDB(dict):
|
||||||
|
|
||||||
class pesterTheme(dict):
|
class pesterTheme(dict):
|
||||||
def __init__(self, name, default=False):
|
def __init__(self, name, default=False):
|
||||||
if sys.platform != "darwin":
|
|
||||||
self.path = "themes/%s" % (name)
|
|
||||||
else:
|
|
||||||
self.path = _datadir+"themes/%s" % (name)
|
self.path = _datadir+"themes/%s" % (name)
|
||||||
if not os.path.exists(self.path):
|
if not os.path.exists(self.path):
|
||||||
self.path = "themes/%s" % (name)
|
self.path = "themes/%s" % (name)
|
||||||
|
@ -329,9 +315,6 @@ class userConfig(object):
|
||||||
# Use for bit flag blink
|
# Use for bit flag blink
|
||||||
self.PBLINK = 1
|
self.PBLINK = 1
|
||||||
self.MBLINK = 2
|
self.MBLINK = 2
|
||||||
if sys.platform != "darwin":
|
|
||||||
self.filename = "pesterchum.js"
|
|
||||||
else:
|
|
||||||
self.filename = _datadir+"pesterchum.js"
|
self.filename = _datadir+"pesterchum.js"
|
||||||
fp = open(self.filename)
|
fp = open(self.filename)
|
||||||
self.config = json.load(fp)
|
self.config = json.load(fp)
|
||||||
|
@ -341,9 +324,6 @@ class userConfig(object):
|
||||||
else:
|
else:
|
||||||
self.userprofile = None
|
self.userprofile = None
|
||||||
|
|
||||||
if sys.platform != "darwin":
|
|
||||||
self.logpath = "logs"
|
|
||||||
else:
|
|
||||||
self.logpath = _datadir+"logs"
|
self.logpath = _datadir+"logs"
|
||||||
|
|
||||||
if not os.path.exists(self.logpath):
|
if not os.path.exists(self.logpath):
|
||||||
|
@ -541,11 +521,13 @@ class userConfig(object):
|
||||||
fp.close()
|
fp.close()
|
||||||
def availableThemes(self):
|
def availableThemes(self):
|
||||||
themes = []
|
themes = []
|
||||||
for dirname, dirnames, filenames in os.walk('themes'):
|
# Load user themes.
|
||||||
|
for dirname, dirnames, filenames in os.walk(_datadir+'themes'):
|
||||||
for d in dirnames:
|
for d in dirnames:
|
||||||
themes.append(d)
|
themes.append(d)
|
||||||
if sys.platform == "darwin":
|
# For OSX, also load embedded themes.
|
||||||
for dirname, dirnames, filenames in os.walk(_datadir+'themes'):
|
if ostools.isOSX():
|
||||||
|
for dirname, dirnames, filenames in os.walk('themes'):
|
||||||
for d in dirnames:
|
for d in dirnames:
|
||||||
if d not in themes:
|
if d not in themes:
|
||||||
themes.append(d)
|
themes.append(d)
|
||||||
|
@ -553,10 +535,7 @@ class userConfig(object):
|
||||||
return themes
|
return themes
|
||||||
def availableProfiles(self):
|
def availableProfiles(self):
|
||||||
profs = []
|
profs = []
|
||||||
if sys.platform == "darwin":
|
|
||||||
profileloc = _datadir+'profiles'
|
profileloc = _datadir+'profiles'
|
||||||
else:
|
|
||||||
profileloc = 'profiles'
|
|
||||||
for dirname, dirnames, filenames in os.walk(profileloc):
|
for dirname, dirnames, filenames in os.walk(profileloc):
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
l = len(filename)
|
l = len(filename)
|
||||||
|
@ -566,9 +545,6 @@ class userConfig(object):
|
||||||
return [userProfile(p) for p in profs]
|
return [userProfile(p) for p in profs]
|
||||||
class userProfile(object):
|
class userProfile(object):
|
||||||
def __init__(self, user):
|
def __init__(self, user):
|
||||||
if sys.platform != "darwin":
|
|
||||||
self.profiledir = "profiles"
|
|
||||||
else:
|
|
||||||
self.profiledir = _datadir+"profiles"
|
self.profiledir = _datadir+"profiles"
|
||||||
|
|
||||||
if type(user) is PesterProfile:
|
if type(user) is PesterProfile:
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import os, sys, imp, re
|
import os, sys, imp, re, ostools
|
||||||
from PyQt4 import QtGui, QtCore
|
from PyQt4 import QtGui, QtCore
|
||||||
|
|
||||||
class PythonQuirks(object):
|
class PythonQuirks(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._datadir = os.path.join(str(QtGui.QDesktopServices.storageLocation(QtGui.QDesktopServices.DataLocation)),"Pesterchum/")
|
self._datadir = ostools.getDataDir()
|
||||||
self.home = os.getcwd()
|
self.home = os.getcwd()
|
||||||
self.quirks = {}
|
self.quirks = {}
|
||||||
self.last = {}
|
self.last = {}
|
||||||
|
@ -18,7 +18,7 @@ class PythonQuirks(object):
|
||||||
for fn in os.listdir(os.path.join(self.home, 'quirks')):
|
for fn in os.listdir(os.path.join(self.home, 'quirks')):
|
||||||
if fn.endswith('.py') and not fn.startswith('_'):
|
if fn.endswith('.py') and not fn.startswith('_'):
|
||||||
filenames.append(os.path.join(self.home, 'quirks', fn))
|
filenames.append(os.path.join(self.home, 'quirks', fn))
|
||||||
if sys.platform == "darwin":
|
if ostools.isOSX():
|
||||||
if not os.path.exists(os.path.join(self._datadir, 'quirks')):
|
if not os.path.exists(os.path.join(self._datadir, 'quirks')):
|
||||||
os.mkdir(os.path.join(self._datadir, 'quirks'))
|
os.mkdir(os.path.join(self._datadir, 'quirks'))
|
||||||
for fn in os.listdir(os.path.join(self._datadir, 'quirks')):
|
for fn in os.listdir(os.path.join(self._datadir, 'quirks')):
|
||||||
|
|
Before ![]() (image error) Size: 357 B |
BIN
smilies/acceptant.png
Normal file
After ![]() (image error) Size: 320 B |
Before ![]() (image error) Size: 287 B |
BIN
smilies/apple.png
Normal file
After ![]() (image error) Size: 430 B |
Before ![]() (image error) Size: 215 B |
BIN
smilies/bathearst.png
Normal file
After ![]() (image error) Size: 381 B |
Before ![]() (image error) Size: 937 B |
BIN
smilies/blacktear.png
Normal file
After ![]() (image error) Size: 303 B |
BIN
smilies/blueslimer.png
Normal file
After ![]() (image error) Size: 416 B |
Before ![]() (image error) Size: 144 B |
BIN
smilies/candycorn.png
Normal file
After ![]() (image error) Size: 313 B |
BIN
smilies/cheer.png
Normal file
After ![]() (image error) Size: 399 B |
BIN
smilies/confusedjohn.png
Normal file
After ![]() (image error) Size: 625 B |
Before ![]() (image error) Size: 279 B |
BIN
smilies/datrump.png
Normal file
After ![]() (image error) Size: 458 B |
Before ![]() (image error) Size: 344 B |
BIN
smilies/facepalm.png
Normal file
After ![]() (image error) Size: 510 B |
BIN
smilies/headbonk.png
Normal file
After ![]() (image error) Size: 594 B |
BIN
smilies/jadespritehead.png
Normal file
After ![]() (image error) Size: 542 B |
Before ![]() (image error) Size: 336 B |
BIN
smilies/mspa_face.png
Normal file
After ![]() (image error) Size: 423 B |
BIN
smilies/mspa_reader.png
Normal file
After ![]() (image error) Size: 379 B |
Before ![]() (image error) Size: 88 B |
BIN
smilies/pc_amazed.png
Normal file
After ![]() (image error) Size: 279 B |
Before ![]() (image error) Size: 117 B |
BIN
smilies/pc_amazedfirman.png
Normal file
After ![]() (image error) Size: 312 B |
Before ![]() (image error) Size: 116 B |
BIN
smilies/pc_bemused.png
Normal file
After ![]() (image error) Size: 297 B |
Before ![]() (image error) Size: 97 B |
BIN
smilies/pc_chummy.png
Normal file
After ![]() (image error) Size: 288 B |
Before ![]() (image error) Size: 84 B |
BIN
smilies/pc_distraught.png
Normal file
After ![]() (image error) Size: 261 B |
Before ![]() (image error) Size: 111 B |
BIN
smilies/pc_distraughtfirman.png
Normal file
After ![]() (image error) Size: 312 B |
Before ![]() (image error) Size: 89 B |
BIN
smilies/pc_insolent.png
Normal file
After ![]() (image error) Size: 283 B |
Before ![]() (image error) Size: 85 B |
BIN
smilies/pc_mystified.png
Normal file
After ![]() (image error) Size: 261 B |
Before ![]() (image error) Size: 83 B |
BIN
smilies/pc_pleasant.png
Normal file
After ![]() (image error) Size: 261 B |
Before ![]() (image error) Size: 81 B |
BIN
smilies/pc_pranky.png
Normal file
After ![]() (image error) Size: 263 B |
Before ![]() (image error) Size: 139 B |
BIN
smilies/pc_rancorous.png
Normal file
After ![]() (image error) Size: 359 B |
Before ![]() (image error) Size: 97 B |
BIN
smilies/pc_tense.png
Normal file
After ![]() (image error) Size: 272 B |
Before ![]() (image error) Size: 131 B |
BIN
smilies/pccool.png
Normal file
After ![]() (image error) Size: 309 B |
Before ![]() (image error) Size: 107 B |
BIN
smilies/pckitty.png
Normal file
After ![]() (image error) Size: 313 B |
BIN
smilies/record.png
Normal file
After ![]() (image error) Size: 386 B |
BIN
smilies/slimer.png
Normal file
After ![]() (image error) Size: 423 B |
BIN
smilies/squiddle.png
Normal file
After ![]() (image error) Size: 333 B |
BIN
smilies/tab.png
Normal file
After ![]() (image error) Size: 1.3 KiB |
Before ![]() (image error) Size: 261 B |
BIN
smilies/theprofessor.png
Normal file
After ![]() (image error) Size: 457 B |
Before ![]() (image error) Size: 111 B |
BIN
smilies/trollcool.png
Normal file
After ![]() (image error) Size: 305 B |
BIN
smilies/weasel.png
Normal file
After ![]() (image error) Size: 493 B |
BIN
smilies/what.gif
Before ![]() (image error) Size: 82 B |
BIN
smilies/what.png
Normal file
After ![]() (image error) Size: 277 B |
Before ![]() (image error) Size: 264 B |
BIN
smilies/whatpumpkin.png
Normal file
After ![]() (image error) Size: 458 B |