Ben Kurtovic
ffc63c38f6
New additions and changes to wikitools, mostly namespaces.
Site: Store namespace information in self._namespaces, a dict where key is a namespace ID and value is a list of
matching names and aliases; added _get_namespaces_from_api(), namespaces(), namespace_id_to_name() and
namespace_name_to_id(); get_page() and get_category() are smarter;
Constants: new module, with 18 variables starting with "NS_" that hold IDs of common namespaces, e.g NS_USER = 2,
NS_PROJECT = 4;
Exceptions: added NamespaceNotFoundError, raised by Site when bad input is given to namespace_id_to_name() or
namespace_name_to_id();
User: self.name -> self._name; new name() method returns name from API; dropping "get" from methods that return
just a variable;
Category: get_members() -> members().
13 years ago
Ben Kurtovic
6aa2370900
Exception and function cleanup in wikitools:
* Got rid of ConfigError from exceptions.py.
* Try to load config ourselves if it isn't already, via the new _load_config()
method of Site. It uses getpass if passwords are encrypted, as done by
earwigbot.py.
* Cleaned up UserNotFoundError in user.py and exceptions.py.
13 years ago
Ben Kurtovic
7639b76d1c
Merge branch 'develop' into feature/wikitools-core
13 years ago
Ben Kurtovic
f1171ed452
Committing changes made while working on feature/wikitools-core that don't apply to wikitools:
Adding .DS_Store to .gitignore (pesky OS X)
Adding a is_config_loaded() function to core/config.py
Some cleanup in core/config.py: doc clarification, misc fixes...
13 years ago
Ben Kurtovic
b290582dbf
added a bunch of new methods to User in wikitools; added one user-related exception to wikitools; moved .get_rights() call in IRC command !rights to .get_groups(), because get_rights() now returns actual rights (thanks to the API)
13 years ago
Ben Kurtovic
28cbbd7221
afcAFCStatus and Rights IRC commands now use wikitools
13 years ago
Ben Kurtovic
76113a3f6a
Cleaning up slightly and adding some more methods:
User: added .get_rights() (working) and .exists() (skeleton).
Page: added .exists() (skeleton); store text as ._content; get() has a force_reload argument.
Category: fixed missing self in .get_members().
Site: self.__api -> self._api; self.__sql -> self._sql
13 years ago
Ben Kurtovic
f4219ffad0
More work on the early stages of wikitools:
tools.get_site() returns an actual Site object, thanks to tools.functions._get_site_object_from_dict().
Site objects now have a working (but primitive) .api_query(), .get_page(), .get_category(), and .get_user().
Page objects now have a working .get(), for getting page content from the API.
Category is now a subclass of Page, and has its own .get_members(), which returns a list of titles.
Still need to implement proper namespace logic in pages.
13 years ago
Ben Kurtovic
edfa1d2d9e
beginning wikitools core development with a few skeleton classes and one (nearly) working function, tools.get_site() (doesn't return a Site object yet)
13 years ago
Ben Kurtovic
a84d25bc9d
clarify what verify_config() returns
13 years ago
Ben Kurtovic
50f1f38fe3
list, not tuple
13 years ago
Ben Kurtovic
f81229a999
don't give a status report to ourselves when we join the AFC channel
13 years ago
Ben Kurtovic
5be9dea1d5
docstrings in Tasks command; make !task work with !tasks and !threads; make the afc_statistics task skeleton print kwargs in run() for testing
13 years ago
Ben Kurtovic
7bbffaed92
cleaning up existing task skeletons and making task_name class-wide instead of instance-wide
13 years ago
Ben Kurtovic
5756e99085
making task_name class-wide instead of instance-wide; better docs for BaseTask; slight cleanup in task_manager
13 years ago
Ben Kurtovic
e6b3f4c616
tweaking aggregate algorithm to better match {{AFC status}}; cleanup and docstringing on methods
13 years ago
Ben Kurtovic
b6873cf992
missed a couple selfs
13 years ago
Ben Kurtovic
bbc5cc6e7c
adding a new command, !report, as AFCReport in irc/commands/afc_report.py
13 years ago
Ben Kurtovic
c44bc87b93
http://en.wikipedia.org/wiki/ -> http://enwp.org/
13 years ago
Ben Kurtovic
21e87d9d3c
in AFCStatus, use 'if x.y and x.z in [a, b, c]' instead of 'if x.y and (x.z == a or x.z == b or x.z ==c)'
13 years ago
Ben Kurtovic
e5ba64bef8
content -> message, oops
13 years ago
Ben Kurtovic
12c71675d3
adding a !remind command from old EarwigBot, which spawns a new thread that sleeps until its time is up, so impimplementing in !tasks list; {} -> {0}, etc in tasks.py for Python 2.6 support; stripping indentation on blank lines in tasks.py
13 years ago
Ben Kurtovic
413f6c840b
saying user is redundant - removing
13 years ago
Ben Kurtovic
b99a24fbbd
forgot that I need to insert a space when joining data.args; typo fix
13 years ago
Ben Kurtovic
ffe05d3463
adding a !rights command to get user rights/groups
13 years ago
Ben Kurtovic
56738eaede
argh - bugfix in lib/blowfish.py
13 years ago
Ben Kurtovic
bea5a3bc7e
update message in README to be a tad more verbose (and to match the github description)
13 years ago
Ben Kurtovic
7dc33cb9af
Merge branch 'feature/config_rewrite' into develop
13 years ago
Ben Kurtovic
e11cbffa92
uh, right...
13 years ago
Ben Kurtovic
7311ae4bb8
switching from XML config to JSON config - it's just much easier to parse and little easier on the eyes (not to mention shorter in length)
13 years ago
Ben Kurtovic
a06e35ecef
moving IRC class modules (base_command.py, connection.py, data.py, rc.py) to irc/classes/
13 years ago
Ben Kurtovic
d57f2623d2
parse remaining parts of config.xml; getting rid of config.watcher and moving to irc/watcher_logic.py; convert irc/watcher.py and wiki/task_manager.py to new config system; other changes/fixes/whatever
13 years ago
Ben Kurtovic
e21a4dfb76
converting four IRC command classes to use new config system; everything's been converted except for irc/watcher.py and everything in wiki/
13 years ago
Ben Kurtovic
430ba061af
store config differently (in five separate global variables instead of one) to make accessing it cleaner; convert core/main.py to new config system as well as irc/frontend.py -- both seem to be working
13 years ago
Ben Kurtovic
848ac58e7a
dramatically simplify error handling with !encrypt/!decrypt irc commands, thanks to previous commit
13 years ago
Ben Kurtovic
814c9efdce
nicer error message that actually tells us what's going on, thanks to the changes in lib.blowfish upstream (on develop)
13 years ago
Ben Kurtovic
2c7b684fa0
simplify exceptions into four classes instead of eight; make error messages more verbose
13 years ago
Ben Kurtovic
8e5af3dff8
import lib.blowfish in core.config and decrypt passwords correctly; Exception -> Error in custom config exception names
13 years ago
Ben Kurtovic
db0b125897
specify core/main.py as an absolute path, so we don't have to run 'python earwigbot.py' from within earwigbot/, but we can also do 'python /path/to/earwigbot.py'
13 years ago
Ben Kurtovic
d9dd0a8bd8
Merge branch 'feature/cryptography' into develop
13 years ago
Ben Kurtovic
f90167e8e7
blowfish.encrypt(key, plaintext), blowfish.decrypt(key, cyphertext); clean up certain things; 'python lib/blowfish.py' is interactive; implement blowfish in Cryptography()
13 years ago
Ben Kurtovic
1e89d2a06f
new blowfish.py module, some changes in Cryptography(), LICENSE cleanup
13 years ago
Ben Kurtovic
02b8fbdd1b
ugh I am an idiot
13 years ago
Ben Kurtovic
369b60b823
adding Cryptography() IRC command class with hash functions via hashlib
13 years ago
Ben Kurtovic
94848ab0bc
wrap parse_config() to catch ConfigParseExceptions and report them to the user cleanly; some minor doc changes.
13 years ago
Ben Kurtovic
6869900b65
core/config.py can now parse the <irc> tag fully; added some new functions that I pulled out of parse_components(); added stubs for encrypting/decrypting passwords; nitpick in core/main.py
13 years ago
Ben Kurtovic
7c8d3a33ab
more config-parsing backbone work; parsing the <components> tag is functional; some other cleanup/changes
13 years ago
Ben Kurtovic
26e0058ca3
allow a default value for attribute_to_bool(); rework config.xml structure slightly
13 years ago
Ben Kurtovic
a568ec6777
lots of work on config.py, earwigbot.py, and main.py; TODO: actually parse config files; convert components to new config format; make_new_config()
13 years ago
Ben Kurtovic
c8add512f4
dropping config/ subdirectory in favor of a single config.xml file, located in the bot's root dir, with encrypted passwords instead of a secure.xml file
13 years ago