From 05536b167f2db94d8a41a5cfd9f63a4bfae9fe1d Mon Sep 17 00:00:00 2001 From: Dpeta Date: Thu, 25 Mar 2021 14:09:43 +0100 Subject: [PATCH] Reimplemented console.py & a lot of README stuff! --- .gitignore | 1 + CHANGELOG.md | 35 + LICENSE | 687 ++++++++++++++++++ README.md | 110 ++- console.py | 526 ++++++++++++++ docs/CHANGELOG-karxi.mkdn | 167 +++++ docs/PYQUIRKS.mkdn | 88 +++ docs/README-karxi.mkdn | 184 +++++ .../README-karxi.mkdn.backup | 0 .../README-pesterchum.mkdn | 0 docs/TODO.mkdn | 358 +++++++++ themes.txt => docs/themes.txt | 0 docs/trollquirks.mkdn | 182 +++++ pesterchum.py | 12 +- pesterchum.spec | 6 +- setup.py | 6 +- 16 files changed, 2347 insertions(+), 15 deletions(-) create mode 100644 CHANGELOG.md create mode 100755 LICENSE create mode 100644 console.py create mode 100755 docs/CHANGELOG-karxi.mkdn create mode 100755 docs/PYQUIRKS.mkdn create mode 100755 docs/README-karxi.mkdn rename README-karxi.mkdn => docs/README-karxi.mkdn.backup (100%) rename README-pesterchum.mkdn => docs/README-pesterchum.mkdn (100%) create mode 100755 docs/TODO.mkdn rename themes.txt => docs/themes.txt (100%) create mode 100755 docs/trollquirks.mkdn diff --git a/.gitignore b/.gitignore index b6afbc1..b790493 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ quirks/* !quirks/defaults.py *.pkl Pesterchum.dmg +*.md.backup diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a98e7b6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,35 @@ +# Changelog +(This document uses YYYY-MM-DD as per ISO 8601) + +## [v2.0] - 2021-3-25 + +### Added +- Added markup to "PESTER" and "ADD GROUP" menu options. +- Added pesterchum.spec for use with pyinstaller. +- Wrapped socket in SSL context and changed the port appropriately, hostname verification is turned off. + +### Changed +- Transitioned to Python 3. +- Transitioned to PyQt5. +- Changed character encoding in some placed from ascii to UTF-8 (Emojis should work now) +- Rewrote setup.py file + +### Fixed +- Fixed sRGB profile issue with certain images. + +### Deprecated +- Removed update system (it seemed to be non-functional). +- Removed MSPA update checking (non-functional since Homestuck ended). +- Removed feedparser.py (feedparser) and magic.py (python-magic) from libs and changed them to be normal imports. (Because we're not running Python 3 anymore) + +## [pre-v1.20] - 2021-2-25 +### Added +- Made the server configurable with server.json + +### Fixed +- Fixed issue where Pesterchum would crash when unable to find the default profile. +- Fixed rare issue where auto-identifying to nickserv would cause Pesterchum to crash. + +### Deprecated +- Removed dead links to Pesterchum QDB from menus. +- Removed no longer functional bugreport system. \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..4f0c389 --- /dev/null +++ b/LICENSE @@ -0,0 +1,687 @@ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md index e1038e6..64ef691 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,107 @@ -# pesterchum-alt-servers -Instant messaging client copying the look and feel of clients from Andrew Hussie's webcomic Homestuck. Connects to pesterchum.xyz instead of irc.mindfang.org, since that server has shut down. Custom servers can be configured in "server.json". (This repository was created as a mirror of https://github.com/Hydrothermal/pesterchum-karxi) +# PESTERCHUM +Maintained repository of ghostDunk's Pesterchum. Connects to irc.pesterchum.xyz by defaults since the official server shut down (custom servers can be configured in server.json!!). Pesterchum is an instant messaging client copying the look and feel of clients from Andrew Hussie's webcomic Homestuck. -# py3_pyqt5 -An w.i.p. attempt at transitioning this repo's version of Pesterchum to python 3 & pyqt5 :) (Healivy referenced from GD's py3/pyqt5 commit) +This repository builds on (and was mirrored from!) from pesterchum-karxi + Hydrothermal's nickserv fix. + +Check out [CHANGELOG.md] file to see what's changed! + +For the old READMEs and guides, view the [docs] folder. (I removed Lexicality's macBuilds since it's no longer applicable) + +[CHANGELOG.md]: https://github.com/Dpeta/pesterchum-alt-servers/blob/py3_pyqt5/CHANGELOG.md +[docs]: https://github.com/Dpeta/pesterchum-alt-servers/tree/py3_pyqt5/docs/ + +## INSTALATION +Download the appropriate release for your platform from [releases][releases], extract the zip file to any directory, and run the executable : ) + +[releases]: https://github.com/Dpeta/pesterchum-alt-servers/releases + +## BUILDING +Building Pesterchum yourself is not required to run it!!! This is only relevant if you know what you're doing >:3c + +### PYTHON :) + + - [Python 3] + +#### PYTHON DEPENDENCIES + - [pygame] + - [PyQt5] + - [feedparser] + - [python-magic] + - [ostools] + +[Python 3]: https://www.python.org/downloads/ +[PyQt5]: https://pypi.org/project/PyQt5/ +[pygame]: https://pypi.org/project/pygame/ +[feedparser]: https://pypi.org/project/feedparser/ +[python-magic]: https://pypi.org/project/python-magic/ +[ostools]: https://pypi.org/project/ostools/ + +### CX_FREEZE METHOD + +#### Windows: +``python setup.py build`` + +#### Mac: +~~``python setup.py py2app``~~ Currently doesn't work!! Give me a few days, it's hard to test this kind of stuff since I don't have a mac :( + +### PYINSTALLER METHOD +#### Linux (might also work on other platforms!!): +``python pyinstaller pesterchum.spec`` + +## SMILIES +Just for easy reference. :3 (Taken from docs/README-karxi.mkdn) + +* `:rancorous:` +* `:apple:` +* `:bathearst:` +* `:cathearst:` +* `:woeful:` +* `:pleasant:` +* `:blueghost:` +* `:slimer:` +* `:candycorn:` +* `:cheer:` +* `:duhjohn:` +* `:datrump:` +* `:facepalm:` +* `:bonk:` +* `:mspa:` +* `:gun:` +* `:cal:` +* `:amazedfirman:` +* `:amazed:` +* `:chummy:` +* `:cool:` +* `:smooth:` +* `:distraughtfirman:` +* `:distraught:` +* `:insolent:` +* `:bemused:` +* `:3:` +* `:mystified:` +* `:pranky:` +* `:tense:` +* `:record:` +* `:squiddle:` +* `:tab:` +* `:beetip:` +* `:flipout:` +* `:befuddled:` +* `:pumpkin:` +* `:trollcool:` +* `:jadecry:` +* `:ecstatic:` +* `:relaxed:` +* `:discontent:` +* `:devious:` +* `:sleek:` +* `:detestful:` +* `:mirthful:` +* `:manipulative:` +* `:vigorous:` +* `:perky:` +* `:acceptant:` +* `:olliesouty:` +* `:billiards:` +* `:billiardslarge:` +* `:whatdidyoudo:` \ No newline at end of file diff --git a/console.py b/console.py new file mode 100644 index 0000000..b909d06 --- /dev/null +++ b/console.py @@ -0,0 +1,526 @@ +# vim: set autoindent ts=4 sts=4 sw=4 textwidth=79 expandtab: +# -*- coding=UTF-8; tab-width: 4 -*- + + +from PyQt5 import QtCore, QtGui, QtWidgets +import re, os, traceback, sys +import time, datetime +from os import remove + +import dataobjs, generic, memos, parsetools, ostools +from version import _pcVersion + +try: + from pnc.attrdict import AttrDict +except ImportError: + # Fall back on the old location, just in case + from pnc.dep.attrdict import AttrDict +#~from styling import styler + +_datadir = ostools.getDataDir() + +import logging +logging.basicConfig(level=logging.WARNING) + + + + +class ConsoleWindow(QtWidgets.QDialog): +#~class ConsoleWindow(styler.PesterBaseWindow): + # A simple console class, cobbled together from the corpse of another. + + stylesheet_path = "main/defaultwindow/style" + # This is a holder for our text inputs. + text = AttrDict() + # I should probably put up constants for 'direction' if this is going to + # get this complicated. TODO! + incoming_prefix = "<<<" + miscinfo_prefix = "==>" + outgoing_prefix = ">>>" + neutral_prefix = "!!!" + waiting_prefix = "..." + + selected_widget = None + show_info_on_select = True + + _CUSTOM_ENV = {} + + def __init__(self, parent): + super(ConsoleWindow, self).__init__(parent) + self.prnt = parent + try: + self.mainwindow = parent.mainwindow + except: + self.mainwindow = parent + theme = self.mainwindow.theme + # This won't initialize the sub-objects, because they don't exist yet. + self.initTheme(theme) + + self.text = AttrDict() + self.text.area = ConsoleText(theme, self) + self.text.input = ConsoleInput(theme, self) + self.text.input.setFocus() + + self.text.input.returnPressed.connect(self.sentMessage) + + self.text.history = dataobjs.PesterHistory() + + # For backing these up + self.stdout = self.stderr = None + + layout_0 = QtWidgets.QVBoxLayout() + layout_0.addWidget(self.text.area) + layout_0.addWidget(self.text.input) + self.setLayout(layout_0) + + def parent(self): + return self.prnt + + def clearNewMessage(self): + pass + + @QtCore.pyqtSlot() + def sentMessage(self): + text = self.text.input.text() + # TODO: Make this deal with unicode text, it'll crash and burn as-is. + text = str(text) + text = text.rstrip() + + self.text.history.add(text) + self.text.input.setText("") + + self.execInConsole(text) + # Scroll down to the bottom so we can see the results. + sb = self.text.area.verticalScrollBar() + sb.setValue(sb.maximum()) + + def addTraceback(self, tb=None): + # We should do the formatting here, but eventually pass it to text.area + # to addMessage whatever output we produced. + # If we're called by addMessage - and we should be - then sys.stdout is + # still being redirected into the console. + # TODO: Just make an object for setting contexts (and thus optionally + # redirecting prints). Use 'with', of course. + # TODO: Make this exclude *our* processing from the traceback stack. + try: + self.addMessage(traceback.format_exc(), direction=0) + except Exception as err: + logging.error("Failed to display error message (???): %s" % err) + + def addMessage(self, msg, direction): + # Redirect to where these things belong. + self.text.area.addMessage(msg, direction=direction) + + def closeEvent(self, event): + # TODO: Set up ESC to close the console...or refer to hiding it as + # closing it. Not sure which is preferable. + parent = self.parent() + parent.console.is_open = False + parent.console.window = None + return super(ConsoleWindow, self).closeEvent(event) + + def hideEvent(self, event): + parent = self.parent() + parent.console.is_open = False + + def initTheme(self, theme): + # Set up our style/window specifics + self.changeTheme(theme) + self.resize(400,600) + + def changeTheme(self, theme): + self.setStyleSheet(theme[self.stylesheet_path]) + self.setWindowTitle("==> Console") + if "area" in self.text and "input" in self.text: + self.text.area.changeTheme(theme) + self.text.input.changeTheme(theme) + + @QtCore.pyqtSlot() + def designateCurrentWidget(self): + # Display and save the current widget! + # TODO: Consider (reversible) highlighting or selection or something + # fancy. It'd help people write styles, wouldn't it? + # ...just remember to use mouseRelease() if you work with hovering. + + # Direction: Misc. Info + direction = 2 + + pos = QtGui.QCursor.pos() + wgt = QtWidgets.QApplication.widgetAt(pos) + if wgt is None: + # Don't set None, for now. May change this later. + self.addMessage("You need to have your cursor over something " + \ + "in Pesterchum to use that.", + direction=direction) + return + + self.selected_widget = wgt + nchild = len(wgt.children()) + output = [] + output.append("CONSOLE.selected_widget = {0!r}".format(wgt)) + output.append("{0: <4}Parent: {1!r}".format('', wgt.parent())) + output.append("{0: <4}{1:4d} child{2}".format('', + nchild, ("ren" if abs(nchild) != 1 else "") )) + if self.show_info_on_select: + qtss = None + uses_ss = None + try: + qtss = wgt.styleSheet() + except: + pass + else: + if str(qtss) == str(""): + uses_ss, ss_msg = False, "No" + elif qtss is not None: + uses_ss, ss_msg = True, "Yes" + else: + uses_ss, ss_msg = None, "Invalid" + + ss_par, ss_par_msg = None, "" + if uses_ss is False: + # TODO: Split this into a sub-function or integrate it into + # Styler or *something*. + # The stylesheet was probably defined on a parent higher up. + # Rungs above the start + i = 0 + # qtss is still "" from earlier + while not qtss: + try: + ss_par = wgt.parent() + qtss = ss_par.styleSheet() + except: + # Can't ascend...and we're still in loop, so we don't + # have what we came for. + # Either that, or it's incompatible, which means the + # ones above are anyway. + ss_par = False + break + else: + # Indicate that we got this from a parent + i += 1 + + if not qtss: + # There are no stylesheets here. + if ss_par is False: + # We had parent issues. + # TODO: Specifically indicate invalid parent. + uses_ss, ss_msg = None, "Invalid" + else: + uses_ss, ss_msg = False, "No" + else: + # We got a stylesheet out of this! + uses_ss, ss_msg = True, "Yes" + #~ss_par_msg = "{0: <4}...on parent ↑{1:d}: {2!r}".format('', + ss_par_msg = "{0: <4}...on parent #{1:d}: {2!r}".format('', + i, ss_par) + + msg = [] + msg.append("{0: <4}QtSS?: {1}".format('', ss_msg)) + # A stylesheet analyzer would be wonderful here. Perhaps something + # that tells us how many parent classes define stylesheets? + if uses_ss: + if ss_par_msg: + # We got this stylesheet from a parent object somewhere. + msg.append(ss_par_msg) + msg.append("{0: <4}".format("Stylesheet:")) + for ln in qtss.split('\n'): + msg.append("{0: <8}".format(ln)) + + # Actually add this stuff to the result we're constructing + output.extend(msg) + + output = '\n'.join(output) + self.addMessage(output, direction=direction) + + + # Actual console stuff. + def execInConsole(self, scriptstr, env=None): + # Since that's what imports *us*, this should be okay + # Tab completion could be set up in ConsoleInput, and would be nice + import pesterchum as pchum + + if env is None: + env = pchum._retrieveGlobals() + + # Modify the environment the script will execute in. + # Fetch from the class/instance first. + _CUSTOM_ENV = self._CUSTOM_ENV.copy() + # Modify with some hard-coded environmental additions. + _CUSTOM_ENV.update({ + "CONSOLE": self, + "MAINWIN": self.mainwindow, + "PCONFIG": self.mainwindow.config, + "exit": lambda: self.mainwindow.exitaction.trigger() + }) + # Aliases. + _CUSTOM_ENV.update({ + "quit": _CUSTOM_ENV["exit"] + }) + # Add whatever additions were set in the main pesterchum file. + _CUSTOM_ENV.update(pchum._CONSOLE_ENV) + + _CUSTOM_ENV_USED = [] + cenv = pchum.__dict__ + # Display the input we provided + # We do this here, *before* we do our variable injection, so that it + # doesn't have to be part of the try statement, where it could + # potentially complicate matters/give false positives. + self.addMessage(scriptstr, 1) + for k in _CUSTOM_ENV: + if k not in cenv: + # Inject the variable for ease of use. + cenv[k] = _CUSTOM_ENV[k] + # Record that we injected it. + _CUSTOM_ENV_USED.append(k) + else: + # Don't overwrite anything! + warn = "Console environment item {0!r} already exists in CENV." + warn.format(k) + logging.warning(warn) + # Because all we did was change a linked AttrDict, we should be fine + # here. + try: + # Replace the old writer (for now) + sysout, sys.stdout = sys.stdout, self + try: + code = compile(scriptstr + '\n', "", "single") + # Will using cenv instead of env cause problems?... + result = eval(code, cenv) + except: + # Something went wrong. + self.addTraceback(sys.exc_info()[2]) + else: + # No errors. + if result is not None: + print(repr(result)) + finally: + # Restore system output. + sys.stdout = sysout + finally: + # Try to clean us out of globals - this might be disabled + # later. + for k in _CUSTOM_ENV_USED: + # Remove the key we added. + cenv.pop(k, None) + + def write(self, data): + # Replaces sys.stdout briefly + # We only ever use this for receiving, so it's safe to assume the + # direction is always -1. + if not isinstance(data, list): + data = data.split('\n') + for line in data: + if len(line): + self.addMessage(line, -1) + + +class ConsoleText(QtWidgets.QTextEdit): + stylesheet_template = """ + QScrollBar:vertical {{ {style[convo/scrollbar/style]} }} + QScrollBar::handle:vertical {{ {style[convo/scrollbar/handle]} }} + QScrollBar::add-line:vertical {{ {style[convo/scrollbar/downarrow]} }} + QScrollBar::sub-line:vertical {{ {style[convo/scrollbar/uparrow]} }} + QScrollBar:up-arrow:vertical {{ {style[convo/scrollbar/uarrowstyle]} }} + QScrollBar:down-arrow:vertical {{ {style[convo/scrollbar/darrowstyle]} }} + """ + stylesheet_path = "convo/textarea/style" + # NOTE: Qt applies stylesheets like switching CSS files. They are NOT + # applied piecemeal. + # TODO: Consider parsing the themes out into stylesheets with pieces that + # we can hand to each widget. + + def __init__(self, theme, parent=None): + super(ConsoleText, self).__init__(parent) + if hasattr(self.window(), 'mainwindow'): + self.mainwindow = self.window().mainwindow + else: + self.mainwindow = self.window() + + self.hasTabs = False + self.initTheme(theme) + self.setReadOnly(True) + self.setMouseTracking(True) + self.textSelected = False + + self.copyAvailable[bool].connect(self.textReady) + self.urls = {} + + # Stripped out animation init - it's all cruft to us. + + @QtCore.pyqtSlot(bool) + def textReady(self, ready): + self.textSelected = ready + + def initTheme(self, theme): + # The basic style... + stylesheet = "QTextEdit {{ {style[convo/textarea/style]} }}" + if "convo/scrollbar" in theme: + # TODO: Make all of this into a Styler mixin, so we can just feed + # it a theme whenever we want to change. + # We'd have to define the keys we're affecting, but that shouldn't + # be too hard - it's what dicts are for. + + # Add the rest. + stylesheet += '\n' + self.stylesheet_template + stylesheet = stylesheet.format(style=theme) + self.setStyleSheet(stylesheet) + + def addMessage(self, msg, direction): + # Display a message we've received. + # Direction > 0 == out (sent by us); < 0 == in (sent by script). + if len(msg) == 0: + return + #~color = chum.colorcmd() + #~initials = chum.initials() + parent = self.window() + mwindow = parent.mainwindow + + systemColor = QtGui.QColor(mwindow.theme["convo/systemMsgColor"]) + + if mwindow.config.showTimeStamps(): + if mwindow.config.time12Format(): + timestamp = time.strftime("[%I:%M") + else: + timestamp = time.strftime("[%H:%M") + if mwindow.config.showSeconds(): + timestamp += time.strftime(":%S] ") + else: + timestamp += "] " + else: + timestamp = "" + + # Figure out what prefix to use. + if direction > 1: + # Misc. Info + prefix = parent.miscinfo_prefix + elif direction > 0: + # Outgoing. + prefix = parent.outgoing_prefix + elif direction < 0: + # Incoming. + prefix = parent.incoming_prefix + elif direction == 0: + # We could just 'else' here, but there might be some oddness later. + prefix = parent.neutral_prefix + + # Later, this will have to escape things so we don't parse them, + # likely...hm. + #~result = "{} {} {!r}" + # The input we get is already repr'd...we pass it via print, and thus + # do that there. + result = "{}{} {}\n" + result = result.format(timestamp, prefix, msg) + self.appendPlainText(result) + + # Direction doesn't matter here - it's the console. + self.lastmsg = datetime.datetime.now() + # This needs to finish being rewritten.... + + def appendPlainText(self, text): + """Add plain text to the end of the document, a la insertPlainText.""" + # Save the old cursor + oldcur = self.textCursor() + # Move the cursor to the end of the document for insertion + self.moveCursor(QtGui.QTextCursor.End) + # Insert the text + self.insertPlainText(text) + # Return the cursor to wherever it was prior + self.setTextCursor(oldcur) + + def changeTheme(self, theme): + self.initTheme(theme) + sb = self.verticalScrollBar() + sb.setValue(sb.maximum()) + + def focusInEvent(self, event): + self.window().clearNewMessage() + super(ConsoleText, self).focusInEvent(event) + + def keyPressEvent(self, event): + # NOTE: This doesn't give focus to the input bar, which it probably + # should. + # karxi: Test for tab changing? + if self.window().text.input: + if event.key() not in (QtCore.Qt.Key_PageUp, QtCore.Qt.Key_PageDown, + QtCore.Qt.Key_Up, QtCore.Qt.Key_Down): + self.window().text.input.keyPressEvent(event) + + super(ConsoleText, self).keyPressEvent(event) + + def mousePressEvent(self, event): + if event.button() == QtCore.Qt.LeftButton: + url = self.anchorAt(event.pos()) + if url != "": + # Skip memo/handle recognition + # NOTE: Ctrl+Click copies the URL. Maybe it should select it? + if event.modifiers() == QtCore.Qt.ControlModifier: + QtWidgets.QApplication.clipboard().setText(url) + else: + # This'll probably be removed. May change the lexer out. + QtGui.QDesktopServices.openUrl(QtCore.QUrl(url, QtCore.QUrl.TolerantMode)) + + super(ConsoleText, self).mousePressEvent(event) + + def mouseMoveEvent(self, event): + # Change our cursor when we roll over links (anchors). + super(ConsoleText, self).mouseMoveEvent(event) + if self.anchorAt(event.pos()): + if self.viewport().cursor().shape != QtCore.Qt.PointingHandCursor: + self.viewport().setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) + else: + self.viewport().setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor)) + + def contextMenuEvent(self, event): + # This is almost certainly no longer necessary. + textMenu = self.createStandardContextMenu() + #~if self.textSelected: + #~ self.submitLogAction = QtGui.QAction("Submit to Pesterchum QDB", self) + #~ self.connect(self.submitLogAction, QtCore.SIGNAL('triggered()'), + #~ self, QtCore.SLOT('submitLog()')) + #~ textMenu.addAction(self.submitLogAction) + textMenu.exec_(event.globalPos()) + + +class ConsoleInput(QtWidgets.QLineEdit): + """The actual text entry box on a ConsoleWindow.""" + # I honestly feel like this could just be made a private class of + # ConsoleWindow, but...best not to overcomplicate things. + stylesheet_path = "convo/input/style" + + def __init__(self, theme, parent=None): + super(ConsoleInput, self).__init__(parent) + + self.changeTheme(theme) + + def changeTheme(self, theme): + self.setStyleSheet(theme[self.stylesheet_path]) + + def focusInEvent(self, event): + # We gained focus. Notify the parent window that this happened. + self.window().clearNewMessage() + self.window().text.area.textCursor().clearSelection() + + super(ConsoleInput, self).focusInEvent(event) + + def keyPressEvent(self, event): + evtkey = event.key() + parent = self.window() + + # If a key is pressed here, we're not idle.... + # NOTE: Do we really want everyone knowing we're around if we're + # messing around in the console? Hm. + parent.mainwindow.idler.time = 0 + + if evtkey == QtCore.Qt.Key_Up: + text = str(self.text()) + next = parent.text.history.next(text) + if next is not None: + self.setText(next) + elif evtkey == QtCore.Qt.Key_Down: + prev = parent.text.history.prev() + if prev is not None: + self.setText(prev) + elif evtkey in (QtCore.Qt.Key_PageUp, QtCore.Qt.Key_PageDown): + parent.text.area.keyPressEvent(event) + else: + super(ConsoleInput, self).keyPressEvent(event) diff --git a/docs/CHANGELOG-karxi.mkdn b/docs/CHANGELOG-karxi.mkdn new file mode 100755 index 0000000..5f2dce4 --- /dev/null +++ b/docs/CHANGELOG-karxi.mkdn @@ -0,0 +1,167 @@ +Pesterchum 3.41 +=============== + +Visit http://nova.xzibition.com/~illuminatedwax/help.html for tutorial. + +**Stable**: Visit https://github.com/illuminatedwax/pesterchum for git access and source code. + +**Bleeding Edge**: Visit https://github.com/kiooeht/pesterchum for git access and source code. + +**Mac**: For Mac specific git access and source code visit https://github.com/Lexicality/pesterchum. + +(Note: Bleeding Edge is up-to-date with all Mac specific changes.) + +CHANGELOG +--------- +## 3.41.4 +* Makefile for Linux installing - Kiooeht [evacipatedBox] +* Recognize www. as link - Kiooeht [evacipatedBox] +* Pester menu option to just pester a handle - Kiooeht [evacipatedBox] +* Update to randomEncounter interface - Kiooeht [evacipatedBox] +* Italics, bold, and underline - Kiooeht [evacipatedBox] +* FTP and Magnet links - oakwhiz +* Userlist search - oakwhiz +* Chanserv in menus - Cerxi [binaryCabalist] +* Lua quirks +* Multi-select memo chooser - [alGore] +* Auto-identify with NickServ - Kiooeht [evacipatedBox] +* Auto-join memos - Kiooeht [evacipatedBox] +* Bug fixes + * Don't require pygame (it's kind of optional, you just don't get sound) - Kiooeht [evacipatedBox] + * Allow add chum dialog to open after adding an existing chum - Kiooeht [evacipatedBox] + * Unicode everything - ghostDunk + * Delete groups when using online numbers - Kiooeht [evacipatedBox] + * Add chums when using manual sorting - Kiooeht [evacipatedBox] + * Memo case insensitive for userlist and modes - Kiooeht [evacipatedBox] + * Move hidden chums when deleting group - Kiooeht [evacipatedBox] + * Don't allow rename groups with parenthesis - Kiooeht [evacipatedBox] + * Wrap long error messages - Kiooeht [evacipatedBox] + * chdir into quirks folder for Lua quirks - [alGore] + * Toast notifications don't require sound to be on - Kiooeht [evacipatedBox] + * Don't close Pesterchum if a window is closed while main window minimized - Kiooeht [evacipatedBox] + + +### 3.41.3 +* Add group option when adding chum - ghostDunk +* OOC Mode - ghostDunk +* Improve animated gifs - ghostDunk +* Set IRC away on idle - Kiooeht [evacipatedBox] +* Remote quirk shutoff in memos - Kiooeht [evacipatedBox] +* Compress exit dumps into one line - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) +* Display channel mode change message - Kiooeht [evacipatedBox] +* Disable quirks in +c memos - Lexi [lexicalNuance] +* Founder, admin, and halfop support - Kiooeht [evacipatedBox] +* Button for direct access to logs directory - Kiooeht [evacipatedBox] +* Auto-update from zip and tar - Kiooeht [evacipatedBox] +* Minimizable memo userlist - Kiooeht [evacipatedBox] (Idea: [alGore], [lostGash]) +* Chumroll notifications on chum sign-in/out - Kiooeht [evacipatedBox] +* Chum notes - Kiooeht [evacipatedBox] +* Customizable name alerts - Kiooeht [evacipatedBox] +* Update bug reporter - Kiooeht [evacipatedBox] +* Explain why a chumhandle is invalid - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) +* Netsplit notification in memos - Kiooeht [evacipatedBox] +* Toast Notifications - Kiooeht [evacipatedBox] +* Disable randomEncounter options when it's offline - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) +* Sort list of memos alphabetically or by number of users - Kiooeht [evacipatedBox] (Idea: [lostGash]) +* Low-bandwidth mode - Kiooeht [evacipatedBox] (Idea: [canLover]) +* New smilies - Kiooeht [evacipatedBox] +* Refresh theme in options - Kiooeht [evacipatedBox] +* Separate tabbed/untabbed windows for conversaions and memos - Kiooeht [evacipatedBox] +* Manually rearrange chumroll - Kiooeht [evacipatedBox] (Idea: [turntableAbbess (aka. TA of SGRILL)]) +* Using user data directory for all OSs - Kiooeht [evacipatedBox] +* Lots more user created themes - ghostDunk +* Bug fixes + * Don't delete random chum when blocking someone not on chumroll - Kiooeht [evacipatedBox] + * Openning global userlist doesn't reset OP status of memo users - Kiooeht [evacipatedBox] + * Alt characters don't break on random replace - Kiooeht [evacipatedBox] + * Trollian 2.5 tray icon is now Trollian icon - Kiooeht [evacipatedBox] + * Don't screw up tags with the mispeller - Kiooeht [evacipatedBox] + * Don't break if profile uses non-existant theme - Kiooeht [evacipatedBox] + * Properly rearrange groups when not displaying number of online chums - Kiooeht [evacipatedBox] +* Mac Bug fixes + * Create all datadir stuff - Lexi [lexicalNuance] + +### 3.41 +* Individually turn quirks on and off - Kiooeht [evacipatedBox] +* More canon trollian theme timeline indicators - [binaryCabalist] +* By mood chum sorting - Kiooeht [evacipatedBox] +* Chum groups - Kiooeht [evacipatedBox] +* Turn logging on and off - Kiooeht [evacipatedBox] +* Customizable idle time - Kiooeht [evacipatedBox] +* Different sound for memos - Kiooeht [evacipatedBox] +* Animated smilies - Kiooeht [evacipatedBox] +* Delete profiles - Kiooeht [evacipatedBox] +* Customize minimize and close button actions - Kiooeht [evacipatedBox] +* Receive notices from services you're talking to - Kiooeht [evacipatedBox] +* Automatically turn off quirks when talking to bots - Kiooeht [evacipatedBox] +* Rearrange options menu, make tabbed - Kiooeht [evacipatedBox] +* Rearrange memos window for readability - Kiooeht [evacipatedBox] +* Give voice to memo users - Kiooeht [evacipatedBox] +* Theme checking - Kiooeht [evacipatedBox] +* Display (De)OP/Voice messages in memos - Kiooeht [evacipatedBox] +* Advanced Mode: Alter IRC user mode - Kiooeht [evacipatedBox] +* Logviewer chum search - Kiooeht [evacipatedBox] +* Logviewer log search - Kiooeht [evacipatedBox] +* Set server and port from command line - Kiooeht [evacipatedBox] +* Invite-only memos, invite chums to memos - Kiooeht [evacipatedBox] +* Check Pyqt4 and pygame are installed and correct versions - Kiooeht [evacipatedBox] +* Advanced Mode: View memo (channel) modes - Kiooeht [evacipatedBox] +* Quirk groups - Kiooeht [evacipatedBox] +* CTCP Version reply - Kiooeht [evacipatedBox] +* Check for Pesterchum updates - Kiooeht [evacipatedBox] +* Memo OP options: Secret, Invite-only, Mute - Kiooeht [evacipatedBox] +* Notify user if channel blocks message - Kiooeht [evacipatedBox] +* Bug reporter - Kiooeht [evacipatedBox] +* Python quirks (users can create own quirk functions) - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) +* Incorporate support for the new randomEncounter - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) +* Only GETMOOD for people online (less spam!) - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) +* Quirk tester in quirk window - Kiooeht [evacipatedBox] (Idea: [alGore]) +* Show and support giving kick reasons - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) +* Make adding quirks into multi-page wizard - Kiooeht [evacipatedBox] +* Flash the taskbar on new messages - Kiooeht [evacipatedBox] +* Third beep sound for when your initials are mentioned in memos - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) +* Ctrl + click to copy links - Kiooeht [evacipatedBox] +* Say something when server is full - Kiooeht [evacipatedBox] +* Ping server if no ping from server to test connection - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) +* MSPA comic update notifier - Kiooeht [evacipatedBox] +* Volume control - Kiooeht [evacipatedBox] +* Debug mode - illuminatedwax [ghostDunk] +* Bug fixes + * Logviewer updates - Kiooeht [evacipatedBox] + * Memo scrollbar thing - Kiooeht [evacipatedBox] + * Time arrows in enamel - Kiooeht [evacipatedBox] + * Quirk order actually works - Kiooeht [evacipatedBox] + * Stay in memos on profile switch - Kiooeht [evacipatedBox] + * Auto rejoin memos on reconnect - Kiooeht [evacipatedBox] + * De-Op in memos correctly - Kiooeht [evacipatedBox] + * Don't blow up if someone's not using Pesterchum in a memo - Kiooeht [evacipatedBox] + * Make 'logs' and 'profiles' directories if non-existant - Kiooeht [evacipatedBox] + * Don't split messages in bad places - Kiooeht [evacipatedBox] + * Chumhandles must match EXACTLY to register mood changes - Kiooeht [evacipatedBox] + * Menu bar text colour correct when default system colour isn't black - Kiooeht [evacipatedBox] + * End all colour tags and restart them on split messages - Kiooeht [evacipatedBox] + * Chat input box right-click menus - Kiooeht [evacipatedBox] + * Don't overflow random colours into colourless messages - Kiooeht [evacipatedBox] + * Only open links on left click - Kiooeht [evacipatedBox] + +### 3.14.1 +* Pesterchum 3.14 - illuminatedwax [ghostDunk] +* Art - Grimlive [aquaMarinist] +* Quirks lower() function - Kiooeht [evacipatedBox] +* Quirks scrabble() function - Kiooeht [evacipatedBox] +* Quirks reverse() function - illuminatedwax [ghostDunk] +* Timestamps - Kiooeht [evacipatedBox] +* Logviewer - Kiooeht [evacipatedBox] +* Quirk ordering - [alGore] +* # of users in a memo - [alGore] +* @links to users - illuminatedwax [ghostDunk] +* Support for REPORT and ALT to calSprite built in - illuminatedwax [ghostDunk] +* Bug fixes: + * mixer bug fixed + * "flags" bug fixed + * incorrect characters in memos no longer break log file names + * memos now do not break on case-sensitivity + * fixed QDB address + * now lines too long to send in a single message are split up correctly + * quirk replace bug fixed + * pesterClientXXX profiles no longer saved diff --git a/docs/PYQUIRKS.mkdn b/docs/PYQUIRKS.mkdn new file mode 100755 index 0000000..de4eb27 --- /dev/null +++ b/docs/PYQUIRKS.mkdn @@ -0,0 +1,88 @@ +Python Quirk Functions +=============== + +Table of Contents +----------------- +1. Introduction +2. Create A Module +3. Functions In A Module +4. Command Requirements +5. Completed Quirk Function + +Introduction +--------------- +Over the course of this short tutorial you will learn: + +* How to create your own Quirk Functions +* VERY basic Python syntax + +You will not learn: + +* How to write Python +* How to bake a cake + +Throughout this tutorial there will be +
+Instructions in special boxes.
+If you follow the instructions in these boxes, by the end of this tutorial
+you will have recreated the default reverse() Quirk Function.
+
+ +Create A Module +------------------- +All Quirk Function Modules should be created in the 'quirks/' directory. File names must end in '.py'. +You can have multiple Quirk Functions per Module. + +Each Module can also have a 'setup' function which will be called once, the moment the Module is loaded. + +
+Create 'reverse.py' in the 'quirks/' directory.
+
+ +Functions In A Module +-------------------------- +If you've ever done programming before, you should know what a function is. If not, I suggest picking up a good programming book (or e-book). + +In Python, function syntax looks like this: + +def function_name(myvar1, myvar2): + +'def' is used to declare that this is a function, and 'function_name' is obviously the name of your function. +'myvar1' and 'myvar2' are variables coming into your function. For most of your functions, the only variable being passed will be 'text'. + +In Python, curly braces ({}) are not used to declare the beginning and end of a function. Instead, a colon (:) is used to declare the beginning of a function. After that, indentation is used to declare the body and end of a function. + +```python +def reverserep(text): + return text[::-1] +``` + +Command Requirements +------------------------ +For a function to be registered as a Quirk Function, it must conform to three simple rules: + +1. It must have a command name. +2. It must take exactly one arguement. +3. It must return a string. + +What is meant by having a command name, is that a name for the Quirk Function has to be defined. This is done by defining the 'command' variable for a function. + +function_name.command = "name" + +```python +reverserep.command = "reverse" +``` + +Completed Quirk Function +--------------------------- +Below is the completed, fully working, reverse Quirk Function. After it I will break down the pieces of each line. + +```python +def reverserep(text): + return text[::-1] +reverserep.command = "reverse" +``` + +As stated before, to start a function, you need to use the keyword 'def'. All Quirk Functions must take exactly one argument (in this case 'text'). +In this example, the text is reversed and returned all in one line. 'text[::-1]' is the Pythonic way of reversing a list or string. +The last line is the most important part. This tells Pesterchum to call this function whenever 'reverse()' is used in a quirk. diff --git a/docs/README-karxi.mkdn b/docs/README-karxi.mkdn new file mode 100755 index 0000000..c491cb1 --- /dev/null +++ b/docs/README-karxi.mkdn @@ -0,0 +1,184 @@ +Welcome to Pesterchum 3.41! +============================= + +## FOR NEW USERS +This modification of Pesterchum is intended for people who are already familiar +with using the base client. + +If you aren't, please check the standard build's [documentation][pchum-doc]. + +[pchum-orig]: https://github.com/illuminatedwax/pesterchum +[pchum-doc]: https://github.com/illuminatedwax/pesterchum/blob/master/README.mkdn + +## FOR EVERYONE ELSE +Greetings! This is a modification of Pesterchum, made because Pesterchum is +effectively no longer maintained, that is intended to fix a number of issues. + +The code used as a base is a newer version of Pesterchum than the one in +circulation, and thus has plenty of useful features that can be found in the +[CHANGELOG][changes]. + +In addition, there are other features and improvements that have been made, and +there are many more planned. Check the [TODO list][todo-done] to see what's +been fixed, as well as what's [planned][todo-upcoming]. + +[changes]: https://github.com/karxi/pesterchum/blob/master/CHANGELOG.mkdn +[todo-done]: https://github.com/karxi/pesterchum/blob/master/TODO.mkdn#tododone +[todo-upcoming]: https://github.com/karxi/pesterchum/blob/master/TODO.mkdn#features + +### Installation +There isn't an automated installer yet, but the steps involved aren't all that +difficult. + +#### Pitfalls +* If you're on a 64-bit system (and most are these days), use those links. You + can also use the 32 bit versions, if you choose, but you *cannot* mix them. +* If you're on a 32-bit system but use the 64-bit installers, you'll get an + error along the lines of "not a valid Win32 application", or the + installer will simply fail. +* This version of Pesterchum does not come compiled as an executable, and thus + does not have P ython/PyQt4 packaged with it. Those are necessary for + Pesterchum to run, so you have to install them manually. + +#### First-Time Install +Download links are for Windows, but a quick Google search will find everything +necessary. + +1. Install **Python 2.7** or higher if you don't already have it: + * [32 bit][python2-32] + * [64 bit][python2-64] + + Be **sure** to add Python to the PATH if asked to do so during + installation. It means Python will be usable from the console, + which is necessary for this to run. + +2. Install **PyQt4**: + * [32 bit][pyqt4-32] + * [64 bit][pyqt4-64] + +3. **(LINUX)** Install **pygame**: + * [pygame download page][pygame-dl] + * You don't need to install this if you're using Windows. Linux users need + to install it to enable sound, but it will otherwise work without it. + * If you want to download this, you should probably do so using your native + package manager. + +4. Download **Pesterchum**: + * [Download from main branch][pchum-zip] + +5. Unzip Pesterchum somewhere easily-accessible. + +6. **If you have any custom themes**, copy/paste them into the 'themes' folder. + You can find this in `%LOCALAPPDATA%\pesterchum`, which is the same as + `%APPDATA%\..\Local\pesterchum`. Copy/paste one into Explorer's address bar + and you'll end up where you need to be. + + Oftentimes the 'themes' folder doesn't exist in Pesterchum's user-specific + config folder, so you'll have to make it and copy the custom themes into + it. + + __If, for some reason, that doesn't work:__ + + You can also copy the missing themes into the 'themes' folder of the version + you just unzipped. **Don't overwrite any files** if you do this - the themes + used by this have been updated, and the older default themes may break when + used. + +7. Run Pesterchum! How you do this depends on the OS: + * **(WINDOWS)** Run `w32-run-pchum.bat`. + * **(LINUX)** Run `./pesterchum`, preferably via terminal. + * Note that this is made to provide debugging information - so that if + errors come up, they can be reported to me, and I can fix them. + +[python2-32]: https://www.python.org/ftp/python/2.7.12/python-2.7.12.msi +[python2-64]: https://www.python.org/ftp/python/2.7.12/python-2.7.12.amd64.msi +[pyqt4-32]: http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.4/PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe +[pyqt4-64]: http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.4/PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x64.exe +[pygame-dl]: http://www.pygame.org/download.shtml +[pchum-zip]: https://github.com/karxi/pesterchum/archive/master.zip + +#### Upgrading +**NOTE: This only applies to those who already have this patched Pesterchum +installed.** +**DO NOT extract this into a folder containing pesterchum.exe, because it WILL +break.** Read up to **First-Time Install** if you're installing this version +for the first time. +Otherwise... + +Just re-download the [Pesterchum zip][pchum-zip] and extract it over your old +installation, replacing everything that was already there. That's all there is +to it! + +#### Having Problems? +I can't offer much help in this regard; if you're getting errors, feel free to +try to contact me, but if you're having trouble with the installers, there's +little I can do. [How to install Python][howtogetpython] might help; failing +that, Google saves lives. + +[howtogetpython]: http://www.howtogeek.com/197947/how-to-install-python-on-windows/ + + + +SMILIES +------- +None of the smilies have changed or been added, yet; this list is kept for +posterity and easy reference. + +* `:rancorous:` +* `:apple:` +* `:bathearst:` +* `:cathearst:` +* `:woeful:` +* `:pleasant:` +* `:blueghost:` +* `:slimer:` +* `:candycorn:` +* `:cheer:` +* `:duhjohn:` +* `:datrump:` +* `:facepalm:` +* `:bonk:` +* `:mspa:` +* `:gun:` +* `:cal:` +* `:amazedfirman:` +* `:amazed:` +* `:chummy:` +* `:cool:` +* `:smooth:` +* `:distraughtfirman:` +* `:distraught:` +* `:insolent:` +* `:bemused:` +* `:3:` +* `:mystified:` +* `:pranky:` +* `:tense:` +* `:record:` +* `:squiddle:` +* `:tab:` +* `:beetip:` +* `:flipout:` +* `:befuddled:` +* `:pumpkin:` +* `:trollcool:` +* `:jadecry:` +* `:ecstatic:` +* `:relaxed:` +* `:discontent:` +* `:devious:` +* `:sleek:` +* `:detestful:` +* `:mirthful:` +* `:manipulative:` +* `:vigorous:` +* `:perky:` +* `:acceptant:` +* `:olliesouty:` +* `:billiards:` +* `:billiardslarge:` +* `:whatdidyoudo:` + + + +[modeline]: vim:set autoindent ts=4 sts=4 sw=4 tw=79 expandtab: diff --git a/README-karxi.mkdn b/docs/README-karxi.mkdn.backup similarity index 100% rename from README-karxi.mkdn rename to docs/README-karxi.mkdn.backup diff --git a/README-pesterchum.mkdn b/docs/README-pesterchum.mkdn similarity index 100% rename from README-pesterchum.mkdn rename to docs/README-pesterchum.mkdn diff --git a/docs/TODO.mkdn b/docs/TODO.mkdn new file mode 100755 index 0000000..552e733 --- /dev/null +++ b/docs/TODO.mkdn @@ -0,0 +1,358 @@ +# Todo + +## Git +* Set up issue tracking for this fork, if possible (and move the TODO list) + +## Features +* Log viewer needs to have BBCode/HTML/Text copy modes +* Turn @ and # links on/off? +* Show true bans? COMPRESS QUIT MESSAGES ON BAN +* Colour saving boxes things? +* Whowas for last seen online? +* Tab completion of two letter names +* Auto download/install updates via Windows installer +* Make toast notifications only on certain chums +* Local alisas for chums +* Don't make new windows be all in your face and shit +* Hide offline friends per group + +* LET PEOPLE TURN OFF HONKING - people already rename the soundfile and such to + do this manually + +* Add support for displaying more verbose information (e.g. Cease messages which + tell you more than the abbreviation of who left) +* Make Pesterchum recognize conventional /mes so they aren't invisible +* Make @XY and @xxxYyy formats ping their targets +* Allow matches like @?XY and @FXY or @PXY3 - make them only match the target + currently set to that. +* Make @ notation not match @u@; and similar (make invalid nick chars break + matches) +* Allow use of @ and # links to switch between logs in log viewer (start with + the closest time to the line of the log that's linking) +* Improve log viewer in general (unbind instances from specific users/memos) +* Fix hyperlink escaping (Qt seems to do this automatically - need a workaround) +* Show bans if +h or higher (+h, +o, +a, +q) +* Auto-invite (for people on the friends list?) +* Right click on names for inviting, ACTUALLY banning, PMing, ... See also: + Things proper IRC clients can do. (Set basic mode stuff up first, get the + infrastructure in place.) + +* Add more comprehensive status support - IDLE, DND, INVISIBLE for now - or at + least add similar functionality. +* Improve Pesterchum's tracking of disconnections (check memos for quits...) +* SEPARATE FUNCTIONALITY from CONNECTED STATE!! This is a huge problem! Being + shunted off our nick closes windows and breaks things! Just D/C and + reconnect? + * It'd probably be best to give an option to either CHANGE NICKS or + DISCONNECT upon nick collision...? But, then how would we GHOST? + * Auto-disconnect if collision before joining channels, make it + possible to disconnect (but not send messages, obviously) + without losing everything + * Maybe GHOSTing should use auto-identify to ensure- no, that doesn't + work, because we can't ident into a specified nick without being ON + it. Need GD's help to fix.... + +* Make it possible to test quirk things and such without connecting? This'd be + hard to separate out, but useful. + * Make a quirk 'bin' that exists independent of profiles, and can be + copied to/from at will. + * Allow us to set quirks that apply to all profiles! For things like + replacement quirks. + +* Right-click Time entry field to see those used? (Replace left/right buttons?) + * Save commonly-used times on a per-handle basis! +* Make the memo list highlight/recolor the names of channels you're in + (including secret ones) +* Add an option to Cycle (for log separation) + +* Add a separate 'Tweaks' section in Options +* Fix graphical issues with dark themes vs. light themes (Qt/text too + light/etc.) + +### Services +* Use web connection to send offline messages in email-like fashion + (Idea: ghostDunk) +* Better NickServ registering +* Implement **MemoServ** support +* Tell user when NickServ handles are going to expire +* Tell user when old handles have D/C'd? Offer autoghost support?! + +### GUI +* Refactor code to make way for QShortcut usage. (Unify shortcut processing?) + * Enable/Disable toggle (Firefox style option sheet-esque? Seems okay.) + * Ctrl+W closes tab + * Ctrl+Shift+PGUP/PGDN moves tab + * Option to disable Ctrl+Tab's jump to newest + * Ctrl+Shift+V "Mass Paste" option (parse lines in sequence)? +* Make mouseovers (refocusing) reset idle timer (disableable) +* Set up EVENT FILTERS in windows to redirect events to the right places + * Make the context key (if used in the text area) append the menu options + from the right-click menu +* Make system messages use timestamps like everything else +* Offer option for timestamps in memos +* Make a status window/popup to contain logs of information like invites + +### "Security" +**Note: The idea of security on this platform is pretty much laughable. Most of +these changes are simply bandages being placed over fundamentally flawed +design.** + +If you want Pesterchum to be more secure, either get ghostDunk to make changes +to the server and its administration policies, or get everyone to switch to this +version of the client. There aren't really any other options. + +* Flood protection (don't send because of the same target too many times in a + row) + * Just requires a timer + lastmessage date check. +* Lock exploitable functionality to those on your friends list (optional) + * Canon handles are excluded from this concern, but subject to flood + controls regardless. + * A measure of politeness is reasonable here - checking if a friend is on + as a different handle should be okay, once IRC access is revamped. + * Don't send MOOD answers to those not friended + * Ignore pesters from those not on your friends list (optional) + * Ignore pesters from those not sharing a memo? (optional) +* Make BLOCKED list persistent, if it isn't already + * Offer option to block hosts, not just handles... + * Explain to the user that this option is very dangerous. + +### Advanced +* Offer option for 'new' syntax adjustments + * Replace: "???, ???, ??? ceased responding to memo." for parts. + * "XY ({handle}) ({times}) ceased responding to memo." + * If +h or above: Include host as well as handle. + * Replace: "??? ceased responding to memo." for nickchanges. + * "XY ({handle} {host?}) left memo; AB ({handle} joined memo." + * Can violate the norms somewhat, these aren't theme-controlled. + They're basically for power users/admins. +* Offer GUI changes + * Make tabs "{name} ({# of unread msgs})" if unread + * Make themes able to define colors that are too dark to read for an + individual window + * Set up code for 'nudging' color codes into readable territory; presumably + via an adjustable setting. (This CANNOT affect logs - just the log + reader.) +* Come up with a solution for duplicate times/handle abbreviations + * Maybe make mouseover for the handles display the full handle? + +* Option to disable backwards compatibility: + * For those that are *really* sure that this build is the build for + them. + * Should enable extra features, including ctag compression. + * Allow manual compression changes via memo right-click menu for + 'advanced' (per the setting) users + +## Todo/Done +**Everything in this section has already been completed.** + +### GUI +* Toggle individual tab flash / alert sounds (from the same right-click memo + that lets us toggle OOC) +* Make CTRL+PGUP/PGDN switch memo/pester tabs +* Make Ctrl+J/K usable for tab changing +* Make right-clicking on a tab open up the right-click menu one would get on + right-clicking the title (frame??) +* Right-click in userlist offers option to Pester +* Make certain dialogues start on the safer of the two options + * Make the Reconnect dialog start on Reconnect + * Make the Rejoin dialog start on Rejoin + * Make the Invite dialog start on Decline + +### Usability +* Fix parser text-loss bug that plagues everyone (especially Chumdroid users) +* Make /me messages that cut continue into more /me messages +* Make sound work on Windows through QSound (disables volume control) +* Color tags are now posted as their shorter hexadecimal forms, if applicable + (255,255,255 -> #FFFFFF, for example) +* Separate auto-idle and checkbox idle so they don't share a state (and make + the first send set the timer for additional idle responses) +* Stop us from sending IDLE messages to NickServ +* Fix NickServ auto-login things +* Make a window that can be used to interface with the script directly - a + simple Python console +* Make the memo name entry box accept a comma-separated list +* Make console users able to check widget theme/style information via mouseover + and key combo (for people making themes or debugging) + * This is presently Ctrl+Alt+w, after opening the console (Ctrl+~). + +### Backend +* Perpetual code cleanup, refactoring, simplification and general improvements +* Syntax changes/updates and the like + +## Code +**Improvements and changes pertaining to Pesterchum's internals.** + +### General +* Implement new Lexer for the sake of everyone's sanity + * This is half-done - rendering still uses the old lexer +* Redo `PESTERCHUM:` processing/redo whole msg received processing chain +* Redo text processing in general +* Redo quirk processing (use pieces from Textsub if needed) +* Pare down the PesterMemo object so it inherits more things from PesterConvo + *implicitly* +* SOONER OR LATER: Redo internal chum storage, centralize data into widely + accessible manager objects, etc. +* Also: Overhaul settings storage. Bring it more in line with the system Textsub + used (if feeling masochistic), but simpler. +* **Overhaul information storage** - chums, conversations, memos; all should be + handled by a backend and merely RENDERED into Qt objects!! +* Overhaul debugging + * Give an actual (small) window with traceback that can be sent to dev(s) + * Use the console for this? +* Debug generic.py's CaseInsensitiveDict/replace it with mine +* Overhaul messaging so **Chan/Nick/Memo Servs** all use the same code (and + lexer) +* **Separate Pesterchum system handling from window handling.** Dicts should be + stored and maintained via dicts - even a refined version of what I used for + textsub. + * Doing it this way means I can fix the case in/sensitivity issue, too. +* Set up framework for easily logging/accessing channels, users, etc...like + what hexchat has. +* More efficient framework for accessing stored user information - right now, + Pesterchum keeps information on user colors and such on hand *forever*, + meaning that things inevitably get clogged up with handles that are never + really seen, or only seen once, or even just randomly generated. This is + silly and should be changed; I'll probably make a namedtuple for users or + something, and save it all to a separate JSON file or two. + Said JSON file should keep the extra information on hand - or rather, the + 'recent users' JSON file should keep most of the detailed information and be + accessed first, with the larger 'inactive users' file being accessed to + check for unfamiliar handles. + These would have to output the old data to pesterchum.js for backwards + compatibility purposes. +* Finish creating the sound wrapper. Just make it check what the type of sound + needed is upon creation, and instantiate a private class based off of that. + * There is basically no good way to do this without moving to Qt5. I + might try that myself later, but that's a long-term goal. +* Stop from sending TIME notifications when unable + * Until then: Hide resulting "no external messages"/+m messages. +* Stop sending auto-IDLE messages unless the chat has been updated since the + last one. +* Make groups, chums, etc. preferentially load from the main directory, *then* + check logs. + * Compatibility is important, so update both if they exist. (Bluh!) + +### Debugging +* Set up a simple function to display a traceback instead of silently moving on! + * Use the console for this? +* Make small, simplistic windows that allow the viewing of internal variables + pertaining to things like set quirks, users present, etc. + * Also let it display the stylesheet settings of the current window, or + similar. +* Make a console to display debug info without requiring us to run from terminal +* Allow us to specify flags via command line + * Let us specify a separate config (pesterchum.js) file!! +* Make the console support color (not ctags, more stylesheet stuff) (need + parser work for this) + +## Bugs +* weird memo time bug +* Windows doesn't show style sheet sometimes?? Maybe related to themes. +* Issues with connecting? Client not closing connection right? People keep + getting "nick taken" messages +* When using mood sort, scroll position jumps to last selected chum +* Closing a timeclone doesn't actually cease for everyone else +* Kill Zalgo +* Random invisible, tiny links to last link at end of every message +* Chums not appearing on chumroll when initals are the same? (bS) +* Recognize IRC 471, 473, 474 and 475 +* memo links aren't case sensitive + +* Mentions occasionally don't work (e.g. in /me) +* Character times aren't 'forgotten' on Part +* +c is not properly recognized on join, nor does it stop someone from + reenabling their quirk (let ops and above ignore it?) +* Chumlist handles groups pretty badly (no using the same name as a handle, for + example? Needs an errormessage at least) + * The whole chumlist handling system really ought to be refactored into + something sane...the objects should only be there to render +* PESTERCHUM: messages are sent to things like NickServ +* Log folder/file names are not case-sensitive, so they break on non-Windows + systems +* Log viewer needs adjustments and sanity checking for log directories +* Capitalized /me's don't render (should forcibly lowercase them) +* 'pcd10' and similar users don't get proper abbreviations on part (ugh) + +* Volume control doesn't work without pygame +* Sound on Linux doesn't work without pygame +* Update checking code gives false positives (update to use json file from git?) +* Pesterchum doesn't seem to close all of its file handles - it runs out of + handles to use on Linux + * Others have reported memory leak-induced crashes on Windows. These + may or may not be related. +* Pesterchum groups aren't carried over when profiles are copied! +* Malformed Pesterchum profiles cause the program to crash and burn + * What causes these? Exiting in the middle of a write operation? Threading + issues? +* Malformed Python quirks try to open an error dialog and crash if Pesterchum + is opened as a module +* Pesterchum's threading is messy and scary, and should probably be cleaned up + some via the addition of locks +* Pesterchum's file handling is atrocious - inefficient to the extreme. + * There are multiple copies of things that really need only be loaded once + in a lot of different places. + * Memos don't seem to close their file handles properly. (Logs too??) + +## Windows Bugs +* XP SP2: sometimes mouse clicks dont register? must be some kinda crash +* On reconnect and nick change, momentary theme change causes menu items to + stop working +* Random chums won't show up on chumroll +* Popup toast notifications cause main window to raise + +## Mac Bugs +**Due to my lack of access to a Mac, these are unlikely to be fixed.** +* Mac doesn't show tabs right, display gifs, highlighting thing? +* SS: also the background image is broken +* SS: in the one-on-one pester it resizes with the window +* SS: but the memo one doesn't resize +* SS: and the arrows next to the time thing overlap the CLOSE button +* Lex: There seems to be a faint outline around most non-square themes. + + +## Things that won't be done +**Requests that, for one reason or another, will not be fulfilled.** + +### Scrapped Features +**I'll explain why these ones won't happen.** + +> * More complex quirks: by-sound + +* This would require a way to determine what maps to a sound, and + replace it. + I've played with the idea before. It resulted in me needing to look + up things like the [Metaphone Algorithm][metaphone] to figure out + how it might be even remotely possible. The results were NOT a fun + time; if this is ever implemented, it will be much, much later than + just about everything else. +[metaphone]: https://en.wikipedia.org/wiki/Metaphone + +> * Spy mode + +* I feel as though I shouldn't need to tell anyone why this is a bad idea. + Some people already have this capability anyway; I used to be one of them. + There's no real need to implement an inferior version into every single + client on Pesterchum. + +> * "Someone has friended you" notifier +> * Spectation notices (Idea: lexicalNuance) (probly WONTFIX) + +* These are milder invasions of privacy than the above, but they are still + invasions of privacy. + +> * When 'banned' make impossible to connect using timestamp banned under + +* This is a lot of work for something that purely affects immersion - while + also breaking a number of things in the process. Too much work for too + little payoff. + +> * Use web connection to save profiles (Idea: ghostDunk) + +* There is no way to do this now that Pesterchum is basically unsupported; an + external server would be necessary for storage. + As such, you'll just have to settle for copying your profiles and logs when + you change computers. + + + +[modeline]: vim:set autoindent ts=4 sts=4 sw=4 tw=79 expandtab: diff --git a/themes.txt b/docs/themes.txt similarity index 100% rename from themes.txt rename to docs/themes.txt diff --git a/docs/trollquirks.mkdn b/docs/trollquirks.mkdn new file mode 100755 index 0000000..d957cce --- /dev/null +++ b/docs/trollquirks.mkdn @@ -0,0 +1,182 @@ +Troll Quirks +============ + +Karkat +------ +
+REGEXP: "(.)"
+REPLACED WITH: "upper(\1)"
+
+ +Aradia +------ +
+REGEXP: "[oO]"
+REPLACE WITH: "0"
+
+ +#####After Prototyping +
+RANDOM REGEXP: "\s"
+REPLACED WITH: " ribbit ", " ", " ", " ", " ", " ", etc....
+
+ +Tavros +------ +
+REGEXP: "([a-z])"
+REPLACED WITH: "upper(\1)"
+
+
+REGEXP: "(^[A-Za-z])"
+WITH: "lower(\1)"
+
+
+REGEXP: "([iI])\b"
+WITH: "lower(\1)"
+
+
+REGEXP: "([\.\?!]|$)"
+WITH: ","
+
+
+REGEXP: "(,\s?\w)"
+WITH: "lower(\1)"
+
+ +Sollux +------ +#####Pre-blind +
+REGEXP: "[iI]"
+REPLACE WITH: "\1\1"
+
+
+REGEXP: "[sS]"
+REPLACE WITH: "2"
+
+
+REGEXP: "\btoo?\b"
+REPLACE WITH: "two"
+
+ +#####Blind +
+REGEXP: "[oO]"
+REPLACE WITH: "0"
+
+ +Nepeta +------ +
+PREFIX: ":33 < "
+
+
+REGEXP: "[eE][eE]"
+REPLACE WITH: "33"
+
+ +Kanaya +------ +
+REGEXP: "\b(\w)"
+REPLACE WITH: "upper(\1)
+
+ +Terezi +------ +
+REGEXP: "[aA]"
+REPLACE WITH: "4"
+
+
+REGEXP: "[iI]"
+REPLACE WITH: "1"
+
+
+REGEXP: "[eE]"
+REPLACE WITH: "3"
+
+
+REGEXP: "(.)"
+REPLACE WITH: "upper(\1)"
+
+ +Vriska +------ +
+REGEXP: "[bB]"
+REPLACE WITH: "8"
+
+
+RANDOM REGEXP: "([aeiouAEIOU])"
+REPLACE WITH: "\1\1\1\1\1\1\1\1", "\1", "\1", "\1", "\1", "\1", etc........
+
+
+RANDOM REGEXP: "([\.\?,!]$)"
+REPLACE WITH: "\1\1\1\1\1\1\1\1", "\1", "\1", "\1", "\1", "\1", etc........
+
+
+REPLACE: ":"
+WITH: "::::"
+
+ +Keep in mind that the RANDOM REGEXP ones require the extra "\\1"s to be added in order to not happen all the time. If you want those quirks to happen less often, add more "\\1". + +Equius +------ +
+PREFIX: "D --> "
+
+
+REGEXP: "[lL][oO][oO]"
+REPLACE WITH: "100"
+
+
+REGEXP: "[xX]"
+REPLACE WITH: "%"
+
+
+REGEXP: "(\b[sS][tT][rR][oO][nN][gG]\w*)"
+REPLACE WITH: "upper(\1)"
+
+
+REGEXP: "[oO][oO]"
+REPLACE WITH: "00"
+
+ +Gamzee +------ +#####Version 1: "HoNk HoNk" +
+REGEXP: "([a-zA-Z])([a-zA-Z]?)"
+REPLACED WITH: "upper(\1)\2"
+
+ +#####Version 2: "HoNk hOnK" +
+REGEXP: "([\w\s])([\w\s]?)"
+REPLACED WITH: "upper(\1)\2"
+
+ +Eridan +------ +
+REGEXP: "([vVwW])"
+REPLACE WITH: "\1\1"
+
+
+REGEXP: "ing\b"
+REPLACE WITH: "in"
+
+ +Feferi +------ +
+REGEXP: [hH]
+REPLACE WITH: ")("
+
+
+REPLACE: "E"
+WITH: "-E"
+
diff --git a/pesterchum.py b/pesterchum.py index 9d54e97..f56945f 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -1139,7 +1139,7 @@ class PesterWindow(MovingWindow): self.console = AttrDict(dict( window = None, - action = QtWidgets.QAction("Console", self), + action = QtWidgets.QAction("Console".upper(), self), is_open = False )) self.console.shortcuts = AttrDict(dict( @@ -1519,10 +1519,11 @@ class PesterWindow(MovingWindow): win = self.console.window if win is None: # We have no console window; make one. - logging.warning("Making a console....") + logging.info("Making a console....") self.console.window = win = console.ConsoleWindow(parent=self) - logging.warning("Console made.") - win.windowClosed.connect(self.consoleWindowClosed) + logging.info("Console made.") + # 'ConsoleWindow' object has no attribute 'windowClosed' + win.finished.connect(self.consoleWindowClosed) self.console.shortcuts.curwgt.activated.connect(win.designateCurrentWidget) if self.console.is_open: @@ -1575,7 +1576,7 @@ class PesterWindow(MovingWindow): def consoleWindowClosed(self): self.console.is_open = False self.console.window = None - logging.warning("Console closed.") + logging.info("Console closed.") def newMemo(self, channel, timestr, secret=False, invite=False): if channel == "#pesterchum": @@ -3346,6 +3347,7 @@ Click this message to never see this again.") def _retrieveGlobals(): # NOTE: Yes, this is a terrible kludge so that the console can work # properly. I'm open to alternatives. + # 👁️👁️ return globals() if __name__ == "__main__": diff --git a/pesterchum.spec b/pesterchum.spec index 6e23c73..15229e6 100644 --- a/pesterchum.spec +++ b/pesterchum.spec @@ -6,10 +6,10 @@ added_files = [ ( "quirks", 'quirks' ), ( "smilies", 'smilies' ), ( "themes", 'themes' ), + ( "docs", 'docs' ), ( "README.md", '.' ), - ( "README-karxi.mkdn", '.' ), - ( "README-pesterchum.mkdn", '.' ), - ( "themes.txt", '.' ), + ( "LICENSE", '.' ), + ( "CHANGELOG.md", '.' ), ( "server.json", '.' ), ( "PCskins.png", '.' ), ( "Pesterchum.png", '.' ) diff --git a/setup.py b/setup.py index 8092a11..bf58404 100644 --- a/setup.py +++ b/setup.py @@ -18,10 +18,10 @@ else: includefiles = ["quirks", "smilies", "themes", + "docs", "README.md", - "README-karxi.mkdn", - "README-pesterchum.mkdn", - "themes.txt", + "LICENSE", + "CHANGELOG.md", "server.json", "PCskins.png", "Pesterchum.png"]