diff --git a/TODO b/TODO index 9c08bdc..7f124e1 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,4 @@ Bugs: -* client exits if PC is in tray and convo windows are closed -* save last mood of user * "it's only a few sele¢t letters" <-- unicode error! Features: diff --git a/convo.py b/convo.py index 359c6d7..3d51320 100644 --- a/convo.py +++ b/convo.py @@ -13,6 +13,7 @@ from parsetools import convertTags, lexMessage, mecmd, colorBegin, colorEnd, img class PesterTabWindow(QtGui.QFrame): def __init__(self, mainwindow, parent=None, convo="convo"): QtGui.QFrame.__init__(self, parent) + self.setAttribute(QtCore.Qt.WA_QuitOnClose, False) self.setFocusPolicy(QtCore.Qt.ClickFocus) self.mainwindow = mainwindow @@ -378,6 +379,7 @@ class PesterInput(QtGui.QLineEdit): class PesterConvo(QtGui.QFrame): def __init__(self, chum, initiated, mainwindow, parent=None): QtGui.QFrame.__init__(self, parent) + self.setAttribute(QtCore.Qt.WA_QuitOnClose, False) self.setObjectName(chum.handle) self.setFocusPolicy(QtCore.Qt.ClickFocus) self.chum = chum diff --git a/logs/chums.js b/logs/chums.js index 9d9b2b0..ba19912 100644 --- a/logs/chums.js +++ b/logs/chums.js @@ -1 +1 @@ -{"lyricalKeraunoscopic": {"color": "#00aa00", "handle": "lyricalKeraunoscopic", "mood": "offline"}, "centaursTesticle": {"color": "#000056", "handle": "centaursTesticle", "mood": "offline"}, "greyscalePacifist": {"color": "#7f7f7f", "handle": "greyscalePacifist", "mood": "offline"}, "techturnGodhead": {"color": "#ff0000", "handle": "techturnGodhead", "mood": "offline"}, "insipidTranscient": {"color": "#145064", "handle": "insipidTranscient", "mood": "offline"}, "sanguineViruoso": {"color": "#000000", "handle": "sanguineViruoso", "mood": "offline"}, "agogPorphyry": {"color": "#522d80", "handle": "agogPorphyry", "mood": "offline"}, "aceIsm": {"color": "#ffcc66", "handle": "aceIsm", "mood": "offline"}, "sucroseSaboteur": {"color": "#00e700", "handle": "sucroseSaboteur", "mood": "offline"}, "corruptedInsanity": {"color": "#6c0000", "handle": "corruptedInsanity", "mood": "offline"}, "madLurker": {"color": "#004b00", "handle": "madLurker", "mood": "offline"}, "aquaticMarinist": {"color": "#00caca", "handle": "aquaticMarinist", "mood": "offline"}, "driftingDreamer": {"color": "#b22222", "handle": "driftingDreamer", "mood": "offline"}, "cuttlefishCuller": {"color": "#77003c", "handle": "cuttlefishCuller", "mood": "offline"}, "masterG": {"color": "#77003c", "handle": "masterG", "mood": "offline"}, "carcinoGenetecist": {"color": "#7f7f7f", "handle": "carcinoGenetecist", "mood": "offline"}, "quixoticPaladin": {"color": "#aa00ff", "handle": "quixoticPaladin", "mood": "offline"}, "remoteBloodbath": {"color": "#c70000", "handle": "remoteBloodbath", "mood": "offline"}, "bearNecessities": {"color": "#993300", "handle": "bearNecessities", "mood": "offline"}, "lawdEngrish": {"color": "#00ff00", "handle": "lawdEngrish", "mood": "offline"}, "metaliAggressive": {"color": "#9289d5", "handle": "metaliAggressive", "mood": "offline"}, "serpentineHerbalist": {"color": "#0000c8", "handle": "serpentineHerbalist", "mood": "offline"}, "ascendedAria": {"color": "#df8405", "handle": "ascendedAria", "mood": "offline"}, "adiosToreador": {"color": "#aa5500", "handle": "adiosToreador", "mood": "offline"}, "nitroZealist": {"color": "#ff3737", "handle": "nitroZealist", "mood": "offline"}, "caffeinatedAnalyst": {"color": "#aa0000", "handle": "caffeinatedAnalyst", "mood": "offline"}, "wovenWay": {"color": "#000000", "handle": "wovenWay", "mood": "offline"}, "grimAuxiliatrix": {"color": "#008141", "handle": "grimAuxiliatrix", "mood": "offline"}, "apocalypseArisen": {"color": "#a10000", "handle": "apocalypseArisen", "mood": "offline"}, "microMachines": {"color": "#aa00ff", "handle": "microMachines", "mood": "offline"}, "gamblingGenocider": {"color": "#00ff00", "handle": "gamblingGenocider", "mood": "offline"}, "elegantDiversion": {"color": "#14b40a", "handle": "elegantDiversion", "mood": "offline"}, "noSense": {"color": "#1d0059", "handle": "noSense", "mood": "offline"}, "cannabisHandle": {"color": "#330066", "handle": "cannabisHandle", "mood": "offline"}, "sadHomewrecker": {"color": "#55ff00", "handle": "sadHomewrecker", "mood": "offline"}, "mechanicalSpectacle": {"color": "#0000ff", "handle": "mechanicalSpectacle", "mood": "offline"}, "plasmaModerator": {"color": "#5685cc", "handle": "plasmaModerator", "mood": "offline"}, "sporadicAgent": {"color": "#000000", "handle": "sporadicAgent", "mood": "offline"}, "gallowsCalibrator": {"color": "#008282", "handle": "gallowsCalibrator", "mood": "offline"}, "obliviousCrafter": {"color": "#ac0465", "handle": "obliviousCrafter", "mood": "offline"}, "schlagzeugGator": {"color": "#61821f", "handle": "schlagzeugGator", "mood": "offline"}, "absoluteImperfection": {"color": "#557b7b", "handle": "absoluteImperfection", "mood": "offline"}, "marineAquist": {"color": "#00caca", "handle": "marineAquist", "mood": "offline"}, "macruralAlchemist": {"color": "#700000", "handle": "macruralAlchemist", "mood": "offline"}, "fireSwallow": {"color": "#80bb9a", "handle": "fireSwallow", "mood": "offline"}, "aquaMarinist": {"color": "#00caca", "handle": "aquaMarinist", "mood": "offline"}, "hannaSongstress": {"color": "#ff00ff", "handle": "hannaSongstress", "mood": "offline"}, "acapellaWaterfall": {"color": "#000099", "handle": "acapellaWaterfall", "mood": "offline"}, "quintessentialArbalest": {"color": "#999999", "handle": "quintessentialArbalest", "mood": "offline"}, "cannabisHero": {"color": "#330066", "handle": "cannabisHero", "mood": "offline"}, "terminallyCapricious": {"color": "#330066", "handle": "terminallyCapricious", "mood": "offline"}, "uselessMonoxide": {"color": "#6b0017", "handle": "uselessMonoxide", "mood": "offline"}, "ardentAbettor": {"color": "#c8b670", "handle": "ardentAbettor", "mood": "offline"}, "jetRocket": {"color": "#00ff00", "handle": "jetRocket", "mood": "offline"}, "uroborosUnbound": {"color": "#00416a", "handle": "uroborosUnbound", "mood": "offline"}, "arachnidsGrip": {"color": "#00557f", "handle": "arachnidsGrip", "mood": "offline"}, "perilousFortune": {"color": "#0066cc", "handle": "perilousFortune", "mood": "offline"}, "percipientPedestrian": {"color": "#00ffff", "handle": "percipientPedestrian", "mood": "offline"}, "illuminatedWax": {"color": "#000000", "handle": "illuminatedWax", "mood": "offline"}, "hellerificJefferson": {"color": "#3300ff", "handle": "hellerificJefferson", "mood": "offline"}, "daringHero": {"color": "#000000", "handle": "daringHero", "mood": "offline"}, "DocScratch": {"color": "#ffffff", "handle": "DocScratch", "mood": "offline"}, "superGhost": {"color": "#800564", "handle": "superGhost", "mood": "offline"}, "arsenicCatnip": {"color": "#006400", "handle": "arsenicCatnip", "mood": "offline"}, "kaleidoscopicMind": {"color": "#ff6666", "handle": "kaleidoscopicMind", "mood": "offline"}, "captainCaveman": {"color": "#7c414e", "handle": "captainCaveman", "mood": "offline"}, "counterRealist": {"color": "#10d985", "handle": "counterRealist", "mood": "offline"}, "maxiumumFatness": {"color": "#3366ff", "handle": "maxiumumFatness", "mood": "offline"}, "ahhIsee": {"color": "#ff5500", "handle": "ahhIsee", "mood": "offline"}, "oilslickOrchid": {"color": "#743f7e", "handle": "oilslickOrchid", "mood": "offline"}, "doctectiveMiracles": {"color": "#999900", "handle": "doctectiveMiracles", "mood": "offline"}, "pesterClient566": {"color": "#000000", "handle": "pesterClient566", "mood": "offline"}, "stupidlyBrilliant": {"color": "#ffcc33", "handle": "stupidlyBrilliant", "mood": "offline"}, "midnightSparrow": {"color": "#ff55ff", "handle": "midnightSparrow", "mood": "offline"}, "magmaExploiter": {"color": "#d90000", "handle": "magmaExploiter", "mood": "offline"}, "hubristicAustringer": {"color": "#ffd909", "handle": "hubristicAustringer", "mood": "offline"}, "artsyGyarados": {"color": "#70b1ff", "handle": "artsyGyarados", "mood": "offline"}, "gardenGnostic": {"color": "#00ff00", "handle": "gardenGnostic", "mood": "offline"}, "unknownTraveler": {"color": "#006666", "handle": "unknownTraveler", "mood": "offline"}, "depthPerception": {"color": "#6f3886", "handle": "depthPerception", "mood": "offline"}, "soothsayingProfit": {"color": "#ff9933", "handle": "soothsayingProfit", "mood": "offline"}, "pretentiousFantasia": {"color": "#ff66cf", "handle": "pretentiousFantasia", "mood": "offline"}, "endlessVoid": {"color": "#939300", "handle": "endlessVoid", "mood": "offline"}, "iw": {"color": "#000000", "handle": "iw", "mood": "offline"}, "pesterClient394": {"color": "#ff3737", "handle": "pesterClient394", "mood": "offline"}, "absoluteTranquility": {"color": "#000000", "handle": "absoluteTranquility", "mood": "offline"}, "fallenGaurdian": {"color": "#b03060", "handle": "fallenGaurdian", "mood": "offline"}, "anguillaNuntia": {"color": "#ff007f", "handle": "anguillaNuntia", "mood": "offline"}, "radicalApologist": {"color": "#ffaa00", "handle": "radicalApologist", "mood": "offline"}, "abyssImpulse": {"color": "#68228b", "handle": "abyssImpulse", "mood": "offline"}, "pesterClient815": {"color": "#000000", "handle": "pesterClient815", "mood": "offline"}, "testOut": {"color": "#c760cc", "handle": "testOut", "mood": "offline"}, "pesterClient3022": {"color": "#336600", "handle": "pesterClient3022", "mood": "offline"}, "androidTechnician": {"color": "#0000ff", "handle": "androidTechnician", "mood": "offline"}, "recalcitrantDisaster": {"color": "#8b0068", "handle": "recalcitrantDisaster", "mood": "offline"}, "tentacleTherapist": {"color": "#cc66ff", "handle": "tentacleTherapist", "mood": "offline"}, "zealousScarecrow": {"color": "#00c882", "handle": "zealousScarecrow", "mood": "offline"}, "carcinoGeneticist": {"color": "#999999", "handle": "carcinoGeneticist", "mood": "offline"}, "fadingStar": {"color": "#9932cc", "handle": "fadingStar", "mood": "offline"}, "moirailBunp": {"color": "#6a3d0f", "handle": "moirailBunp", "mood": "offline"}, "rageInducer": {"color": "#00ffff", "handle": "rageInducer", "mood": "offline"}, "greenZephyr": {"color": "#00ca40", "handle": "greenZephyr", "mood": "offline"}, "riskRepeats": {"color": "#009900", "handle": "riskRepeats", "mood": "offline"}, "caligulasAquarium": {"color": "#6a006a", "handle": "caligulasAquarium", "mood": "offline"}, "pesterClient865": {"color": "#330066", "handle": "pesterClient865", "mood": "offline"}, "utilitarianTurnabout": {"color": "#dd0000", "handle": "utilitarianTurnabout", "mood": "offline"}} \ No newline at end of file +{"lyricalKeraunoscopic": {"color": "#00aa00", "handle": "lyricalKeraunoscopic", "mood": "offline"}, "centaursTesticle": {"color": "#000056", "handle": "centaursTesticle", "mood": "offline"}, "greyscalePacifist": {"color": "#7f7f7f", "handle": "greyscalePacifist", "mood": "offline"}, "techturnGodhead": {"color": "#ff0000", "handle": "techturnGodhead", "mood": "offline"}, "insipidTranscient": {"color": "#145064", "handle": "insipidTranscient", "mood": "offline"}, "sanguineViruoso": {"color": "#000000", "handle": "sanguineViruoso", "mood": "offline"}, "agogPorphyry": {"color": "#522d80", "handle": "agogPorphyry", "mood": "offline"}, "aceIsm": {"color": "#ffcc66", "handle": "aceIsm", "mood": "offline"}, "sucroseSaboteur": {"color": "#00e700", "handle": "sucroseSaboteur", "mood": "offline"}, "corruptedInsanity": {"color": "#6c0000", "handle": "corruptedInsanity", "mood": "offline"}, "madLurker": {"color": "#004b00", "handle": "madLurker", "mood": "offline"}, "turntechGodhead": {"color": "#ff0000", "handle": "turntechGodhead", "mood": "offline"}, "driftingDreamer": {"color": "#b22222", "handle": "driftingDreamer", "mood": "offline"}, "cuttlefishCuller": {"color": "#77003c", "handle": "cuttlefishCuller", "mood": "offline"}, "masterG": {"color": "#77003c", "handle": "masterG", "mood": "offline"}, "carcinoGenetecist": {"color": "#7f7f7f", "handle": "carcinoGenetecist", "mood": "offline"}, "quixoticPaladin": {"color": "#aa00ff", "handle": "quixoticPaladin", "mood": "offline"}, "remoteBloodbath": {"color": "#c70000", "handle": "remoteBloodbath", "mood": "offline"}, "bearNecessities": {"color": "#993300", "handle": "bearNecessities", "mood": "offline"}, "lawdEngrish": {"color": "#00ff00", "handle": "lawdEngrish", "mood": "offline"}, "metaliAggressive": {"color": "#9289d5", "handle": "metaliAggressive", "mood": "offline"}, "serpentineHerbalist": {"color": "#0000c8", "handle": "serpentineHerbalist", "mood": "offline"}, "ascendedAria": {"color": "#df8405", "handle": "ascendedAria", "mood": "offline"}, "adiosToreador": {"color": "#aa5500", "handle": "adiosToreador", "mood": "offline"}, "nitroZealist": {"color": "#ff3737", "handle": "nitroZealist", "mood": "offline"}, "caffeinatedAnalyst": {"color": "#aa0000", "handle": "caffeinatedAnalyst", "mood": "offline"}, "maxiumumFatness": {"color": "#3366ff", "handle": "maxiumumFatness", "mood": "offline"}, "grimAuxiliatrix": {"color": "#008141", "handle": "grimAuxiliatrix", "mood": "offline"}, "apocalypseArisen": {"color": "#a10000", "handle": "apocalypseArisen", "mood": "offline"}, "microMachines": {"color": "#aa00ff", "handle": "microMachines", "mood": "offline"}, "gamblingGenocider": {"color": "#00ff00", "handle": "gamblingGenocider", "mood": "offline"}, "elegantDiversion": {"color": "#14b40a", "handle": "elegantDiversion", "mood": "offline"}, "noSense": {"color": "#1d0059", "handle": "noSense", "mood": "offline"}, "cannabisHandle": {"color": "#330066", "handle": "cannabisHandle", "mood": "offline"}, "sadHomewrecker": {"color": "#55ff00", "handle": "sadHomewrecker", "mood": "offline"}, "mechanicalSpectacle": {"color": "#0000ff", "handle": "mechanicalSpectacle", "mood": "offline"}, "plasmaModerator": {"color": "#5685cc", "handle": "plasmaModerator", "mood": "offline"}, "sporadicAgent": {"color": "#000000", "handle": "sporadicAgent", "mood": "offline"}, "gallowsCalibrator": {"color": "#008282", "handle": "gallowsCalibrator", "mood": "offline"}, "obliviousCrafter": {"color": "#ac0465", "handle": "obliviousCrafter", "mood": "offline"}, "schlagzeugGator": {"color": "#61821f", "handle": "schlagzeugGator", "mood": "offline"}, "absoluteImperfection": {"color": "#557b7b", "handle": "absoluteImperfection", "mood": "offline"}, "marineAquist": {"color": "#00caca", "handle": "marineAquist", "mood": "offline"}, "macruralAlchemist": {"color": "#700000", "handle": "macruralAlchemist", "mood": "offline"}, "fireSwallow": {"color": "#80bb9a", "handle": "fireSwallow", "mood": "offline"}, "aquaMarinist": {"color": "#00caca", "handle": "aquaMarinist", "mood": "offline"}, "hannaSongstress": {"color": "#ff00ff", "handle": "hannaSongstress", "mood": "offline"}, "acapellaWaterfall": {"color": "#000099", "handle": "acapellaWaterfall", "mood": "offline"}, "quintessentialArbalest": {"color": "#999999", "handle": "quintessentialArbalest", "mood": "offline"}, "cannabisHero": {"color": "#330066", "handle": "cannabisHero", "mood": "offline"}, "terminallyCapricious": {"color": "#330066", "handle": "terminallyCapricious", "mood": "offline"}, "uselessMonoxide": {"color": "#6b0017", "handle": "uselessMonoxide", "mood": "offline"}, "ardentAbettor": {"color": "#c8b670", "handle": "ardentAbettor", "mood": "offline"}, "jetRocket": {"color": "#00ff00", "handle": "jetRocket", "mood": "offline"}, "uroborosUnbound": {"color": "#00416a", "handle": "uroborosUnbound", "mood": "offline"}, "arachnidsGrip": {"color": "#00557f", "handle": "arachnidsGrip", "mood": "offline"}, "perilousFortune": {"color": "#0066cc", "handle": "perilousFortune", "mood": "offline"}, "percipientPedestrian": {"color": "#00ffff", "handle": "percipientPedestrian", "mood": "offline"}, "illuminatedWax": {"color": "#000000", "handle": "illuminatedWax", "mood": "offline"}, "hellerificJefferson": {"color": "#3300ff", "handle": "hellerificJefferson", "mood": "offline"}, "daringHero": {"color": "#000000", "handle": "daringHero", "mood": "offline"}, "DocScratch": {"color": "#ffffff", "handle": "DocScratch", "mood": "offline"}, "superGhost": {"color": "#800564", "handle": "superGhost", "mood": "offline"}, "arsenicCatnip": {"color": "#006400", "handle": "arsenicCatnip", "mood": "offline"}, "kaleidoscopicMind": {"color": "#ff6666", "handle": "kaleidoscopicMind", "mood": "offline"}, "aquaticMarinist": {"color": "#00caca", "handle": "aquaticMarinist", "mood": "offline"}, "captainCaveman": {"color": "#7c414e", "handle": "captainCaveman", "mood": "offline"}, "counterRealist": {"color": "#10d985", "handle": "counterRealist", "mood": "offline"}, "wovenWay": {"color": "#000000", "handle": "wovenWay", "mood": "offline"}, "ahhIsee": {"color": "#ff5500", "handle": "ahhIsee", "mood": "offline"}, "oilslickOrchid": {"color": "#743f7e", "handle": "oilslickOrchid", "mood": "offline"}, "doctectiveMiracles": {"color": "#999900", "handle": "doctectiveMiracles", "mood": "offline"}, "pesterClient566": {"color": "#000000", "handle": "pesterClient566", "mood": "offline"}, "stupidlyBrilliant": {"color": "#ffcc33", "handle": "stupidlyBrilliant", "mood": "offline"}, "midnightSparrow": {"color": "#ff55ff", "handle": "midnightSparrow", "mood": "offline"}, "magmaExploiter": {"color": "#d90000", "handle": "magmaExploiter", "mood": "offline"}, "hubristicAustringer": {"color": "#ffd909", "handle": "hubristicAustringer", "mood": "offline"}, "artsyGyarados": {"color": "#70b1ff", "handle": "artsyGyarados", "mood": "offline"}, "gardenGnostic": {"color": "#00ff00", "handle": "gardenGnostic", "mood": "offline"}, "unknownTraveler": {"color": "#006666", "handle": "unknownTraveler", "mood": "offline"}, "depthPerception": {"color": "#6f3886", "handle": "depthPerception", "mood": "offline"}, "pesterClient655": {"color": "#00ff00", "handle": "pesterClient655", "mood": "offline"}, "soothsayingProfit": {"color": "#ff9933", "handle": "soothsayingProfit", "mood": "offline"}, "pretentiousFantasia": {"color": "#ff66cf", "handle": "pretentiousFantasia", "mood": "offline"}, "endlessVoid": {"color": "#939300", "handle": "endlessVoid", "mood": "offline"}, "iw": {"color": "#000000", "handle": "iw", "mood": "offline"}, "pesterClient394": {"color": "#ff3737", "handle": "pesterClient394", "mood": "offline"}, "absoluteTranquility": {"color": "#000000", "handle": "absoluteTranquility", "mood": "offline"}, "fallenGaurdian": {"color": "#b03060", "handle": "fallenGaurdian", "mood": "offline"}, "anguillaNuntia": {"color": "#ff007f", "handle": "anguillaNuntia", "mood": "offline"}, "radicalApologist": {"color": "#ffaa00", "handle": "radicalApologist", "mood": "offline"}, "abyssImpulse": {"color": "#68228b", "handle": "abyssImpulse", "mood": "offline"}, "pesterClient815": {"color": "#000000", "handle": "pesterClient815", "mood": "offline"}, "testOut": {"color": "#c760cc", "handle": "testOut", "mood": "offline"}, "pesterClient3022": {"color": "#336600", "handle": "pesterClient3022", "mood": "offline"}, "androidTechnician": {"color": "#0000ff", "handle": "androidTechnician", "mood": "offline"}, "recalcitrantDisaster": {"color": "#8b0068", "handle": "recalcitrantDisaster", "mood": "offline"}, "tentacleTherapist": {"color": "#cc66ff", "handle": "tentacleTherapist", "mood": "offline"}, "zealousScarecrow": {"color": "#00c882", "handle": "zealousScarecrow", "mood": "offline"}, "carcinoGeneticist": {"color": "#999999", "handle": "carcinoGeneticist", "mood": "offline"}, "fadingStar": {"color": "#9932cc", "handle": "fadingStar", "mood": "offline"}, "moirailBunp": {"color": "#6a3d0f", "handle": "moirailBunp", "mood": "offline"}, "rageInducer": {"color": "#00ffff", "handle": "rageInducer", "mood": "offline"}, "greenZephyr": {"color": "#00ca40", "handle": "greenZephyr", "mood": "offline"}, "riskRepeats": {"color": "#009900", "handle": "riskRepeats", "mood": "offline"}, "caligulasAquarium": {"color": "#6a006a", "handle": "caligulasAquarium", "mood": "offline"}, "pesterClient865": {"color": "#330066", "handle": "pesterClient865", "mood": "offline"}, "utilitarianTurnabout": {"color": "#dd0000", "handle": "utilitarianTurnabout", "mood": "offline"}} \ No newline at end of file diff --git a/memos.py b/memos.py index 8ce1b70..2439521 100644 --- a/memos.py +++ b/memos.py @@ -317,6 +317,7 @@ class MemoInput(PesterInput): class PesterMemo(PesterConvo): def __init__(self, channel, timestr, mainwindow, parent=None): QtGui.QFrame.__init__(self, parent) + self.setAttribute(QtCore.Qt.WA_QuitOnClose, False) self.channel = channel self.mainwindow = mainwindow self.time = TimeTracker(txt2delta(timestr)) diff --git a/pesterchum.js b/pesterchum.js index 0f325a6..3dccbd3 100644 --- a/pesterchum.js +++ b/pesterchum.js @@ -1 +1 @@ -{"hideOfflineChums": true, "tabs": true, "soundon": true, "server": "irc.tymoon.eu", "chums": ["unknownTraveler", "tentacleTherapist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "aquaMarinist", "elegantDiversion", "moirailBunp", "uroborosUnbound", "androidTechnician", "midnightSparrow", "apocalypseArisen", "anguillaNuntia", "oilslickOrchid", "confusedTransient", "pretentiousFantasia", "aquaticMarinist", "lyricalKeraunoscopic", "counterRealist", "ectoBiologist", "percipientPedestrian", "asceticClinician", "doctectiveMiracles", "noSense", "obliviousCrafter", "ircMonster", "twinArmageddons", "cannabisHero", "jetRocket", "adiosToreador", "turntechGodhead", "magmaExploiter", "hannaSongstress", "endlessVoid", "sporadicAgent", "grayscaleVisionary", "corruptedInsanity", "riskRepeats", "stupidlyBrilliant", "artsyGyarados"], "defaultprofile": "ghostDunk", "block": []} \ No newline at end of file +{"hideOfflineChums": true, "tabs": true, "soundon": true, "server": "irc.tymoon.eu", "chums": ["unknownTraveler", "tentacleTherapist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "aquaMarinist", "elegantDiversion", "moirailBunp", "uroborosUnbound", "androidTechnician", "midnightSparrow", "apocalypseArisen", "anguillaNuntia", "oilslickOrchid", "confusedTransient", "pretentiousFantasia", "aquaticMarinist", "lyricalKeraunoscopic", "counterRealist", "ectoBiologist", "percipientPedestrian", "asceticClinician", "doctectiveMiracles", "noSense", "obliviousCrafter", "ircMonster", "twinArmageddons", "cannabisHero", "jetRocket", "adiosToreador", "turntechGodhead", "magmaExploiter", "hannaSongstress", "endlessVoid", "sporadicAgent", "grayscaleVisionary", "corruptedInsanity", "riskRepeats", "stupidlyBrilliant", "artsyGyarados", "subtleChaotician"], "defaultprofile": "ghostDunk", "block": []} \ No newline at end of file diff --git a/pesterchum.py b/pesterchum.py index 03a3b91..99fadc8 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -23,6 +23,17 @@ from parsetools import convertTags, addTimeInitial from memos import PesterMemo, MemoTabWindow, TimeTracker from irc import PesterIRC +_datadir = QtGui.QDesktopServices.storageLocation(QtGui.QDesktopServices.DataLocation)+"Pesterchum/" + +if sys.platform == "darwin": + if not os.path.exists(_datadir): + os.mkdir(_datadir) + if not os.path.exists(_datadir+"profiles"): + os.mkdir(_datadir+"profiles") + if not os.path.exists(_datadir+"pesterchum.js"): + f = open(_datadir+"pesterchum.js", 'w') + f.close() + class waitingMessageHolder(object): def __init__(self, mainwindow, **msgfuncs): self.mainwindow = mainwindow @@ -56,8 +67,14 @@ class NoneSound(object): class PesterLog(object): def __init__(self, handle): + global _datadir self.handle = handle self.convos = {} + if sys.platform != "darwin": + self.logpath = "logs" + else: + self.logpath = _datadir+"logs" + def log(self, handle, msg): bbcodemsg = convertTags(msg, "bbcode") html = convertTags(msg, "html")+"
" @@ -67,9 +84,9 @@ class PesterLog(object): time = datetime.now().strftime("%Y-%m-%d.%H.%M") self.convos[handle] = {} for (format, t) in modes.iteritems(): - if not os.path.exists("logs/%s/%s/%s" % (self.handle, handle, format)): - os.makedirs("logs/%s/%s/%s" % (self.handle, handle, format)) - fp = codecs.open("logs/%s/%s/%s/%s.%s.txt" % (self.handle, handle, format, handle, time), encoding='utf-8', mode='a') + if not os.path.exists("%s/%s/%s/%s" % (self.logpath, self.handle, handle, format)): + os.makedirs("%s/%s/%s/%s" % (self.logpath, self.handle, handle, format)) + fp = codecs.open("%s/%s/%s/%s/%s.%s.txt" % (self.logpath, self.handle, handle, format, handle, time), encoding='utf-8', mode='a') self.convos[handle][format] = fp for (format, t) in modes.iteritems(): f = self.convos[handle][format] @@ -91,20 +108,25 @@ class PesterLog(object): class PesterProfileDB(dict): def __init__(self): + if sys.platform != "darwin": + self.logpath = "logs" + else: + self.logpath = _datadir+"logs" + try: - fp = open("logs/chums.js", 'r') + fp = open("%s/chums.js" % (self.logpath), 'r') chumdict = json.load(fp) fp.close() except IOError: chumdict = {} - fp = open("logs/chums.js", 'w') + fp = open("%s/chums.js" % (self.logpath), 'w') json.dump(chumdict, fp) fp.close() converted = dict([(handle, PesterProfile(handle, color=QtGui.QColor(c['color']), mood=Mood(c['mood']))) for (handle, c) in chumdict.iteritems()]) self.update(converted) def save(self): - fp = open("logs/chums.js", 'w') + fp = open("%s/chums.js" % (self.logpath), 'w') chumdict = dict([p.plaindict() for p in self.itervalues()]) json.dump(chumdict, fp) fp.close() @@ -124,7 +146,11 @@ class PesterProfileDB(dict): class pesterTheme(dict): def __init__(self, name, default=False): - self.path = "themes/%s" % (name) + if sys.platform != "darwin": + self.path = "themes/%s" % (name) + else: + self.path = _datadir+"themes/%s" % (name) + self.name = name fp = open(self.path+"/style.js") theme = json.load(fp, object_hook=self.pathHook) @@ -190,7 +216,11 @@ class pesterTheme(dict): class userConfig(object): def __init__(self): - fp = open("pesterchum.js") + if sys.platform != "darwin": + self.filename = "pesterchum.js" + else: + self.filename = _datadir+"pesterchum.js" + fp = open(self.filename) self.config = json.load(fp) fp.close() if self.config.has_key("defaultprofile"): @@ -198,7 +228,9 @@ class userConfig(object): else: self.userprofile = None def chums(self): - return self.config['chums'] + if not self.config.has_key('chums'): + self.set("chums", []) + return self.config.get('chums', []) def hideOfflineChums(self): return self.config.get('hideOfflineChums', False) def defaultprofile(self): @@ -207,10 +239,10 @@ class userConfig(object): except KeyError: return None def tabs(self): - return self.config["tabs"] + return self.config.get("tabs", True) def addChum(self, chum): - if chum.handle not in self.config['chums']: - fp = open("pesterchum.js") # what if we have two clients open?? + if chum.handle not in self.chums(): + fp = open(self.filename) # what if we have two clients open?? newconfig = json.load(fp) fp.close() newchums = newconfig['chums'] + [chum.handle] @@ -249,7 +281,7 @@ class userConfig(object): jsonoutput = json.dumps(self.config) except ValueError, e: raise e - fp = open("pesterchum.js", 'w') + fp = open(self.filename, 'w') fp.write(jsonoutput) fp.close() def availableThemes(self): @@ -270,6 +302,11 @@ class userConfig(object): return [userProfile(p) for p in profs] class userProfile(object): def __init__(self, user): + if sys.platform != "darwin": + self.profiledir = "profiles" + else: + self.profiledir = _datadir+"profiles" + if type(user) is PesterProfile: self.chat = user self.userprofile = {"handle":user.handle, @@ -278,20 +315,22 @@ class userProfile(object): "theme": "pesterchum"} self.theme = pesterTheme("pesterchum") self.chat.mood = Mood(self.theme["main/defaultmood"]) + self.lastmood = self.chat.mood.value() self.quirks = pesterQuirks([]) else: - fp = open("profiles/%s.js" % (user)) + fp = open("%s/%s.js" % (self.profiledir, user)) self.userprofile = json.load(fp) fp.close() try: self.theme = pesterTheme(self.userprofile["theme"]) except ValueError, e: self.theme = pesterTheme("pesterchum") - + self.lastmood = self.userprofile.get('lastmood', self.theme["main/defaultmood"]) self.chat = PesterProfile(self.userprofile["handle"], QtGui.QColor(self.userprofile["color"]), - Mood(self.theme["main/defaultmood"])) + Mood(self.lastmood)) self.quirks = pesterQuirks(self.userprofile["quirks"]) + def setMood(self, mood): self.chat.mood = mood def setTheme(self, theme): @@ -306,6 +345,12 @@ class userProfile(object): self.quirks = quirks self.userprofile["quirks"] = self.quirks.plainList() self.save() + def getLastMood(self): + return self.lastmood + def setLastMood(self, mood): + self.lastmood = mood.value() + self.userprofile["lastmood"] = self.lastmood + self.save() def getTheme(self): return self.theme def save(self): @@ -314,7 +359,7 @@ class userProfile(object): jsonoutput = json.dumps(self.userprofile) except ValueError, e: raise e - fp = open("profiles/%s.js" % (handle), 'w') + fp = open("%s/%s.js" % (self.profiledir, handle), 'w') fp.write(jsonoutput) fp.close() @staticmethod @@ -640,6 +685,7 @@ class PesterMoodHandler(QtCore.QObject): pass newmood = Mood(m) self.mainwindow.userprofile.chat.mood = newmood + self.mainwindow.userprofile.setLastMood(newmood) if self.mainwindow.currentMoodIcon: moodicon = newmood.icon(self.mainwindow.theme) self.mainwindow.currentMoodIcon.setPixmap(moodicon.pixmap(moodicon.realsize())) diff --git a/profiles/ghostDunk.js b/profiles/ghostDunk.js index 3c7f83b..d9f0e93 100644 --- a/profiles/ghostDunk.js +++ b/profiles/ghostDunk.js @@ -1 +1 @@ -{"color": "#ff00ff", "theme": "gold xl", "quirks": [], "handle": "ghostDunk"} \ No newline at end of file +{"color": "#ff00ff", "lastmood": 21, "theme": "gold xl", "quirks": [], "handle": "ghostDunk"} \ No newline at end of file