Commit graph

70 commits

Author SHA1 Message Date
Vincent Le Goff
8343b61772 Add a style 4 for the time_format utility 2017-03-19 19:57:09 +01:00
BlauFeuer
5111fb9a1e Markup, whitespace, typo and code style fixes 2017-02-20 01:41:43 -05:00
Griatch
7e4155d4cd Some more minor refactorings, pertaining to #1176. 2017-01-30 20:18:21 +01:00
Griatch
74eebfed6d Refactor code to remove alerts as per lgtm and #1176. 2017-01-29 19:02:00 +01:00
Griatch
c6d9c0619e Refactor code for readability and compatibility. 2017-01-27 00:19:27 +01:00
Griatch
958b333a59 Small refactoring. 2016-12-11 22:07:38 +01:00
Simon Vermeersch
336002fc7f Speedup for m_len to not do the regex when not needed 2016-12-11 21:58:06 +01:00
Griatch
e6f857a536 Remove setting.SEARCH_MULTIMATCH_SEPARATOR, replacing it with SEARCH_MULTIMATCH_REGEX and SEARCH_MULTIMATCH_TEMPLATE. This allows simple yet powerful control over the error output without needing to overload the parser. 2016-09-11 10:39:47 +02:00
Griatch
086beb1c26 Remove non-functional retval from utils.delay, making it a straight wrapper for twisted.reactor.callLater. 2016-09-02 17:17:50 +02:00
Griatch
9ec875f29c Add justify(text,width,align,indent) function to utils. Supports full-,left-,right- and center justification of text to any width. It also has an option to add left-side indentation to the text block. 2016-08-26 01:04:23 +02:00
Griatch
ecb7d6fcc5 Change utils.wrap() to indent on all lines, not only the lines following the first. If someone remembers why this default was set, do report it. 2016-08-25 18:36:21 +02:00
Griatch
6c34cb40ed Update pypath_to_abspath to make batchfile file lookups much more reliable. This is done as part of the batchprocess refactor #939. 2016-08-24 20:37:11 +02:00
Griatch
9da1051f83 Fix a bug in to_str() that caused it to not actually try alternative encodings when converting. 2016-08-17 18:37:31 +02:00
Griatch
8b6891428f Add an extra layer of encoding recovery when sending data to sessions, as per #800. 2016-08-17 12:30:44 +02:00
Griatch
ddd9387777 Fixed a traceback in SEARCH_AT_RESULT when getting multi-matches for commands. 2016-06-15 21:51:43 +02:00
Griatch
6a160b4204 Fix how the lock command returns strings to avoid a malformed AMP send. This (again fixes ##996. 2016-06-15 21:33:05 +02:00
Griatch
730d08e790 Fixed a bug in obj_from_dbid (obj_from_dbref). Resolves #980. 2016-06-01 23:09:33 +02:00
Griatch
6e606ae530 Fixed a bug when reporting multi-match errors in the default at_search_result with a particular input. Resolves #963. 2016-05-22 20:49:45 +02:00
Griatch
f57aaa65cd Made the return of multimatch commands more easily parsable by using the query rather than the key. Resolves the second part of #933. 2016-05-22 20:45:43 +02:00
Griatch
08f34ae61b Made the multimatch error messages with the multimatch_string supplied more useful, addressing the first part of #933. 2016-05-22 20:45:43 +02:00
Griatch
6782ff1333 Made the default_settings file itself detect GAME_DIR, leading to a lot less cookie cutter in the gamedir/server/conf/settings.py file. Refactored the detection algorithm also in the launcher. 2016-05-22 20:45:39 +02:00
Griatch
323a353ec3 Fixed a regression in the changes made to all_from_module that caused evform to fail. 2016-05-22 20:45:38 +02:00
Griatch
96ace8c75f Starting to clean up and debug the server-side infrastructure 2016-05-22 20:45:05 +02:00
Griatch
d966051558 Changing utils.all_from_module to really only load variables actually
defined in the module in question (so will no longer include imports
from other modules). Added utils.callables_from_module to handle the
common case of only wanting callable functions from a module (used by
lock funcs, inlinefuncs etc).
2016-05-22 20:45:05 +02:00
Griatch
0248a3ba1b Fixed a documentation error in string_suggestions 2016-04-05 14:56:42 +02:00
CloudKeeper1
23dbdb4570 Update utils.py
Changes only effect time_format.
Line 302 - Removed seconds_str. Superfluous.
Line 303 - Provides minutes_str a default value which remains if value is below lowest descriptor. Previously if seconds was below a minute style 2 would return absolutely nothing.
2016-03-27 15:35:54 +02:00
Griatch
8d672a8e9d Updated the docstring for utils.delay since it can also accept a float as well as an int. 2016-01-16 16:36:51 +01:00
Russell Jones
27549eca2e Use 2/3 raise_() from future.utils 2015-12-20 14:14:02 +00:00
Griatch
641846e855 Added a functioning version of nested inline funcs. Still poor error handling and some edge cases are not handled. 2015-11-28 18:25:04 +01:00
Ahmed Charles
faacf58f56 Use viewkeys from future.utils, with the following mapping:
dict.keys() -> viewkeys(dict)
2015-11-16 21:20:25 +01:00
Ahmed Charles
76dc0545c4 Remove unused traceback imports. 2015-11-15 20:40:03 +00:00
Ahmed Charles
bcd8674ef3 Use python3 range.
Including potential memory reduction due to not created unnecessary lists.
2015-11-02 11:47:07 +00:00
Ahmed Charles
11b61fe335 Import python3 compatible object. 2015-11-02 00:19:04 +01:00
Ahmed Charles
cbe1eefcf0 Move to python3 style division.
All of these are currently integer division in python2.
2015-11-01 20:47:18 +00:00
Ahmed Charles
c8fbd2860d Use logger rather than print for these messages. 2015-11-01 21:39:48 +01:00
Ahmed Charles
3357712103 Use logger rather than a custom implementation. 2015-11-01 20:27:49 +00:00
Griatch
c7e1a6a086 Resolved merge conflicts against master. 2015-10-20 00:07:39 +02:00
Griatch
50371b6abd Merged conflicts. 2015-10-19 23:32:00 +02:00
Ahmed Charles
0384fcc63d Move to python3 style except. 2015-10-19 23:31:19 +02:00
Griatch
b952a290b5 Fixed conflicts against master. 2015-10-18 12:43:43 +02:00
Griatch
0c7ee1bdfc Fixed a bug in search error reporting. Made accept to change a player's name. Closes PR: Resolves #820, Resolves #821, Resolves #822, Resolves #823. 2015-10-16 22:34:40 +02:00
Russell Jones
06c3dc0ed3 Run "futurize -1 -w -n ." 2015-10-01 20:00:28 +01:00
Griatch
f73dc81274 This concludes the translation of Evennia's docstrings to Google style. This Resolves #709. 2015-09-27 20:24:03 +02:00
Griatch
eb2bd8d44c Converted a large part of utils/ folder to google code docstrings as per #709. 2015-09-27 20:24:03 +02:00
Griatch
2743f98fb0 Removed SEARCH_AT_MULTIMATCH_INPUT and SEARCH_AT_MULTIMATCH_CMD settings and connected functions - these are no longer individually overloadable. SEARCH_AT_RESULT function now handles all error reporting. Also added SEARCH_MULTIMATCH_SEPARATOR to make it easy to replace the character used to separate multi-matches (1-box, 2-box is using '-' by default), in response to #795. Also moved the default SEARCH_AT_RESULT function from the cmdparser to evennia.utils.utils. 2015-09-27 13:05:29 +02:00
Griatch
cc2b094bc6 Moved lineditor into utils/eveditor.py. The line editor is accessed by simply importing the class (same as EvTable, EvMenu etc), so the utils.get_line_editor function was removed. 2015-07-09 14:37:09 +02:00
Griatch
97e04ee710 Twisted min version upped to 15.2.1 due to a change in the LoopingCall infrastructure that Evennia relies on. This resolves #744 by updating the Evennia implementation accordingly. 2015-05-27 22:35:05 +02:00
Griatch
b59e38caf5 Adding migrations for django1.8. 2015-04-04 00:08:51 +02:00
Griatch
3ebc55da82 Changed datetime setter to use utils.timezone instead of naive datetime stamps, as per #728. 2015-03-27 07:05:13 +01:00
Jonathan Piacenti
89a39a8481 Pull line editor out of contrib and into main. 2015-03-26 17:10:42 -05:00