You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(79) |
Jul
(128) |
Aug
(125) |
Sep
(65) |
Oct
(28) |
Nov
(7) |
Dec
(40) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(65) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2003 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: will g. <wil...@us...> - 2003-11-17 22:24:51
|
Update of /cvsroot/bluemud/bluemudatlas In directory sc8-pr-cvs1:/tmp/cvs-serv23510 Modified Files: TODO atlas.py atlas_image.py Log Message: Cleanup of symbol handling. Added a key to the bottom of maps which uses the symbol label and the tile. Added solid color tile support (dblue, dgreen, lred, ....). Index: TODO =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/TODO,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** TODO 28 Feb 2003 01:17:26 -0000 1.2 --- TODO 17 Nov 2003 22:24:48 -0000 1.3 *************** *** 16,19 **** --- 16,20 ---- - done - change draw_html to use templates - done - add axis numbers + - overhaul to use distutils support general: *************** *** 34,37 **** --- 35,39 ---- image outputter: + - map on top of another map image - handle josh's exits idea (where exits are little lines between rooms and don't take an entire tile) Index: atlas.py =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/atlas.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** atlas.py 6 Aug 2003 01:05:45 -0000 1.17 --- atlas.py 17 Nov 2003 22:24:48 -0000 1.18 *************** *** 1,3 **** ! #!/usr/local/bin/python ##################################################################### # This file is part of Bluemud Atlas. --- 1,3 ---- ! #!/usr/bin/python ##################################################################### # This file is part of Bluemud Atlas. *************** *** 296,301 **** # to something meaningful. elif mem.find("=") > -1: ! symbol = mem[:mem.find("=")].strip() ! self._symbollookup[symbol] = mem[mem.find("=")+1:].strip() continue --- 296,308 ---- # to something meaningful. elif mem.find("=") > -1: ! symbol = mem.split("=") ! ! tempsym = symbol[1].split(",") ! if len(tempsym) == 2: ! tempsym = [tempsym[0].strip(), tempsym[1].strip()] ! else: ! tempsym = [tempsym[0].strip(), tempsym[0].strip()] ! ! self._symbollookup[symbol[0].strip()] = tempsym continue *************** *** 415,419 **** """ if self._symbollookup.has_key(symbol): ! return self._symbollookup[symbol].split("::") return None --- 422,426 ---- """ if self._symbollookup.has_key(symbol): ! return self._symbollookup[symbol] return None Index: atlas_image.py =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/atlas_image.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** atlas_image.py 6 Aug 2003 01:05:45 -0000 1.6 --- atlas_image.py 17 Nov 2003 22:24:48 -0000 1.7 *************** *** 23,34 **** LGREY = (220, 220, 220) ! DRED = (88, 0, 0) LRED = (255, 50, 50) ! DBLUE = (0, 0, 88) ! LBLUE = (0, 0, 255) ! DGREEN = (0, 88, 0) ! DGREEN = (0, 255, 0) DBROWN = (95, 57, 19) LBROWN = (140, 98, 57) WHITE = (255, 255, 255) --- 23,35 ---- LGREY = (220, 220, 220) ! DRED = (150, 0, 0) LRED = (255, 50, 50) ! DBLUE = (0, 0, 150) ! LBLUE = (50, 50, 255) ! DGREEN = (0, 150, 0) ! LGREEN = (50, 255, 50) DBROWN = (95, 57, 19) LBROWN = (140, 98, 57) + YELLOW = (255, 255, 0) WHITE = (255, 255, 255) *************** *** 70,73 **** --- 71,84 ---- tilesets["outdoor"] = Image.new("RGB", (TS, TS), LGREY) tilesets["outdoors"] = tilesets["outdoor"] + + tilesets["dgreen"] = Image.new("RGB", (TS, TS), DGREEN) + tilesets["lgreen"] = Image.new("RGB", (TS, TS), LGREEN) + tilesets["dred"] = Image.new("RGB", (TS, TS), DRED) + tilesets["lred"] = Image.new("RGB", (TS, TS), LRED) + tilesets["dblue"] = Image.new("RGB", (TS, TS), DBLUE) + tilesets["lblue"] = Image.new("RGB", (TS, TS), LBLUE) + tilesets["yellow"] = Image.new("RGB", (TS, TS), YELLOW) + tilesets["black"] = Image.new("RGB", (TS, TS), BLACK) + return tilesets *************** *** 139,150 **** color = WHITE # mx is a multiplier so we can handle exits. if exits == "yes": im = Image.new("RGB", ! (((TS+1) * maxcol*2)+1, ((TS+1) * maxrow*2)+1), color) else: im = Image.new("RGB", ! (((TS+1) * maxcol+TS)+2, ((TS+1) * maxrow+TS)+2), color) --- 150,164 ---- color = WHITE + # we need to make a key at the bottom of the map + symoffset = (TS + 1) * (len(amap._symbollookup) + 1) + # mx is a multiplier so we can handle exits. if exits == "yes": im = Image.new("RGB", ! (((TS+1) * maxcol*2)+1, ((TS+1) * maxrow*2)+1 + symoffset), color) else: im = Image.new("RGB", ! (((TS+1) * maxcol+TS)+2, ((TS+1) * maxrow+TS)+2 + symoffset), color) *************** *** 170,174 **** # labeling y axis ! for row in range(1, maxrow*2+1): if exits == "yes": draw.text((1, (row*2*11)-11), repr(row-1), font=fnt, fill=BLACK) --- 184,188 ---- # labeling y axis ! for row in range(1, maxrow+1): if exits == "yes": draw.text((1, (row*2*11)-11), repr(row-1), font=fnt, fill=BLACK) *************** *** 177,181 **** # labeling x axis ! for col in range(1, maxcol*2+1): if exits == "yes": draw.text(((col*2*11)+1-11, 1), repr(col-1), font=fnt, fill=BLACK) --- 191,195 ---- # labeling x axis ! for col in range(1, maxcol+1): if exits == "yes": draw.text(((col*2*11)+1-11, 1), repr(col-1), font=fnt, fill=BLACK) *************** *** 252,265 **** _pastetile(im, tilesets["\\"], (row*2)+1+1, (col*2)+1+1) # handle labels (if there are any) ! if (amap.getProperty("showlabels", "yes") == "yes" and ! len(amap._labels) > 0): printstatus("Drawing labels.") - fontfile = amap.getProperty("font", - atlas.atlasdir + - "/base_pil/72/Arial Bold_12_72.pil".replace("/", os.sep)) - - fnt = ImageFont.load(fontfile) for mem in amap._labels: # get the size of the label in an image form --- 266,278 ---- _pastetile(im, tilesets["\\"], (row*2)+1+1, (col*2)+1+1) + fontfile = amap.getProperty("font", + atlas.atlasdir + + "/base_pil/72/Arial Bold_12_72.pil".replace("/", os.sep)) + + fnt = ImageFont.load(fontfile) # handle labels (if there are any) ! if (amap.getProperty("showlabels", "yes") == "yes" and len(amap._labels) > 0): printstatus("Drawing labels.") for mem in amap._labels: # get the size of the label in an image form *************** *** 298,301 **** --- 311,346 ---- fill=WHITE, outline=BLACK) + + # do key in the bottom right hand corner + syms = amap._symbollookup + if exits == "yes": + curr_y = ((TS+1) * maxrow*2)+TS + else: + curr_y = ((TS+1) * maxrow+TS)+TS + + symkeys = syms.keys() + + for i in range(0, len(symkeys)): + text = syms[symkeys[i]][1] + tile = syms[symkeys[i]][0] + + if tilesets.has_key(tile): + (x, y) = tilesets[tile].size + im.paste(tilesets[tile], (((x+1) + 1), + (curr_y + 1), + ((x+1) + x + 1), + (curr_y + y + 1))) + + (x, y) = fnt.getsize(text) + l = text.split() + offset = 0 + for piece in l: + draw.text((TS + TS + 5 + offset, curr_y), + piece, + font=fnt, + fill=BLACK) + offset = offset + draw.textsize(piece, font=fnt)[0] + 5 + + curr_y = curr_y + TS + 1 # handle resizing if we've been asked to |
From: will g. <wil...@us...> - 2003-08-06 01:05:49
|
Update of /cvsroot/bluemud/bluemudatlas In directory sc8-pr-cvs1:/tmp/cvs-serv6625 Modified Files: atlas.py atlas_image.py Log Message: Added some basic stats gathering and printing. Right now it tells you how many of each symbol are on a map (i.e. how many marshes you have, so on and so forth). Index: atlas.py =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/atlas.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** atlas.py 20 Jul 2003 02:39:32 -0000 1.16 --- atlas.py 6 Aug 2003 01:05:45 -0000 1.17 *************** *** 61,64 **** --- 61,66 ---- atlasdir = "." + room_type_count = {} + # ----------------------------------------------------- # quick utility functions *************** *** 72,75 **** --- 74,94 ---- + def printstats(): + """ + Prints statistics about the map. + """ + global room_type_count + + print "Map symbol statistics:" + for mem in room_type_count.keys(): + print " " + mem + ": " + repr(room_type_count[mem]) + + def clearstats(): + """ + Clears the statistics. + """ + global room_type_count + room_type_count = {} + def printstatus(mesg=""): """ *************** *** 140,144 **** def __repr__(self): ! return ("(" + repr(self._x) + "," + repr(self._y) + ") - " + self._label) --- 159,163 ---- def __repr__(self): ! return ("(" + repr(self._x) + ", " + repr(self._y) + ") - " + self._label) *************** *** 403,406 **** --- 422,426 ---- Creates a room, populates its data and places it in the matrix. """ + global room_type_count x = 0 y = 0 *************** *** 419,422 **** --- 439,446 ---- room = Room(x, y) + if not room_type_count.has_key(symbol): + room_type_count[symbol] = 0 + room_type_count[symbol] += 1 + info = self._symbolLookup(symbol) *************** *** 426,429 **** --- 450,454 ---- room._type = info[0] + if maptype == "thin": self._checkExit(col-1, row, "-", "w", room) *************** *** 631,634 **** --- 656,661 ---- printstatus("Done " + args[i] + ".") + printstats() + clearstats() except: printstatus("Map file " + args[i] + " failed with errors.") *************** *** 636,637 **** --- 663,665 ---- i = i + 1 + Index: atlas_image.py =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/atlas_image.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** atlas_image.py 20 Jul 2003 03:02:02 -0000 1.5 --- atlas_image.py 6 Aug 2003 01:05:45 -0000 1.6 *************** *** 67,72 **** tilesets["indoor"] = Image.new("RGB", (TS, TS), DGREY) - tilesets["outdoor"] = Image.new("RGB", (TS, TS), LGREY) tilesets["indoors"] = tilesets["indoor"] tilesets["outdoors"] = tilesets["outdoor"] return tilesets --- 67,72 ---- tilesets["indoor"] = Image.new("RGB", (TS, TS), DGREY) tilesets["indoors"] = tilesets["indoor"] + tilesets["outdoor"] = Image.new("RGB", (TS, TS), LGREY) tilesets["outdoors"] = tilesets["outdoor"] return tilesets |
From: will g. <wil...@us...> - 2003-07-20 03:02:09
|
Update of /cvsroot/bluemud/bluemudatlas In directory sc8-pr-cvs1:/tmp/cvs-serv15462 Modified Files: atlas_image.py Log Message: Fixed the problem with spaces in label names. Index: atlas_image.py =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/atlas_image.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** atlas_image.py 28 Feb 2003 01:17:26 -0000 1.4 --- atlas_image.py 20 Jul 2003 03:02:02 -0000 1.5 *************** *** 272,279 **** row = mem._y ! draw.text(((col*11) + TS + 3, (row*11) + TS), ! mem._label, ! font=fnt, ! fill=BLACK) --- 272,283 ---- row = mem._y ! l = mem._label.split() ! offset = 0 ! for piece in l: ! draw.text(((col*11) + TS + 3 + offset, (row*11) + TS), ! piece, ! font=fnt, ! fill=BLACK) ! offset = offset + draw.textsize(piece, font=fnt)[0] + 5 |
From: will g. <wil...@us...> - 2003-07-20 02:39:36
|
Update of /cvsroot/bluemud/bluemudatlas In directory sc8-pr-cvs1:/tmp/cvs-serv12581 Modified Files: atlas.py Log Message: Adjusted dot and label handling so they can take in floats. Index: atlas.py =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/atlas.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** atlas.py 9 Jul 2003 13:15:10 -0000 1.15 --- atlas.py 20 Jul 2003 02:39:32 -0000 1.16 *************** *** 184,188 **** line = dotline.strip().split(None, 2) try: ! dot = Dot(int(line[0]), int(line[1])) dot._label = line[2] self._dots.append(dot) --- 184,188 ---- line = dotline.strip().split(None, 2) try: ! dot = Dot(float(line[0]), float(line[1])) dot._label = line[2] self._dots.append(dot) *************** *** 199,203 **** line = labelline.strip().split(None, 2) try: ! label = Label(int(line[0]), int(line[1])) label._label = line[2] self._labels.append(label) --- 199,203 ---- line = labelline.strip().split(None, 2) try: ! label = Label(float(line[0]), float(line[1])) label._label = line[2] self._labels.append(label) |
From: will g. <wil...@us...> - 2003-07-09 13:15:12
|
Update of /cvsroot/bluemud/bluemudatlas In directory sc8-pr-cvs1:/tmp/cvs-serv23771 Modified Files: atlas.py Log Message: Added a defaulttile so that blank rooms (signified by a " ") can use the non-blank tile. Other minor tweaks that I've forgotten about. Index: atlas.py =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/atlas.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** atlas.py 22 Apr 2002 02:01:50 -0000 1.14 --- atlas.py 9 Jul 2003 13:15:10 -0000 1.15 *************** *** 54,58 **** "showaxislabels:": "'yes' or 'no' - controls showing of axis labels.", "showlabels:": " 'yes' or 'no' - controls showing of labels.", ! "showexits:": " 'yes' or 'no' - controls showing of exits." } --- 54,59 ---- "showaxislabels:": "'yes' or 'no' - controls showing of axis labels.", "showlabels:": " 'yes' or 'no' - controls showing of labels.", ! "showexits:": " 'yes' or 'no' - controls showing of exits.", ! "defaulttile:": " The default tile to use for blanks." } *************** *** 245,251 **** else: if self._map == None: ! self._map = [_fixline(mem, maptype)] ! else: ! self._map.append(_fixline(mem, maptype)) continue --- 246,251 ---- else: if self._map == None: ! self._map = [] ! self._map.append(_fixline(mem, maptype)) continue *************** *** 299,303 **** pass - # read through the map portion and create rooms matrix if self._map: --- 299,302 ---- *************** *** 338,347 **** Initializes a matrix of rooms for room placement. """ ! ! def newblankroom(row, col): room = Room() room._x = col room._y = row ! room._type = "blank" return room --- 337,345 ---- Initializes a matrix of rooms for room placement. """ ! def newblankroom(row, col, tiletype): room = Room() room._x = col room._y = row ! room._type = tiletype return room *************** *** 353,357 **** maxcol = len(self._map[row]) - maptype = self.getProperty("maptype", REGULAR) if maptype == REGULAR: --- 351,354 ---- *************** *** 372,376 **** # initializes a matrix with blank rooms so that when we go # to draw it, we don't make a mess. blank rooms are easily ! # identified because the room time is "_". for y in range(0, maxrow + 1): if self._rooms == None: --- 369,373 ---- # initializes a matrix with blank rooms so that when we go # to draw it, we don't make a mess. blank rooms are easily ! # identified because the room tile is "_". for y in range(0, maxrow + 1): if self._rooms == None: *************** *** 380,384 **** for x in range(0, maxcol + 1): ! self._rooms[y].append(newblankroom(y, x)) --- 377,381 ---- for x in range(0, maxcol + 1): ! self._rooms[y].append(newblankroom(y, x, self.getProperty("defaulttile", "blank"))) |
From: will g. <wil...@us...> - 2003-02-28 01:24:36
|
Update of /cvsroot/bluemud/bluemudatlas/base_pil/72 In directory sc8-pr-cvs1:/tmp/cvs-serv32345/base_pil/72 Added Files: Arial Bold_10_72.pbm Arial Bold_10_72.pil Arial Bold_12_72.pbm Arial Bold_12_72.pil Log Message: Adding the fonts we _do_ use. ***** Bogus filespec: Arial --- NEW FILE: Bold_10_72.pbm --- ***** Bogus filespec: Arial --- NEW FILE: Bold_10_72.pil --- ***** Bogus filespec: Arial --- NEW FILE: Bold_12_72.pbm --- ***** Bogus filespec: Arial --- NEW FILE: Bold_12_72.pil --- |
From: will g. <wil...@us...> - 2003-02-28 01:21:01
|
Update of /cvsroot/bluemud/bluemudatlas/base_pil/72 In directory sc8-pr-cvs1:/tmp/cvs-serv31274/72 Log Message: Directory /cvsroot/bluemud/bluemudatlas/base_pil/72 added to the repository |
From: will g. <wil...@us...> - 2003-02-28 01:20:41
|
Update of /cvsroot/bluemud/bluemudatlas In directory sc8-pr-cvs1:/tmp/cvs-serv31065 Removed Files: base_pil_72.tar.gz Log Message: Removing the monolithic fonts file--all except one of which we don't need/use. --- base_pil_72.tar.gz DELETED --- |
From: will g. <wil...@us...> - 2003-02-28 01:20:09
|
Update of /cvsroot/bluemud/bluemudatlas/base_pil In directory sc8-pr-cvs1:/tmp/cvs-serv31006/base_pil Log Message: Directory /cvsroot/bluemud/bluemudatlas/base_pil added to the repository |
From: will g. <wil...@us...> - 2003-02-28 01:17:32
|
Update of /cvsroot/bluemud/bluemudatlas In directory sc8-pr-cvs1:/tmp/cvs-serv29905 Modified Files: TODO atlas_image.py tiles.gif Log Message: Added a "roads" tile to the tileset. Fixed atlas_image.py to account for this new tile. Minor changes to the TODO. Index: TODO =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TODO 13 Feb 2002 20:56:13 -0000 1.1 --- TODO 28 Feb 2003 01:17:26 -0000 1.2 *************** *** 27,30 **** --- 27,31 ---- - handle linking between maps? - add ability to group maps + - multiple maps per file? code outputter: Index: atlas_image.py =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/atlas_image.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** atlas_image.py 19 Jan 2002 22:21:00 -0000 1.3 --- atlas_image.py 28 Feb 2003 01:17:26 -0000 1.4 *************** *** 51,67 **** tilesets["grass"] = pull(im, 1) tilesets["mountain"] = pull(im, 2) ! tilesets["water"] = pull(im, 3) ! tilesets["desert"] = pull(im, 4) ! tilesets["marsh"] = pull(im, 5) ! tilesets["forest"] = pull(im, 6) ! tilesets["beach"] = pull(im, 7) ! tilesets["city"] = pull(im, 8) ! tilesets["tundra"] = pull(im, 9) ! tilesets["|"] = pull(im, 10) ! tilesets["-"] = pull(im, 11) ! tilesets["\\"] = pull(im, 12) ! tilesets["/"] = pull(im, 13) ! tilesets["x"] = pull(im, 14) tilesets["indoor"] = Image.new("RGB", (TS, TS), DGREY) --- 51,68 ---- tilesets["grass"] = pull(im, 1) tilesets["mountain"] = pull(im, 2) ! tilesets["road"] = pull(im, 3) ! tilesets["water"] = pull(im, 4) ! tilesets["desert"] = pull(im, 5) ! tilesets["marsh"] = pull(im, 6) ! tilesets["forest"] = pull(im, 7) ! tilesets["beach"] = pull(im, 8) ! tilesets["city"] = pull(im, 9) ! tilesets["tundra"] = pull(im, 10) ! tilesets["|"] = pull(im, 11) ! tilesets["-"] = pull(im, 12) ! tilesets["\\"] = pull(im, 13) ! tilesets["/"] = pull(im, 14) ! tilesets["x"] = pull(im, 15) tilesets["indoor"] = Image.new("RGB", (TS, TS), DGREY) Index: tiles.gif =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/tiles.gif,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 Binary files /tmp/cvsJsuQEX and /tmp/cvsMM7N7K differ |
From: will g. <wil...@us...> - 2002-04-22 02:01:53
|
Update of /cvsroot/bluemud/bluemudatlas In directory usw-pr-cvs1:/tmp/cvs-serv20236 Modified Files: atlas.py Log Message: Index: atlas.py =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/atlas.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** atlas.py 8 Jan 2002 16:52:12 -0000 1.13 --- atlas.py 22 Apr 2002 02:01:50 -0000 1.14 *************** *** 23,26 **** --- 23,28 ---- notes and labels and other such things--to help enhance the mud world with encyclopedia-like material. + + It needs a lot of work still. """ |
From: will g. <wil...@us...> - 2002-03-08 20:57:50
|
Update of /cvsroot/bluemud/bluemud/world/domains/tavern In directory usw-pr-cvs1:/tmp/cvs-serv30243/world/domains/tavern Modified Files: items.py Log Message: The last commit. Index: items.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/world/domains/tavern/items.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** items.py 13 Jan 2002 21:47:24 -0000 1.21 --- items.py 8 Mar 2002 20:57:45 -0000 1.22 *************** *** 25,29 **** import mudlib.language import mudlib.mail.mailbox - import trade import tradeprops import random --- 25,28 ---- |
From: will g. <wil...@us...> - 2002-02-13 21:08:09
|
Update of /cvsroot/bluemud/bluemudatlas In directory usw-pr-cvs1:/tmp/cvs-serv30485 Modified Files: atlas_html.py template.html Added Files: TODO thintest.amap Log Message: Added TODO and thintest.amap. --- NEW FILE: TODO --- TODO: - done - get PIL working - done - generate image and html - done - get regular maps working - done - move properties from hard-coded-ness to map file - done - handle thin map format - done - allow for grid to be turned on and off - done - handle multiple maps in one pass (./atlas.py *.amap) - done - build exit tiles - done (sortof) - un-hardcode regular tiles and fix tile files - done - ability to resize maps - done - handle exits - done - add labels - done - add notes - done - build overrides for map properties via the command line - done - change draw_html to use templates - done - add axis numbers general: - move all properties and such to an xml build file - ability to handle subsections which get separate pages with notes, labels, and exits and zoomed in ascii map compiler: - handle wide map format - deal with altitude/stories - handle linking between maps? - add ability to group maps code outputter: - build - needs to be able to handle different room code things image outputter: - handle josh's exits idea (where exits are little lines between rooms and don't take an entire tile) --- NEW FILE: thintest.amap --- mapname: Map to test thin maptypes maptype: thin exits: yes g = grass BEGIN-MAP 0 1 2 3 4 5 6 7 8 9 0 0g | 1g | 2g g-g-g g-g-g-g | / \ | | 3g-g g g g g |/ \| | 4 g g g-g |\ /| | 5 g g g g g g | \ x | | 6 g g-g-g-g-g g-g | | 7 g g | | 8 g g | | 9 g g | | 10 g-g-g-g-g-g-g-g END-MAP # x y label label: 0 0 test1 label: 1 2 test2 label: 1 5 test3 BEGIN-NOTES: This map was created so that I could test a whole lot of functionality in atlas.py with a map. This note is downright silly. Index: atlas_html.py =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/atlas_html.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** atlas_html.py 6 Jan 2002 09:07:55 -0000 1.3 --- atlas_html.py 13 Feb 2002 20:56:13 -0000 1.4 *************** *** 20,23 **** --- 20,27 ---- import atlas, atlas_image + FOOTER = ("<p>converted on <i>" + time.ctime(time.time()) + "</i> using " + + "<a href=\"http://bluemud.sourceforge.net/bluemudatlas.shtml\">" + + "bluemud atlas</a></p>\n</body>") + def output(amap): """ *************** *** 75,82 **** mem = mem.replace("%NOTES%", "") ! mem = mem.replace("</body>", ! "<p>converted on <i>" + ! time.ctime(time.time()) + ! "</i> using atlas.py</p>\n</body>") f.write(mem) --- 79,83 ---- mem = mem.replace("%NOTES%", "") ! mem = mem.replace("</body>", FOOTER) f.write(mem) Index: template.html =================================================================== RCS file: /cvsroot/bluemud/bluemudatlas/template.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** template.html 6 Jan 2002 09:07:55 -0000 1.3 --- template.html 13 Feb 2002 20:56:13 -0000 1.4 *************** *** 62,70 **** <table width=100%> <tr> ! <td> <h2>Labels:</h2> <pre>%LABELS%</pre> </td> ! <td> <h2>Dots:</h2> <pre>%DOTS%</pre> --- 62,70 ---- <table width=100%> <tr> ! <td width="50%"> <h2>Labels:</h2> <pre>%LABELS%</pre> </td> ! <td width="50%"> <h2>Dots:</h2> <pre>%DOTS%</pre> |
From: will g. <wil...@us...> - 2002-01-24 03:00:40
|
Update of /cvsroot/bluemud/bluemud/code/mudlib In directory usw-pr-cvs1:/tmp/cvs-serv13605 Modified Files: mudtime.py parser.py Log Message: Last group in the massive documentation effort. The other modules either aren't clear (so i can't document them) or they're not important for coders to use, so we're going to skip them this time around. Index: mudtime.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/mudtime.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** mudtime.py 2001/10/20 04:03:18 1.7 --- mudtime.py 2002/01/24 03:00:37 1.8 *************** *** 14,23 **** ##################################################################### """ To write your own mudtime: ! 1. extend TimeManager 2. In createTimeManager() set up your mud increments and names 3. Override formatTime to first call getMudTime and then use the returned dictionary to format your time appropriately. """ from org.bluesock.bluemud.driver import Driver --- 14,34 ---- ##################################################################### + + """ + This module handles in-game world time. This is different than + out-of-game world time which we measure in hours and minutes and + such. In-game time could be measured in whatever interval you + so choose (by creating your own TimeManager subclass). + To write your own mudtime: ! ! 1. extend 'mudlib.mudtime.TimeManager' ! 2. In createTimeManager() set up your mud increments and names + 3. Override formatTime to first call getMudTime and then use the returned dictionary to format your time appropriately. + """ from org.bluesock.bluemud.driver import Driver *************** *** 29,36 **** --- 40,60 ---- def getTimeManager(): + """Returns the time manager. + + It's a shared object, so if it doesn't exist, this will create it + and then return it. If it does exist, this will return the one + that existed--thus there should only be one TimeManager floating + around. + + returns: + + (mudlib.mudtime.TimeManager) + + """ timeManager = Driver.getAliasedObject("time_manager", 1) return timeManager class TimeManager(MudObject): + """Handles in-game world time and how it's represented.""" def __init__(self): *************** *** 41,77 **** def createTimeManager(self): pass - """ - This sets the date the mud will starting counting from in - order to calculate the mudtime. - """ def setStartInRealTime(self, seconds): self._startTime = seconds - """ - Add increments in progressively bigger order. If you want - 1 second = 1 second mudtime then addMetaIncrement( 1, "second" ) - 60 seconds = 1 minute mudtime then addMetaIncrement( 60, "minute" ) - 3600 secs = 1 hour mudtime then addMetaIncrement( 60*60, "hour" ) - or to make the mud faster then real time: - 15 seconds = 1 mud minute then addMetaIncrement( 15, "minute" ) - """ def addMetaIncrement(self, incrementValue, incrementName): self._metaIncrements.append((incrementValue,incrementName)) - """ - For each MetaIncrement you can define a set of descriptions. - So a 7 days = {Sunday, Monday, Tuesday, Wednesday, etc.} do this: - setIncrementDescriptions( "day", {"Sunday", "Monday", "Tuesday", etc.} ) - """ def setIncrementDescriptions(self, incrementName, incrementDescs): self._incrementDescriptions[incrementName] = incrementDescs - """ - This allows you to fetch the appropriate description for an increment. - If I want the 2(nd) "day" then getIncrememntName( "day", 2 ) - """ def getIncrementDescription(self, incrementName, incrementNumber): if self._incrementDescriptions.has_key(incrementName): return self._incrementDescriptions[incrementName][incrementNumber - 1] --- 65,138 ---- def createTimeManager(self): + """Override this for subclasses of the TimeManager class.""" pass def setStartInRealTime(self, seconds): + """This sets the date the mud will starting counting from in + order to calculate the mudtime. + + arguments: + + 'seconds' -- (int) ??? + + """ self._startTime = seconds def addMetaIncrement(self, incrementValue, incrementName): + """Add increments in progressively bigger order. + + If you want one second = one second mudtime then 'addMetaIncrement( 1, "second" )' + + sixty seconds = one minute mudtime then 'addMetaIncrement( 60, "minute" )' + + thirty six hundred secs = one hour mudtime then 'addMetaIncrement( 60*60, "hour" )' + + or to make the mud faster then real time, fifteen seconds = one mud + minute then 'addMetaIncrement( 15, "minute" )' + + arguments: + + 'incrementValue' -- (int) how many increments for this + metaincrement + + 'incrementName' -- (string) name of the metaincrement + + """ self._metaIncrements.append((incrementValue,incrementName)) def setIncrementDescriptions(self, incrementName, incrementDescs): + """ + For each MetaIncrement you can define a set of descriptions. + So for 7 days = {Sunday, Monday, Tuesday, Wednesday, etc.} do + 'setIncrementDescriptions( "day", ["Sunday", "Monday", "Tuesday", etc.] )' + + arguments: + + 'incrementName' -- (string) the name of the increment + + 'incrementDescs' -- (list of strings) the names of the various + increment values + + """ self._incrementDescriptions[incrementName] = incrementDescs def getIncrementDescription(self, incrementName, incrementNumber): + """ + This allows you to fetch the appropriate description for an increment. + If I want the 2(nd) "day" (using the examples in + 'setIncrementDescriptions' and 'addMetaIncrement' I would do + 'getIncrememntName( "day", 2 )'. + + arguments: + + 'incrementName' -- (string) the name of the meta increment + + 'incrementNumber' -- (int) which increment value to retrieve + + returns: + + (string) the name of the increment value + + """ if self._incrementDescriptions.has_key(incrementName): return self._incrementDescriptions[incrementName][incrementNumber - 1] *************** *** 79,101 **** return None - """ - This should be overriden to format Time however the mud wishes - """ def formatTime(self, timeIncrements): return "" - """ - This will return the formated time of the mud in string form - """ def displayTime(self): return self.formatTime(self.getMudTime()) - """ - This will calculate the current mudtime and return a dictionary where - the key is the increment name and the value is the amount. - so { ("day", 2), ("month", 5), ("Year", 2001) } Would be equaivalent to: - The second day of the fifth month of the year 2001 - """ def getMudTime(self): secondsSinceStart = time.time() - self._startTime secondsLeft = secondsSinceStart --- 140,181 ---- return None def formatTime(self, timeIncrements): + """ + This should be overriden to format time however the mud wishes. + + arguments: + + 'timeIncrements' -- (int) increments since the "epoch" + + returns: + + (string) human readable form of a given time + + """ return "" def displayTime(self): + """ This will return the formated time of the mud in string form. + + returns: + + (string) human readable form of the current time + + """ return self.formatTime(self.getMudTime()) def getMudTime(self): + """ + This will calculate the current mudtime and return a dictionary where + the key is the increment name and the value is the amount. + + '[ ("day", 2), ("month", 5), ("Year", 2001) ]' would be + equaivalent to 'The second day of the fifth month of the year 2001'. + + returns: + + list of (string, int) tuples + + """ secondsSinceStart = time.time() - self._startTime secondsLeft = secondsSinceStart *************** *** 111,113 **** return incrementResults - --- 191,192 ---- Index: parser.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/parser.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** parser.py 2001/10/20 04:03:18 1.4 --- parser.py 2002/01/24 03:00:37 1.5 *************** *** 41,45 **** you can use the parseAndBind function. ! Tokens in the parse pattern are interpreted as follows: text required word (text1|text2|...|textN) Require either text1 or text2 or ... or textN --- 41,46 ---- you can use the parseAndBind function. ! Tokens in the parse pattern are interpreted as follows:: ! text required word (text1|text2|...|textN) Require either text1 or text2 or ... or textN *************** *** 48,53 **** %s match string %a match optional adverb - Examples: Pattern: "look" Valid input examples: "look" --- 49,55 ---- %s match string %a match optional adverb + + Examples of parsing :: Pattern: "look" Valid input examples: "look" *************** *** 55,76 **** Pattern: "look (at|toward|towards) [the] %o" Valid input examples: "look at ball", "look toward ball", ! "look towards ball", "look at the ball", ! "look at the balls", "look at both balls", ! "look at the third ball" Invalid input examples: "look", "look at at balls", ! "look at all 'em balls!" Pattern: "get [the] %o from [the] %o" Valid input examples: "get ball from basket", "get the ball from the basket", ! "get fifteen balls from the second basket", ! "get everything from both baskets" Invalid input examples: "get ball", "get ball basket", "ball from basket", ! "get ball inside basket" Pattern: "smile %a [at] [the] %o" Valid input examples: "smile happily at john", "smile at john", ! "smile john", "smile sorrowfully at john" Invalid input examples: "smile", "smile at john happily" """ --- 57,85 ---- Pattern: "look (at|toward|towards) [the] %o" + Valid input examples: "look at ball", "look toward ball", ! ' "look towards ball", "look at the ball", ! ' "look at the balls", "look at both balls", ! ' "look at the third ball" ! Invalid input examples: "look", "look at at balls", ! ' "look at all 'em balls!" Pattern: "get [the] %o from [the] %o" + Valid input examples: "get ball from basket", "get the ball from the basket", ! ' "get fifteen balls from the second basket", ! ' "get everything from both baskets" ! Invalid input examples: "get ball", "get ball basket", "ball from basket", ! ' "get ball inside basket" Pattern: "smile %a [at] [the] %o" + Valid input examples: "smile happily at john", "smile at john", ! ' "smile john", "smile sorrowfully at john" ! Invalid input examples: "smile", "smile at john happily" + """ |
From: will g. <wil...@us...> - 2002-01-23 21:02:08
|
Update of /cvsroot/bluemud/bluemud/code/mudlib In directory usw-pr-cvs1:/tmp/cvs-serv32561 Modified Files: trade.py Log Message: Added the properties from the tradeprops file. Index: trade.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/trade.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** trade.py 2002/01/20 02:32:53 1.7 --- trade.py 2002/01/23 21:02:04 1.8 *************** *** 23,31 **** import shadow import stdlib - import tradeprops import currency import language import living class Trader(shadow.Shadow): def shadowLoaded(self, shadowedObject): --- 23,38 ---- import shadow import stdlib import currency import language import living + # Affirmative properties + IS_MONEY = "__PROPERTY_IS_MONEY" + IS_VALUABLE = "__PROPERTY_IS_VALUABLE" + IS_TRADER = "__PROPERTY_IS_SALESMAN" + IS_TRAVELING_SALESMAN = "__PROPERTY_IS_TRAVEL_TRADER" + + VALUE = "__PROPERTY_VALUE" + class Trader(shadow.Shadow): def shadowLoaded(self, shadowedObject): *************** *** 45,50 **** return 0 ! shadowedObject.addProperty(tradeprops.IS_TRADER, 1) ! shadowedObject.addProperty(tradeprops.IS_TRAVELING_SALESMAN, 1) shadowedObject.getActionManager().addAction("markup", self.markup) shadowedObject.getActionManager().addAction("ban", self.banCustomer) --- 52,57 ---- return 0 ! shadowedObject.addProperty(IS_TRADER, 1) ! shadowedObject.addProperty(IS_TRAVELING_SALESMAN, 1) shadowedObject.getActionManager().addAction("markup", self.markup) shadowedObject.getActionManager().addAction("ban", self.banCustomer) *************** *** 52,85 **** - """ - If a trader has a shop then use this method to set the location of - there store. Note: You can only have one trader per store. - """ def setShopLocation(self, storeRoom): self._shadowedObject._storeRoom = storeRoom - """ - This is the container in which the traders wares should come from and - be put into. In the case of a trader with a shop it might be an inventory - room or lockbox. - """ def setInventoryContainer(self, inventoryContainer): self._inventoryContainer = inventoryContainer - """ - This is the standard percent markup that will be applied to items - in the trader's inventory, if the item does not have a item specific markup. - """ def setMarkup(self, markup): self._markup = markup - """ - This is the standard percent discount that will be applied to items - in that will be bought, if the item does not have a item specific discount. - """ def setDiscount(self, discount): self._discount = discount def objectEnteredEnvironment(self, object): if object.getProperty(stdprops.IS_INTERACTIVE): object.getActionManager().addAction("inquire", self.inquire) --- 59,95 ---- def setShopLocation(self, storeRoom): + """ + If a trader has a shop then use this method to set the location of + there store. Note: You can only have one trader per store. + """ self._shadowedObject._storeRoom = storeRoom def setInventoryContainer(self, inventoryContainer): + """ + This is the container in which the traders wares should come from and + be put into. In the case of a trader with a shop it might be an inventory + room or lockbox. + """ self._inventoryContainer = inventoryContainer def setMarkup(self, markup): + """ + This is the standard percent markup that will be applied to items + in the trader's inventory, if the item does not have a item specific markup. + """ self._markup = markup def setDiscount(self, discount): + """ + This is the standard percent discount that will be applied to items + in that will be bought, if the item does not have a item specific discount. + """ self._discount = discount def objectEnteredEnvironment(self, object): + """ + see 'mudlib.core.Object' + """ if object.getProperty(stdprops.IS_INTERACTIVE): object.getActionManager().addAction("inquire", self.inquire) *************** *** 89,92 **** --- 99,105 ---- def objectLeftEnvironment(self, object): + """ + see 'mudlib.core.Object' + """ if object.getProperty(stdprops.IS_INTERACTIVE): object.getActionManager().removeAction("inquire", self.inquire) *************** *** 96,103 **** def enterEnvironment(self, environment): if environment.getName() == self._storeRoom: ! self.addProperty(tradeprops.IS_TRAVELING_SALESMAN, 0) else: ! self.addProperty(tradeprops.IS_TRAVELING_SALESMAN, 1) for item in environment.getInventory(): --- 109,119 ---- def enterEnvironment(self, environment): + """ + see 'mudlib.core.Object' + """ if environment.getName() == self._storeRoom: ! self.addProperty(IS_TRAVELING_SALESMAN, 0) else: ! self.addProperty(IS_TRAVELING_SALESMAN, 1) for item in environment.getInventory(): *************** *** 109,112 **** --- 125,131 ---- def leaveEnvironment(self, environment): + """ + see 'mudlib.core.Object' + """ for item in environment.getInventory(): if item.getProperty(stdprops.IS_INTERACTIVE): *************** *** 122,140 **** def getItemBuyValue(self, item): if self._itemMarkups.has_key(item.getName()): ! return int(item.getProperty(tradeprops.VALUE) * 0.01 * self._itemMarkups[item.getName()] + ! item.getProperty(tradeprops.VALUE)) else: ! return int(item.getProperty(tradeprops.VALUE) * 0.01 * self._markup + ! item.getProperty(tradeprops.VALUE)) def getItemSellValue(self, item): if self._itemDiscounts.has_key(item.getName()): ! return int(item.getProperty(tradeprops.VALUE) - 0.01 * self._itemDiscounts[item.getName()] * ! item.getProperty(tradeprops.VALUE)) else: ! return int(item.getProperty(tradeprops.VALUE) - ! item.getProperty(tradeprops.VALUE) * 0.01 * self._discount) --- 141,159 ---- def getItemBuyValue(self, item): if self._itemMarkups.has_key(item.getName()): ! return int(item.getProperty(VALUE) * 0.01 * self._itemMarkups[item.getName()] + ! item.getProperty(VALUE)) else: ! return int(item.getProperty(VALUE) * 0.01 * self._markup + ! item.getProperty(VALUE)) def getItemSellValue(self, item): if self._itemDiscounts.has_key(item.getName()): ! return int(item.getProperty(VALUE) - 0.01 * self._itemDiscounts[item.getName()] * ! item.getProperty(VALUE)) else: ! return int(item.getProperty(VALUE) - ! item.getProperty(VALUE) * 0.01 * self._discount) *************** *** 154,158 **** " is selling: ") for item in items: ! if item.getProperty(tradeprops.IS_VALUABLE): thisPlayer.write(item.getShortDescription() + " for " + `self.getItemBuyValue(item)` + " coins") --- 173,177 ---- " is selling: ") for item in items: ! if item.getProperty(IS_VALUABLE): thisPlayer.write(item.getShortDescription() + " for " + `self.getItemBuyValue(item)` + " coins") *************** *** 167,181 **** " will buy: ") for item in items: ! if item.getProperty(tradeprops.IS_VALUABLE): thisPlayer.write(item.getShortDescription() + " for " + `self.getItemSellValue(item)` + " coins") self.write(item.getShortDescription() + " for " + `self.getItemSellValue(item)` + " coins") ! elif not item.getProperty(tradeprops.IS_MONEY): thisPlayer.write(item.getShortDescription() + " has no value") def buyItems(self, thisPlayer, items): for item in items: ! if item.getProperty(tradeprops.IS_VALUABLE): cost = self.getItemBuyValue(item) else: --- 186,200 ---- " will buy: ") for item in items: ! if item.getProperty(IS_VALUABLE): thisPlayer.write(item.getShortDescription() + " for " + `self.getItemSellValue(item)` + " coins") self.write(item.getShortDescription() + " for " + `self.getItemSellValue(item)` + " coins") ! elif not item.getProperty(IS_MONEY): thisPlayer.write(item.getShortDescription() + " has no value") def buyItems(self, thisPlayer, items): for item in items: ! if item.getProperty(IS_VALUABLE): cost = self.getItemBuyValue(item) else: *************** *** 213,217 **** def sellItems(self, thisPlayer, items): for item in items: ! if item.getProperty(tradeprops.IS_VALUABLE): cost = self.getItemSellValue(item) else: --- 232,236 ---- def sellItems(self, thisPlayer, items): for item in items: ! if item.getProperty(IS_VALUABLE): cost = self.getItemSellValue(item) else: *************** *** 290,294 **** if parser.successful(traders): for match in traders[0][1:]: ! if match.getProperty(tradeprops.IS_TRADER): items = parser.bindWithin([matches[1]], self._inventoryContainer) --- 309,313 ---- if parser.successful(traders): for match in traders[0][1:]: ! if match.getProperty(IS_TRADER): items = parser.bindWithin([matches[1]], self._inventoryContainer) *************** *** 306,310 **** if parser.successful(matches): for match in matches[0][1:]: ! if match.getProperty(tradeprops.IS_TRADER): self.displayInventoryInquiry(thisPlayer) return 1 --- 325,329 ---- if parser.successful(matches): for match in matches[0][1:]: ! if match.getProperty(IS_TRADER): self.displayInventoryInquiry(thisPlayer) return 1 *************** *** 337,341 **** if parser.successful(traders): for match in traders[0][1:]: ! if match.getProperty(tradeprops.IS_TRADER): items = parser.bindWithin([matches[0]], self._inventoryContainer) --- 356,360 ---- if parser.successful(traders): for match in traders[0][1:]: ! if match.getProperty(IS_TRADER): items = parser.bindWithin([matches[0]], self._inventoryContainer) *************** *** 364,368 **** if parser.successful(traders): for match in traders[0][1:]: ! if match.getProperty(tradeprops.IS_TRADER): items = parser.bindWithin([matches[0]], thisPlayer) --- 383,387 ---- if parser.successful(traders): for match in traders[0][1:]: ! if match.getProperty(IS_TRADER): items = parser.bindWithin([matches[0]], thisPlayer) *************** *** 394,398 **** if parser.successful(traders): for match in traders[0][1:]: ! if match.getProperty(tradeprops.IS_TRADER): items = parser.bindWithin([matches[0]], thisPlayer) --- 413,417 ---- if parser.successful(traders): for match in traders[0][1:]: ! if match.getProperty(IS_TRADER): items = parser.bindWithin([matches[0]], thisPlayer) *************** *** 405,409 **** if parser.successful(matches): for match in matches[0][1:]: ! if match.getProperty(tradeprops.IS_TRADER): self.displayInventoryAppraisal(thisPlayer) return 1 --- 424,428 ---- if parser.successful(matches): for match in matches[0][1:]: ! if match.getProperty(IS_TRADER): self.displayInventoryAppraisal(thisPlayer) return 1 |
From: will g. <wil...@us...> - 2002-01-23 21:01:34
|
Update of /cvsroot/bluemud/bluemud/code/mudlib In directory usw-pr-cvs1:/tmp/cvs-serv32387 Modified Files: login.py mind.py shadow.py utils.py Removed Files: tradeprops.py Log Message: Massive documentation on login, mind, shadow, and utils. Removal of the tradeprops module--contents were moved to the trade module. Index: login.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/login.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** login.py 2002/01/09 17:57:45 1.25 --- login.py 2002/01/23 21:01:31 1.26 *************** *** 47,50 **** --- 47,54 ---- the default text here) to the user. + arguments: + + 'connectedUser' -- (User instance) the connected user + """ self.player = connectedUser *************** *** 75,78 **** --- 79,87 ---- until they've satisfied login requirements and have a character and thereby get a real controller object. + + arguments: + + 'input' -- (string) the incoming input from the player + """ if self.id == None: *************** *** 128,134 **** --- 137,154 ---- def noteDisconnect(self): + """ ??? """ pass def noteError(self, message): + """ If something fails, this gets kicked up instead of a stack + trace. + + Players shouldn't see this--it's bad. + + arguments: + + 'message' -- (string) the error message (which we ignore here) + + """ self.player.write("There's been a problem logging you in!") Index: mind.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/mind.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** mind.py 2002/01/08 06:37:35 1.22 --- mind.py 2002/01/23 21:01:31 1.23 *************** *** 22,26 **** --- 22,43 ---- class Mind: + """ + The Mind is a key part to Interactives since the Mind is the + class that handles the interaction between the mud and a controller. + Herein is the functionality for handling controller-created input events + and controller-created NAWS events and sending those events to the + proper processors. + """ def setInteractive(self, controlledInteractive): + """ Sets the interactive for this mind. + + see 'mudlib.living.Interactive' + + arguments: + + 'controlledInteractive' -- (mudlib.living.Interactive) the interactive + this mind is controlling + + """ self._controlledInteractive = controlledInteractive self._processingMethods = [] *************** *** 28,31 **** --- 45,55 ---- def processInput(self, input): + """ Handles sending the input to the current input processor. + + arguments: + + 'input' -- (string) input from the controller + + """ if input == None: return *************** *** 59,62 **** --- 83,91 ---- in the self._processessingMethods list, then this is the processor that handles the input. + + arguments: + + 'input' -- (string) input from the controller + """ # first thing we do is make sure we're in lxl mode here *************** *** 88,106 **** --- 117,159 ---- def write(self, message): + """ Writes a message to the controller. + + Override this. + """ pass def rawwrite(self, message): + """ Raw writes a message to the controller. + + Override this. + """ pass def prompt(self): + """ This is the default prompt method.""" self.rawwrite("> ") def heartbeat(self): + """ This provides a heartbeat. + + Override this. + """ pass def pushInputProcessor(self, processingMethod, promptMethod): + """ Pushes a new method for handling input and a method for handling + prompts onto the input processor stack. + + arguments: + + 'processingMethod' -- (function) the method to handle input processing + + 'promptMethod' -- (function) the method to handle prompts + + """ self._processingMethods.insert(0, (processingMethod, promptMethod,)) def popInputProcessor(self): + """ Pops an input processor and a prompt handler off the stack.""" self._processingMethods.pop(0) *************** *** 108,119 **** # NAWS HANDLING def pushNawsProcessor(self, processingMethod): ! """pushes a Naws processor on the stack in order to handle Naws (window resize) events. """ self._processingNawsMethods.insert(0, processingMethod) def popNawsProcessor(self): ! """pops a Naws processor off the stack in order to no longer receive Naws (window resize) events. """ self._processingNawsMethods.pop(0) --- 161,182 ---- # NAWS HANDLING def pushNawsProcessor(self, processingMethod): ! """ Pushes a Naws processor on the stack in order to handle Naws (window resize) events. + + Not for the feint of heart. + + arguments: + + 'processingMethod' -- (function) the function that + should now handle NAWS events + """ self._processingNawsMethods.insert(0, processingMethod) def popNawsProcessor(self): ! """ Pops a Naws processor off the stack in order to no longer receive Naws (window resize) events. + + Used in conjunction with 'pushNawsProcessor'. """ self._processingNawsMethods.pop(0) *************** *** 121,128 **** --- 184,208 ---- class PlayerController(Controller, Mind): + """ + The PlayerController is another link between the socket and the + actual Player objects. + + Socket -> User -> PlayerController/CoderController -> Player + + """ def setUser(self, connectedUser): + """ Sets the connected user for this controller. + + arguments: + + 'connectedUser' -- (User) + + """ self._connectedUser = connectedUser def logout(self): + """ Called when the user types quit--this calls the logout + method of the User object. + """ self._connectedUser.logout() *************** *** 139,149 **** --- 219,258 ---- def noteError(self, errorMessage): + """ Notifies the player they just bumped into a bug. + + When something kicks up an exception, it notifies the player + so that they know something bad just happened. + + arguments: + + 'errorMessage' -- (string) the error--we ignore this in + PlayerController + + """ self.write("An annoying bug goes buzzing by your head!") self.prompt() def getControlledObject(self): + """ Returns the controlled interactive. + + returns: + + (mudlib.living.Interactive) + + """ return self._controlledInteractive def replaceController(self, newController): + """ Switches this controller out for a new one. + + Sometimes, like in the case of when a Player becomes a Coder, + we want to switch the controller that user has. This is + the method for such an action. + + arguments: + + 'newController' -- (controller) + + """ self._controlledInteractive.setMind(newController) self._connectedUser.setController(newController) *************** *** 154,157 **** --- 263,272 ---- and sends it on its way to _connectedUser.write to write to the socket. + + arguments: + + 'message' -- (string) the message to format and write to the + user socket + """ cols = self._connectedUser.getProperty("COLS", 72) *************** *** 166,178 **** --- 281,334 ---- def rawwrite(self, message): + """ Writes a message raw--no formatting done to the user. + + arguments: + + 'message' -- (string) the message to write directly to the user + + """ self._connectedUser.rawwrite(message) def getUserProperty(self, name, default=None): + """ Retrieves a property on the User object + + The User instance stores information about the user's socket + connection and connection state. This allows you to retrieve + that information. + + arguments: + + 'name' -- (string) the name of the property you want to retrieve + + 'default=None' -- (object) the default if that property is not there + + """ return self._connectedUser.getProperty(name, default) def getIdleTime(self): + """ Returns the idle time of the user. + + The idle time is measured as the amount of time since the user + last typed something. + + returns: + + (int) the number of seconds since the user last typed something + + """ return self._connectedUser.getIdleTime() def getIPAddress(self): + """ Returns the ip address of the user. + + Each user connects from somewhere else on the network (or Internet) + and this returns the IP address which they connected from as a + string. + + returns: + + (string) + + """ return self._connectedUser.getIPAddress() Index: shadow.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/shadow.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** shadow.py 2001/10/20 04:03:18 1.5 --- shadow.py 2002/01/23 21:01:31 1.6 *************** *** 49,52 **** --- 49,62 ---- def setUniqueShadowName(self, name): + """ Sets the unique name for this shadow. + + By default this is the python path for this shadow class. + Typically you shouldn't have to change it. + + arguments: + + 'name' -- (string) + + """ self._uniqueShadowName = name *************** *** 63,71 **** shadow, which should be suitable for most purposes. """ return self._uniqueShadowName def shadowObject(self, targetObject): ! """Install this shadow onto the given target object. """ # Save the class of the original object. If the object we're # shadowing is itself a shadow, we don't need to do anything. --- 73,91 ---- shadow, which should be suitable for most purposes. + returns: + + (string) + """ return self._uniqueShadowName def shadowObject(self, targetObject): ! """ Install this shadow onto the given target object. ! ! arguments: ! ! 'targetObject' -- (MudObject) the object to "shadow" ! ! """ # Save the class of the original object. If the object we're # shadowing is itself a shadow, we don't need to do anything. Index: utils.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/utils.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** utils.py 2001/12/17 02:22:54 1.16 --- utils.py 2002/01/23 21:01:31 1.17 *************** *** 35,38 **** --- 35,53 ---- have too many .. or they have // next to each other or misplaced ~. + + arguments: + + 'home_dir' -- (string) the home directory for the coder + + 'cur_dir' -- (string) the current directory the coder is in + + 'path' -- (string) the path to parse relative to either + the current dir (cur_dir) or the home dir + (home_dir) + + returns: + + (string) the explicit dir based on the mud root directory + """ if path[0] == "/": *************** *** 78,81 **** --- 93,105 ---- ex: /world/data/blah -> blah + + arguments: + + 'path' -- (string) the path that includes a filename + + returns: + + (string) + """ lastSlashIndex = string.rfind(path, "/") *************** *** 93,96 **** --- 117,129 ---- This is horribly written and I don't even know if it should go here either.... but it works! + + arguments: + + 'secs' -- (int) the interval in seconds + + returns: + + (string) a human-readable form of that interval + """ if type(secs) == type(''): *************** *** 125,129 **** def date_string(): ! """Returns a the localtime string in the form of MM-DD-YYYY """ timestamp = time.localtime() return `timestamp[1]` + "-" + `timestamp[2]` + "-" + `timestamp[0]` --- 158,168 ---- def date_string(): ! """ Returns a the localtime string in the form of MM-DD-YYYY. ! ! returns: ! ! (string) the localtime string in MM-DD-YYYY format ! ! """ timestamp = time.localtime() return `timestamp[1]` + "-" + `timestamp[2]` + "-" + `timestamp[0]` *************** *** 134,137 **** --- 173,189 ---- Takes a command line thingy and separates flags from non-flags. This could probably be done better.... :) + + FIXME - get rid of this function and use the getopts methods + instead. + + arguments: + + 'list' -- (list of strings) -- the arguments + + returns: + + two lists--the first is a lsit of flags and the second is + a list of non-flags + """ if list == None: *************** *** 161,164 **** --- 213,225 ---- appended to the message being generated. After all tokens are evaluated, the message is returned. + + arguments: + + 'tokens' -- (list of VBFCs and strings) + + returns: + + (string) + """ str = "" *************** *** 182,185 **** --- 243,258 ---- piece is everything up to the first ; and that is not \; The second piece is everything else. + + arguments: + + 'text' -- (string) the text to parse the first semicolon from + + returns: + + if a semicolon is found that's unescaped, it returns the text up + to the first semicolon and then the rest in a list. + + otherwise it returns the text. + """ matchob = SEMI_REGEXP.search(text) *************** *** 194,197 **** --- 267,273 ---- """ A finite state machine with no cycles. + + FIXME - document this. currently it's only used in nomacs.py. + """ --- tradeprops.py DELETED --- |
From: will g. <wil...@us...> - 2002-01-22 23:09:00
|
Update of /cvsroot/bluemud/bluemuddocs/tasks In directory usw-pr-cvs1:/tmp/cvs-serv20818/tasks Added Files: history.aft Log Message: Added a tasks directory for task analysis and definition documents which might help for specifying and making the larger changes to the system. Added the first task definition document on communication history. Some changes to the formatting document. --- NEW FILE: history.aft --- *Title: 15grains - communication history *Author: dj willy g ---- *TOC ---- * Overview When you're mudding sometimes you miss things people have said to you because whatever you're doing causes the text to go flying by. We need a mechanism where players can view the last 20 communication things that have been directed to them. * Implementation details We currently have a series of communication methods: * _synchronous subjective:_ say, tell, emote... * _synchronous global:_ shout, guild chatlines, coder chatlines... * _asynchronous:_ mudmail, bulletin boards... ** Asynchronous methods of communication Things like bulletin boards and mudmailboxes have storage mechanisms so players can see history on them by just looking at what's currently in storage. In the case of a mudmail box, they would be able to see what they haven't deleted yet. These methods don't need any changes. ** Synchronous global methods of communication Global methods of communication would include chatlines that many players are subscribed to. Examples include the shout line (all players), guild lines (players who belong to that guild), and mud chat lines (all players who share a common interest like StarCraft or something). All players that are able to communicate on that line should see the same history when they go to look for it. We can have one global history manager to keep track of these lines for all users. ** Synchronous subjective methods of communication Subjective methods of communication include say, tell, emote, and possibly ask. Each player has their own history manager which manages all the subjective methods of communication. ** Specification of the history manager The history manager should hold the last 20 events for each chatline it manages. It needs two methods: * 'getHistory' - takes in a string for the chatline name and returns a list of events which get passed to 'write' and correctly display the last 20 things that were said on that line from the perspective of the player requesting the history * 'addHistoryEvent' - which takes in a string for the chatline name and an event which is a list of VBFCs and strings (just like what 'write' takes as arguments). it returns nothing. We have one history manager object for the mud which holds history for synchronous global chatlines that people are subscribed to. Each player has their own history manager object which handles methods like say, tell, emote, and possibly ask. ** Retrieving the history We add a '-h' flag to say, tell, shout, (ask?) and other chatlines. This flag causes the chatline command to print the history of the line rather than print something to the line. Example: 'say -h' would write to the player requesting the last 20 say events the player was around for. * Possible issues * When a player goes linkdead, they should retain their history manager and be able to see the things said to them prior to them going linkdead. * Work involved * 1 hour - building the history manager class * 5 hours - implementing a history manager on the player and one globally for handling global chatlines * 5 hours - adding history manager usage to the appropriate commands * 1 hours - testing and debugging |
From: will g. <wil...@us...> - 2002-01-22 23:09:00
|
Update of /cvsroot/bluemud/bluemuddocs/arch In directory usw-pr-cvs1:/tmp/cvs-serv20818/arch Modified Files: formatting.aft Log Message: Added a tasks directory for task analysis and definition documents which might help for specifying and making the larger changes to the system. Added the first task definition document on communication history. Some changes to the formatting document. Index: formatting.aft =================================================================== RCS file: /cvsroot/bluemud/bluemuddocs/arch/formatting.aft,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** formatting.aft 2002/01/08 02:01:48 1.1 --- formatting.aft 2002/01/22 23:08:58 1.2 *************** *** 122,127 **** ! * Coding usage Here's an example of formatting used in in-game code: --- 122,150 ---- ! * Markup Tags + ** Color + + The color tag is pretty simple. It involves |<color v=...>...</color>| + where the |v=...| is some color string (all color strings are defined + in the |mudlib.constants| module) and the text to be colorized is + between the color tags. + + Examples: + + ^<< + <color v=red>this is red</color> + + <color v=blue>this is blue</color> + + <color v=hiblue>this is bright blue</color> + ^>> + + Since actual markup text is subject to change, coders should use the + functions in the |mudlib.formatter| module to handle color markup. + + + * Coding Usage + Here's an example of formatting used in in-game code: *************** *** 180,182 **** all over the mudlib and world code. You'd be hard-pressed to not be able to find any. - --- 203,204 ---- |
From: will g. <wil...@us...> - 2002-01-22 23:07:05
|
Update of /cvsroot/bluemud/bluemuddocs/tasks In directory usw-pr-cvs1:/tmp/cvs-serv20589/tasks Log Message: Directory /cvsroot/bluemud/bluemuddocs/tasks added to the repository |
From: will g. <wil...@us...> - 2002-01-22 21:10:35
|
Update of /cvsroot/bluemud/bluemud/code/mudlib In directory usw-pr-cvs1:/tmp/cvs-serv20823 Modified Files: living.py Log Message: Removal of acceptsWrites code. NPCs that want to look at the write and rawwrite method informaiton should override them and handle them accordingly. Index: living.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/living.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** living.py 2002/01/22 20:11:48 1.30 --- living.py 2002/01/22 21:10:32 1.31 *************** *** 1189,1193 **** self._mobile = 0 self._moveProbability = 60 - self._acceptsWrites = 0 self.setMind(stdlib.cloneObject("mudlib.mind.NPCMind")) self.addProperty(stdprops.IS_NPC, 1) --- 1189,1192 ---- *************** *** 1349,1363 **** self._randomActions = actions - def setAcceptsWrites(self, acceptsWrites): - """ Sets whether or not this NPC should receive data sent - by tellRoom through the 'write' method. - - arguments: - - 'acceptsWrites' -- (int) 1 if yes, 0 if no - - """ - self._acceptsWrites = acceptsWrites - def removeRandomAction(self, action): """ Removes an action from the random action list. --- 1348,1351 ---- *************** *** 1401,1406 **** """ ! if self._acceptsWrites: ! Interactive.rawwrite(self, message) def write(self, *message): --- 1389,1393 ---- """ ! pass def write(self, *message): *************** *** 1415,1420 **** """ ! if self._acceptsWrites: ! Interactive.write(self, message) def heartbeat(self): --- 1402,1406 ---- """ ! pass def heartbeat(self): |
From: will <wi...@bl...> - 2002-01-22 20:16:23
|
What a gyp! I did CRAZY stuff on living.py and it goes and prints: > [...1553 lines suppressed...] That's happy horseshit!! On Tue, 22 Jan 2002, will guaraldi wrote: > Update of /cvsroot/bluemud/bluemud/code/mudlib > In directory usw-pr-cvs1:/tmp/cvs-serv30637/code/mudlib > > Modified Files: > living.py stdlib.py > Log Message: > Added the scribe to the world lib. > Massive documentation effort on living.py and stdlib.py. > > > Index: living.py > =================================================================== > RCS file: /cvsroot/bluemud/bluemud/code/mudlib/living.py,v > retrieving revision 1.29 > retrieving revision 1.30 > diff -C2 -r1.29 -r1.30 > *** living.py 2002/01/17 03:30:35 1.29 > --- living.py 2002/01/22 20:11:48 1.30 > *************** > *** 65,69 **** > def getAdjectiveDescription(self): > """ Returns a string describing this Living using the adjectives > ! involved and the race.""" > if len(self.getAdjectives()) < 1: > return ("A featureless and, frankly, rather boring " + > --- 65,75 ---- > def getAdjectiveDescription(self): > """ Returns a string describing this Living using the adjectives > ! involved and the race. > ! > [...1553 lines suppressed...] > + so that if it fails, the user gets an idea of what's wrong. > + This could be a syntax issue or even an issue of them trying > + to apply a command to an object that can't be applied. > + > + arguments: > + > + 'message' -- (string) the failure message > + > + """ > self.currentFailureMessage = message > > > class HeartbeatEvent(MudEvent): > + """ > + The heartbeat event which when processed goes through all > + the objects on the mud with a heartbeat and adds a callout > + for their heartbeat method to be executed. > + """ > def process(self): > # Schedule next heartbeat > > Index: stdlib.py > =================================================================== > RCS file: /cvsroot/bluemud/bluemud/code/mudlib/stdlib.py,v > retrieving revision 1.11 > retrieving revision 1.12 > diff -C2 -r1.11 -r1.12 > *** stdlib.py 2002/01/08 06:46:22 1.11 > --- stdlib.py 2002/01/22 20:11:48 1.12 > *************** > *** 29,32 **** > --- 29,36 ---- > """ > Return the player currently driving this path of execution. > + > + returns: > + > + ??? > """ > return Driver.getActiveObject() > *************** > *** 40,43 **** > --- 44,58 ---- > and return it (unless the object is shared and already loaded, > in which case a reference to the shared object is returned). > + > + arguments: > + > + 'path' -- (string) dotted path string for the object > + > + 'shared=0' -- (int) 1 if it's a shared object, 0 if not > + > + returns: > + > + a MudObject instance > + > """ > return Driver.getObject(path, shared) > *************** > *** 51,54 **** > --- 66,78 ---- > function is equivalent to cloneObject with the shared parameter > turn on. > + > + arguments: > + > + 'path' -- (string) the dotted path string for the object > + > + returns: > + > + a MudObject instance > + > """ > return cloneObject(path, 1) > *************** > *** 62,65 **** > --- 86,96 ---- > timestamp will be prepended to the entry and a newline will > be appended to the entry. > + > + arguments: > + > + 'logName' -- (string) the name of the log to dump stuff into > + > + 'entry' -- (string) the stuff to log > + > """ > Driver.writeLogEntry(logName, entry) > *************** > *** 69,72 **** > --- 100,108 ---- > """ > Writes the given message to the current active player. > + > + arguments: > + > + 'message' -- (string?) writes the message to the player > + > """ > thisPlayer().write(message) > *************** > *** 86,89 **** > --- 122,136 ---- > loadIfOffline flag is false, then None will be returned. > > + arguments: > + > + 'playerName' -- (string) the player you're looking for > + > + 'loadIfOffline=0' -- (int) 1 if we should load them if they're > + offline, and 0 if not > + > + returns: > + > + (mudlib.living.Player) > + > """ > players = Driver.getGroupedInstances(constants.USER_GROUP) > *************** > *** 113,116 **** > --- 160,168 ---- > Also note that this method merely returns the representation, it does > NOT write the representation to disk. > + > + arguments: > + > + 'object' -- (MudObject) the object to save > + > """ > if object.getProperty(stdprops.IS_PERSISTENT): > *************** > *** 151,154 **** > --- 203,215 ---- > A new instance will be created and its load method invoked. > The loaded object will be returned, or None if loading fails. > + > + arguments: > + > + 'saveFileContent' -- (string) the string from loading the file > + > + returns: > + > + MudObject instance in the state it was persisted in > + > """ > objects = string.split(saveFileContent, "\n\n") > *************** > *** 214,216 **** > s = str.replace('"', r'\"').replace("'", r"\'") > return s > - > --- 275,276 ---- > > > _______________________________________________ > Bluemud-commits mailing list > Blu...@li... > https://lists.sourceforge.net/lists/listinfo/bluemud-commits > -- whatever it is, you can find it at http://www.bluesock.org/~willg/ except Will--you can only see him in real life. |
From: will g. <wil...@us...> - 2002-01-22 20:11:53
|
Update of /cvsroot/bluemud/bluemud/code/mudlib In directory usw-pr-cvs1:/tmp/cvs-serv30637/code/mudlib Modified Files: living.py stdlib.py Log Message: Added the scribe to the world lib. Massive documentation effort on living.py and stdlib.py. Index: living.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/living.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** living.py 2002/01/17 03:30:35 1.29 --- living.py 2002/01/22 20:11:48 1.30 *************** *** 65,69 **** def getAdjectiveDescription(self): """ Returns a string describing this Living using the adjectives ! involved and the race.""" if len(self.getAdjectives()) < 1: return ("A featureless and, frankly, rather boring " + --- 65,75 ---- def getAdjectiveDescription(self): """ Returns a string describing this Living using the adjectives ! involved and the race. ! [...1553 lines suppressed...] + so that if it fails, the user gets an idea of what's wrong. + This could be a syntax issue or even an issue of them trying + to apply a command to an object that can't be applied. + + arguments: + + 'message' -- (string) the failure message + + """ self.currentFailureMessage = message class HeartbeatEvent(MudEvent): + """ + The heartbeat event which when processed goes through all + the objects on the mud with a heartbeat and adds a callout + for their heartbeat method to be executed. + """ def process(self): # Schedule next heartbeat Index: stdlib.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/stdlib.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** stdlib.py 2002/01/08 06:46:22 1.11 --- stdlib.py 2002/01/22 20:11:48 1.12 *************** *** 29,32 **** --- 29,36 ---- """ Return the player currently driving this path of execution. + + returns: + + ??? """ return Driver.getActiveObject() *************** *** 40,43 **** --- 44,58 ---- and return it (unless the object is shared and already loaded, in which case a reference to the shared object is returned). + + arguments: + + 'path' -- (string) dotted path string for the object + + 'shared=0' -- (int) 1 if it's a shared object, 0 if not + + returns: + + a MudObject instance + """ return Driver.getObject(path, shared) *************** *** 51,54 **** --- 66,78 ---- function is equivalent to cloneObject with the shared parameter turn on. + + arguments: + + 'path' -- (string) the dotted path string for the object + + returns: + + a MudObject instance + """ return cloneObject(path, 1) *************** *** 62,65 **** --- 86,96 ---- timestamp will be prepended to the entry and a newline will be appended to the entry. + + arguments: + + 'logName' -- (string) the name of the log to dump stuff into + + 'entry' -- (string) the stuff to log + """ Driver.writeLogEntry(logName, entry) *************** *** 69,72 **** --- 100,108 ---- """ Writes the given message to the current active player. + + arguments: + + 'message' -- (string?) writes the message to the player + """ thisPlayer().write(message) *************** *** 86,89 **** --- 122,136 ---- loadIfOffline flag is false, then None will be returned. + arguments: + + 'playerName' -- (string) the player you're looking for + + 'loadIfOffline=0' -- (int) 1 if we should load them if they're + offline, and 0 if not + + returns: + + (mudlib.living.Player) + """ players = Driver.getGroupedInstances(constants.USER_GROUP) *************** *** 113,116 **** --- 160,168 ---- Also note that this method merely returns the representation, it does NOT write the representation to disk. + + arguments: + + 'object' -- (MudObject) the object to save + """ if object.getProperty(stdprops.IS_PERSISTENT): *************** *** 151,154 **** --- 203,215 ---- A new instance will be created and its load method invoked. The loaded object will be returned, or None if loading fails. + + arguments: + + 'saveFileContent' -- (string) the string from loading the file + + returns: + + MudObject instance in the state it was persisted in + """ objects = string.split(saveFileContent, "\n\n") *************** *** 214,216 **** s = str.replace('"', r'\"').replace("'", r"\'") return s - --- 275,276 ---- |
From: will g. <wil...@us...> - 2002-01-22 20:11:52
|
Update of /cvsroot/bluemud/bluemud/world/domains/lib In directory usw-pr-cvs1:/tmp/cvs-serv30637/world/domains/lib Added Files: scribe.py Log Message: Added the scribe to the world lib. Massive documentation effort on living.py and stdlib.py. --- NEW FILE: scribe.py --- ##################################################################### # This file is part of Bluemud. # # Bluemud is free software; use of the software is under the terms of # the MIT/X license. # # 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. # # For details, see a copy of the license text which can be found with # the Bluemud source distribution in the file entitled LICENSE. # $Id: scribe.py,v 1.1 2002/01/22 20:11:48 willhelm Exp $ ##################################################################### """ This is a scribe class. For in-game meetings, it's sometimes necessary to keep minutes of those meetings. This is a scribe's role. When a scribe is told to start scribing, anything said or done in the room that produces a tellRoom message will be recorded in his annals from his perspective. """ from org.bluesock.bluemud.driver import Driver import mudlib.living import mudlib.stdprops import mudlib.utils import mudlib.callout class Scribe(mudlib.living.NPC): def createNPC(self): self.setRace("elf") self.setName("scribe") self.setMoveProbability(0) self.setLongDescription("This scribe is a quiet fellow. " + "For the most part he just sits here and scribes stuff " + "when you ask him to.\n\n" + " say please start scribing\n" + " say please stop scribing", mudlib.stdlib.VBFC(self.scribingCheck)) self.addAsk("scribe", self.askScribe) # this next line allows coders to have the scribe write new files # automatically for the different time of day. it also allows # coders to change which file to append to. self._filename = "/world/minutes/minutes.%m%d%Y" self._scribeFile = "" def setFilename(self, filename): """ This sets the filename. Filenames are run through time.strftime, so feel free to use %m, %d, %Y sorts of time formatter symbols as specified in the Python time module. """ self._filename = filename def scribingCheck(self): """ Checks to see if the scribe is currently scribing. Returns a string telling what the scribe is currently doing. """ if self._scribeFile != "": return "\n\nThe scribe is currently scribing." return "\n\nThe scribe is sitting idly." def askScribe(self): """ Implements the ask command. So folks can "ask scribe" and get some information as to what the scribe does. """ mudlib.callout.addCallout(2, self, self.command, "say You can tell me to start scribing or stop scribing.") def startScribing(self): """ Starts the scribe scribing. It creates a minutes log and tosses the time/date of when the scribe was told to begin. """ import time self._scribeFile = time.strftime(self._filename, time.localtime(time.time())) self.scribeThis("\nMinutes starting " + time.asctime(time.localtime(time.time()))) def scribeThis(self, message): """ Appends a message to the scribe file. """ try: Driver.writeFile(message + "\n", self._scribeFile, 1) except: mudlib.callout.addCallout(1, self, self.command, "say I seem to be having problems scribing.") def write(self, *message): """ Overrides the write method of Object. We evaluate all the VBFCs from the point of view of the scribe NPC, and then remove any formatting symbols with ansi off and wraplength set to 72. Then we figure out if this is a command to the scribe "please start scribing" or "please stop scribing" or a message to write down (if we're currently scribing). """ activeObject = Driver.getActiveObject() Driver.setActiveObject(self) mess = mudlib.utils.evaluateVBFC(message) mess = mudlib.formatter.format_text(textlist=mess, ansicolor=0, wraplength=72) Driver.setActiveObject(activeObject) if mess.find("please start scribing") != -1: mudlib.callout.addCallout(1, self, self.command, ("say I will scribe everything said here. Be sure to " + "introduce yourselves to me now.")) self.startScribing() return if mess.find("please stop scribing") != -1: mudlib.callout.addCallout(1, self, self.command, ("say I will stop scribing now.")) self._scribeFile = "" return if self._scribeFile != "": self.scribeThis(mess) |
From: will g. <wil...@us...> - 2002-01-21 16:56:10
|
Update of /cvsroot/bluemud/bluemud/code/mudlib In directory usw-pr-cvs1:/tmp/cvs-serv16012 Modified Files: employable.py stats.py viewer.py vtelnet.py Log Message: Massive documentation effort. Index: employable.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/employable.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** employable.py 2002/01/20 02:32:53 1.10 --- employable.py 2002/01/21 16:56:07 1.11 *************** *** 68,72 **** returns: ! (???) """ --- 68,72 ---- returns: ! a failure string (true) if it cannot be worn or 0 (false) """ *************** *** 95,99 **** returns: ! (???) """ --- 95,99 ---- returns: ! a failure string (true) if it cannot be removed or 0 (false) """ *************** *** 114,117 **** --- 114,119 ---- method, but should instead make sue of the cannotRemove method to restrict when an item can be removed. + + see 'mudlib.core.Object' """ if self._isWorn and environment.getProperty(stdprops.IS_INTERACTIVE): *************** *** 129,132 **** --- 131,140 ---- This method is used to indicate that the bodypart is now covered, presumably because this item is now being worn. + + arguments: + + 'bodyPart' -- (string) the body part being covered + (see mudlib.constants for constants) + """ self._wornOnBodyParts = self._wornOnBodyParts + [bodyPart] *************** *** 147,150 **** --- 155,163 ---- item is worn. This method is used to retrieve bodyparts that are now covered, presumably because this item is now being worn. + + returns: + + (list of strings) all the body parts this wearable is covering + """ return self._wornOnBodyParts *************** *** 157,160 **** --- 170,179 ---- body parts are not available or are already covered by another wearable item. + + arguments: + + 'bodyPart' -- (string) the body part that would be covered + (see mudlib.constants for constants) + """ self._coveredBodyParts = self._coveredBodyParts + [bodyPart] *************** *** 164,172 **** Returns the list of body parts that this item covers. Each body part is a constant from the constants module. """ return self._coveredBodyParts def enterEnvironment(self, newEnvironment): ! """ Bind wear and remove actions to interactive. """ if newEnvironment.getProperty(stdprops.IS_INTERACTIVE): newEnvironment.getActionManager().addAction("wear", self.wearAction) --- 183,199 ---- Returns the list of body parts that this item covers. Each body part is a constant from the constants module. + + returns: + + (list of strings) all the body parts this wearable would cover + """ return self._coveredBodyParts def enterEnvironment(self, newEnvironment): ! """ Bind wear and remove actions to interactive. ! ! see 'mudlib.core.Object' ! """ if newEnvironment.getProperty(stdprops.IS_INTERACTIVE): newEnvironment.getActionManager().addAction("wear", self.wearAction) *************** *** 174,178 **** def leaveEnvironment(self, oldEnvironment): ! """ Unbind wear and remove actions from interactive. """ if oldEnvironment.getProperty(stdprops.IS_INTERACTIVE): oldEnvironment.getActionManager().removeAction("wear", self.wearAction) --- 201,208 ---- def leaveEnvironment(self, oldEnvironment): ! """ Unbind wear and remove actions from interactive. ! ! see 'mudlib.core.Object' ! """ if oldEnvironment.getProperty(stdprops.IS_INTERACTIVE): oldEnvironment.getActionManager().removeAction("wear", self.wearAction) *************** *** 213,222 **** continue else: ! target.wearOn(thisPlayer) woreSomething = 1 return woreSomething ! def wearOn(self, interactive): ! """ Causes the given interactive to wear this item. """ self._isWorn = 1 interactive.addWornObject(self) --- 243,252 ---- continue else: ! target._wearOn(thisPlayer) woreSomething = 1 return woreSomething ! def _wearOn(self, interactive): ! """ Causes the given interactive to wear this item.""" self._isWorn = 1 interactive.addWornObject(self) *************** *** 256,264 **** continue else: ! target.removeFrom(thisPlayer) removedSomething = 1 return removedSomething ! def removeFrom(self, interactive): """ Causes the interactive to remove this item. """ self._isWorn = 0 --- 286,294 ---- continue else: ! target._removeFrom(thisPlayer) removedSomething = 1 return removedSomething ! def _removeFrom(self, interactive): """ Causes the interactive to remove this item. """ self._isWorn = 0 *************** *** 305,308 **** --- 335,348 ---- are available. Any checks in this method should be above and beyond the normal ones. + + arguments: + + 'interactive' -- (mudlib.living.Interactive) the interactive + trying to wield this wieldable. + + returns: + + a failure string (true) if it cannot be wielded or 0 (false) + """ return 0 *************** *** 323,330 **** --- 363,384 ---- worry about standard checks. Any checks in this method should be above and beyond the normal ones. + + arguments: + + 'interactive' -- (mudlib.living.Interactive) the interactive + trying to unwield this wieldable + + returns: + + a failure string (true) if it cannot be unwielded or 0 (false) + """ return 0 def canLeaveEnvironment(self, environment): + """ Figures out if the player can unwield the item. + + see 'mudlib.core.Object' + """ if self._isWielded and environment.getProperty(stdprops.IS_INTERACTIVE): msg = self.cannotUnwield(environment) *************** *** 348,351 **** --- 402,411 ---- constants module. An interactive will not be able wield this item if the required body parts are not available or are in use. + + arguments: + + 'bodyPart' -- (string) the bodypart that is used to wield + this wieldable (see mudlib.constants for constants) + """ self._requiredBodyParts = self._requiredBodyParts + [bodyPart] Index: stats.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/stats.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** stats.py 2002/01/09 03:25:09 1.1 --- stats.py 2002/01/21 16:56:07 1.2 *************** *** 105,110 **** If any value is less than STAT_MIN, then it will be set to STAT_MIN. Likewise, if any value is greater than STAT_MAX, then it will be ! set to STAT_MAX. Both constants can be found in the mudlib.constants module. """ for stat in stats.keys(): --- 105,116 ---- If any value is less than STAT_MIN, then it will be set to STAT_MIN. Likewise, if any value is greater than STAT_MAX, then it will be ! set to STAT_MAX. Both constants can be found in the 'mudlib.constants' module. + + arguments: + + 'stats' -- (hash) the stat hashmap to normalize. keys are stats + constants and values are ints + """ for stat in stats.keys(): *************** *** 131,134 **** --- 137,149 ---- be made only if appropriate. + arguments: + + 'stats' -- (hash) the stat hashmap to normalize. keys are stats + constants and values are ints + + 'unitsOfWork' -- (hash) same setup as the stats argument + + 'lastAdjustedTime' -- (int) the last adjusted time tick + """ if _statAdjustmentNeeded(lastAdjustmentTime): *************** *** 169,176 **** def _requiredUnitsOfWorkForStat(statValue): ! # TODO: this method could be optimized by precalculating all of ! # units of work for each stat level and then just looking ! # them up here. Or even just saving values after they've ! # been calculated (lazy calculating) majorLevelWork = ((statValue + 1) / 5) ** 3 workPerLevel = (((statValue + 6) / 5) ** 3 - majorLevelWork) / 5 --- 184,193 ---- def _requiredUnitsOfWorkForStat(statValue): ! """ ! TODO -- this method could be optimized by precalculating all of ! units of work for each stat level and then just looking ! them up here. Or even just saving values after they've ! been calculated (lazy calculating) ! """ majorLevelWork = ((statValue + 1) / 5) ** 3 workPerLevel = (((statValue + 6) / 5) ** 3 - majorLevelWork) / 5 Index: viewer.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/viewer.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** viewer.py 2001/12/23 22:29:03 1.11 --- viewer.py 2002/01/21 16:56:07 1.12 *************** *** 33,37 **** """ def more(self, player, text, raw=1): ! """Initializes a more object """ self._player = player --- 33,49 ---- """ def more(self, player, text, raw=1): ! """Initializes a more object. ! ! arguments: ! ! 'player' -- (mudlib.living.Interactive) the interactive ! ! 'text' -- (string) the complete text to view ! ! 'raw=1' -- (int) whether or not to send the text raw. ! this affects sending code files and such which ! need to have color formatting tags quelled. ! ! """ self._player = player *************** *** 69,73 **** def _displayText(self): ! """ Actually displays the text to the player """ if self._lineno + self._rows >= len(self._text): self._player.getMind().popInputProcessor() --- 81,85 ---- def _displayText(self): ! """ Actually displays the text to the player. """ if self._lineno + self._rows >= len(self._text): self._player.getMind().popInputProcessor() *************** *** 79,83 **** def _processInput(self, input): ! """ Processes player input at the more prompt """ if input in ["Q", "q"]: self._player.getMind().popInputProcessor() --- 91,101 ---- def _processInput(self, input): ! """ Processes player input at the more prompt. ! ! arguments: ! ! 'input' -- (string) the incoming player input ! ! """ if input in ["Q", "q"]: self._player.getMind().popInputProcessor() Index: vtelnet.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/vtelnet.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** vtelnet.py 2002/01/06 21:38:00 1.9 --- vtelnet.py 2002/01/21 16:56:07 1.10 *************** *** 19,25 **** and option codes infinitely easier to read, write, and debug. Don't call anything in here outside of the mudlib. It's not healthy. ! Also holds character constants and such. """ --- 19,29 ---- and option codes infinitely easier to read, write, and debug. + This module is not for formatting text--use 'mudlib.formatter' for + that. This module is for the various in-game editors we have which + have a "curses" kind of interface. + Don't call anything in here outside of the mudlib. It's not healthy. ! Also holds character constants for those editors and such. """ *************** *** 97,101 **** def ctrl(x): ! """returns the control code for this character""" return chr(ord(x) - 96) --- 101,118 ---- def ctrl(x): ! """Returns the control code for this character. ! ! example: 'a' -> 'ctrl-a' ! ! arguments: ! ! 'x' -- (character) the character to convert ! to a control code ! ! returns: ! ! (character) the control version of the character ! ! """ return chr(ord(x) - 96) *************** *** 106,116 **** def inverseText(str): ! """returns the sequence for inversed text (background <-> ! foreground colors) """ return ESC + "[7m" + str + ESC + "[0m" def boldText(str): ! """returns the sequence for bolded text""" return ESC + "[1m" + str + ESC + "[0m" --- 123,152 ---- def inverseText(str): ! """Returns the sequence for inversed text (background <-> ! foreground colors). ! ! arguments: ! ! 'str' -- (string) the text to inverse ! ! return: ! ! (string) the text in the inversion ansi codes ! """ return ESC + "[7m" + str + ESC + "[0m" def boldText(str): ! """ Returns the sequence for bolded text. ! ! arguments: ! ! 'str' -- (string) the string to bold ! ! returns: ! ! (string) the string surrounded by the bold ansi codes ! ! """ return ESC + "[1m" + str + ESC + "[0m" |
From: will g. <wil...@us...> - 2002-01-20 02:32:57
|
Update of /cvsroot/bluemud/bluemud/code/mudlib In directory usw-pr-cvs1:/tmp/cvs-serv10638 Modified Files: callout.py coder.py commands.py core.py currency.py door.py editor.py emote.py employable.py formatter.py heap.py language.py mpico.py nomacs.py possessed.py race.py trade.py Log Message: Massive documentation effort. These modules have either been documented to a point where I'm happy and the happydocs are very useful or they've been marked with a "This module lacks in documentation" at the top so that the happydocs note the module is lacking. This is about 8 hours total of work over the last two days. I'll try to get to the other half of the mudlib modules in the next couple of days. Any help is greatly appreciated--just keep using the markup I'm using for the doc-strings--good examples in core.py. I'm going to do a write-up on how to do doc-strings in the coding conventions guide on the bluemud site. I would like for all future modules to be written using this standard. It'll save us a lot of time in the long run and keep this project going in good directions. Index: callout.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/callout.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** callout.py 2002/01/16 19:36:33 1.8 --- callout.py 2002/01/20 02:32:52 1.9 *************** *** 52,64 **** arguments: ! 'secondsDelay' - (int) the number of seconds from now that the callout ! should execute. ! 'activeObject' - (instance) the object on which the method should be ! called. ! 'method' - (function) the method to call ! 'optionalArguments=None' - (tuple) the arguments to pass to the method """ --- 52,64 ---- arguments: ! 'secondsDelay' -- (int) the number of seconds from now that the callout ! should execute. ! 'activeObject' -- (instance) the object on which the method should be ! called. ! 'method' -- (function) the method to call ! 'optionalArguments=None' -- (tuple) the arguments to pass to the method """ *************** *** 76,83 **** arguments: ! 'secondsDelay' - (int) the number of seconds to wait until ! executing this event. ! 'event' - (mudlib.callout.CalloutEvent) the event to schedule """ Driver.addCallout(secondsDelay, event) --- 76,83 ---- arguments: ! 'secondsDelay' -- (int) the number of seconds to wait until ! executing this event. ! 'event' -- (mudlib.callout.CalloutEvent) the event to schedule """ Driver.addCallout(secondsDelay, event) *************** *** 102,111 **** arguments: ! 'activeObject' - (ob instance) the object to call the method on ! 'method' - (function) the method to call ! 'optionalArguments=None' - (tuple) arguments to send to the method ! being invoked """ --- 102,111 ---- arguments: ! 'activeObject' -- (ob instance) the object to call the method on ! 'method' -- (function) the method to call ! 'optionalArguments=None' -- (tuple) arguments to send to the method ! being invoked """ Index: coder.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/coder.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -r1.49 -r1.50 *** coder.py 2002/01/16 19:36:33 1.49 --- coder.py 2002/01/20 02:32:53 1.50 *************** *** 80,83 **** --- 80,88 ---- current working directory is an attribute on the player object. If it hasn't been set, then the home directory is the default. + + returns: + + (string) the current working directory based on the world + data root """ pl = stdlib.thisPlayer() *************** *** 253,257 **** def _execText(self, text): ! """ Used by execCommand, executes python code from the line editor.""" exec text --- 258,268 ---- def _execText(self, text): ! """ Used by execCommand, executes python code from the line editor. ! ! arguments: ! ! 'text' -- (string) the text to execute via a python exec call ! ! """ exec text *************** *** 1018,1023 **** arguments: ! 'errorMessage' - (string) the stacktrace/error text to ! send to the coder """ --- 1029,1034 ---- arguments: ! 'errorMessage' -- (string) the stacktrace/error text to ! send to the coder """ *************** *** 1039,1046 **** arguments: ! 'editor' - (editor ob instance) the editor holding the buffer we ! want to save ! 'args' - (list of arguments) (ignored) """ --- 1050,1057 ---- arguments: ! 'editor' -- (editor ob instance) the editor holding the buffer we ! want to save ! 'args' -- (list of arguments) (ignored) """ *************** *** 1083,1090 **** arguments: ! 'pl' - (player ob) This is the player to promote to coder status. ! 'promotenotify=1' - (int) 1 if yes, 0 if no as to whether to notify ! people in the room as to this promoted coders code-edness. """ --- 1094,1102 ---- arguments: ! 'pl' -- (player ob) This is the player to promote to coder status. ! 'promotenotify=1' -- (int) 1 if yes, 0 if no as to whether to notify ! people in the room as to this promoted coders ! code-edness. """ Index: commands.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/commands.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -r1.47 -r1.48 *** commands.py 2002/01/17 03:30:35 1.47 --- commands.py 2002/01/20 02:32:53 1.48 *************** *** 79,88 **** arguments: ! 'logName' - (string) the name of the log to place this text in ! 'text' - (string) the text to add to the log--if there is no ! text, then '_logText' will instantiate an editor and let the ! user enter in their text via the editor. """ tp = stdlib.thisPlayer() --- 79,93 ---- arguments: ! 'logName' -- (string) the name of the log to place this text in ! 'text' -- (string) the text to add to the log--if there is no ! text, then '_logText' will instantiate an editor and ! let the user enter in their text via the editor. + + returns: + + (int) 1 + """ tp = stdlib.thisPlayer() *************** *** 107,113 **** arguments: ! 'text' - (string) the text from the editor. ! 'logName' - (string) the name of the log to place it in. """ --- 112,118 ---- arguments: ! 'text' -- (string) the text from the editor. ! 'logName' -- (string) the name of the log to place it in. """ *************** *** 346,350 **** def ask(self, actionString, arguments, rawinput): ! """ Implements the "ask" command. This allows players to ask NPCs about certain things triggering --- 351,355 ---- def ask(self, actionString, arguments, rawinput): ! """ Implements the 'ask' command. This allows players to ask NPCs about certain things triggering *************** *** 806,812 **** arguments: ! 'argumentsTuple' - (list of strings) this is what the player ! was searching for. ex: 'search book' book would be the ! argumentsTuple. """ --- 811,817 ---- arguments: ! 'argumentsTuple' -- (list of strings) this is what the player ! was searching for. ex: 'search book' book ! would be the argumentsTuple. """ *************** *** 833,837 **** arguments: ! 'input' - (string) what the user typed in """ --- 838,842 ---- arguments: ! 'input' -- (string) what the user typed in """ Index: core.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/core.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** core.py 2002/01/17 03:30:35 1.16 --- core.py 2002/01/20 02:32:53 1.17 *************** *** 88,91 **** --- 88,96 ---- This primarily is done so that the bluemud OID will be displayed instead of the Python OID. + + returns: + + (string) module name then classname then our special object id + """ return ("<" + self.__module__ + "." + [...1005 lines suppressed...] --- 1476,1483 ---- objects in its inventory. + arguments: + + 'isRigid' -- (int) 1 if it's rigid, and 0 if not + """ self._isRigid = isRigid *************** *** 1048,1051 **** --- 1491,1498 ---- objects in its inventory. This method returns 1 if this container is rigid, 0 otherwise. + + returns: + + (int) 1 if rigid, 0 if not """ Index: currency.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/currency.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** currency.py 2001/10/20 04:03:18 1.8 --- currency.py 2002/01/20 02:32:53 1.9 *************** *** 14,17 **** --- 14,20 ---- ##################################################################### + """ + This module suffers from a lack of documentation. + """ from org.bluesock.bluemud.driver import Driver import core Index: door.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/door.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** door.py 2001/12/23 22:29:02 1.10 --- door.py 2002/01/20 02:32:53 1.11 *************** *** 52,86 **** def getShortDescription(self): ! """ Returns the short description of the door and where it leads. """ return (core.Object.getShortDescription(self) + " leading " + self.getExitName()) def setExitName(self, exitName): ! """ Sets the exit name that the door creates when opened.""" self._exitName = exitName def getExitName(self): ! """ Returns the exit name the door creates when opened.""" return self._exitName def setAdjoiningRoom(self, roomPath): ! """ Sets the room the door leads to.""" self._adjoiningRoom = roomPath def getAdjoiningRoom(self): ! """ Returns the room the door leads to.""" return stdlib.cloneObject(self._adjoiningRoom, 1) def setOpposingExitName(self, exitName): ! """ Sets the exit leading back to the room.""" self._opposingExitName = exitName def getOpposingExitName(self): ! """ Returns the exit leading back to the room.""" return self._opposingExitName def openStatus(self): ! """ Returns status text as to whether the door is open or closed.""" ! # FIXME - this should be isOpenString if self.isOpen(): return "It is open." --- 52,135 ---- def getShortDescription(self): ! """ Returns the short description of the door and where it leads. ! ! returns: ! ! (string) the evaluated short description of the door and where ! it leads ! ! """ return (core.Object.getShortDescription(self) + " leading " + self.getExitName()) def setExitName(self, exitName): ! """ Sets the exit name that the door creates when opened. ! ! arguments: ! ! 'exitName' -- (string) the exit created when the door opens ! ! """ self._exitName = exitName def getExitName(self): ! """ Returns the exit name the door creates when opened. ! ! returns: ! ! (string) the exit name ! ! """ return self._exitName def setAdjoiningRoom(self, roomPath): ! """ Sets the room the door leads to. ! ! arguments: ! ! 'roomPath' -- (string) the dotted string path of the room ! ! """ self._adjoiningRoom = roomPath def getAdjoiningRoom(self): ! """ Returns the room the door leads to. ! ! returns: ! ! (object) the adjoining room object ! ! """ return stdlib.cloneObject(self._adjoiningRoom, 1) def setOpposingExitName(self, exitName): ! """ Sets the exit leading back to the room. ! ! arguments: ! ! 'exitName' -- (string) the name of the exit leading back ! into the room ! ! """ self._opposingExitName = exitName def getOpposingExitName(self): ! """ Returns the exit leading back to the room. ! ! returns: ! ! (string) the name of the exit leading back into this room ! ! """ return self._opposingExitName def openStatus(self): ! """ Returns status text as to whether the door is open or closed. ! ! returns: ! ! (string) the status of the door ("It is open." or "It is closed.") ! ! """ if self.isOpen(): return "It is open." *************** *** 89,97 **** def isOpen(self): ! """ Returns boolean as to whether the door is open or closed.""" return self._isOpen def open(self): ! """ Opens the door.""" if self.isLocked() and self._useLock: stdlib.thisPlayer().getActionManager().notifyFail("Door is locked.") --- 138,158 ---- def isOpen(self): ! """ Returns boolean as to whether the door is open or closed. ! ! returns: ! ! (int) 1 if it's open, 0 if not. ! ! """ return self._isOpen def open(self): ! """ Opens the door. ! ! returns: ! ! (int) 1 if it opened successfully, 0 if not ! ! """ if self.isLocked() and self._useLock: stdlib.thisPlayer().getActionManager().notifyFail("Door is locked.") *************** *** 108,112 **** def close(self): ! """ Closes the door.""" self._isOpen = 0 self.getEnvironment().removeExit(self._exitName) --- 169,179 ---- def close(self): ! """ Closes the door. ! ! returns: ! ! (int) 1 always ! ! """ self._isOpen = 0 self.getEnvironment().removeExit(self._exitName) *************** *** 122,126 **** If the key combination does not match the door combination, then ! this will fail and return a 0.""" if self._keyCombination == key.getKeyCombination(): self._isLocked = 1 --- 189,203 ---- If the key combination does not match the door combination, then ! this will fail and return a 0. ! ! arguments: ! ! 'key' -- (mudlib.door.Key) the key being used to lock the door ! ! returns: ! ! (int) 1 if successful, 0 if not ! ! """ if self._keyCombination == key.getKeyCombination(): self._isLocked = 1 *************** *** 136,140 **** If the key combination does not match the door combination, then ! this will fail and return a 0.""" if self._keyCombination == key.getKeyCombination(): self._isLocked = 0 --- 213,227 ---- If the key combination does not match the door combination, then ! this will fail and return a 0. ! ! arguments: ! ! 'key' -- (mudlib.door.Key) the key being used to unlock the door ! ! returns: ! ! (int) 1 if successful, 0 if not ! ! """ if self._keyCombination == key.getKeyCombination(): self._isLocked = 0 *************** *** 147,151 **** def setDoorLock(self, keyCombo): ! """ Sets the door combination for locking/unlocking.""" self._keyCombination = keyCombo self._isLocked = 1 --- 234,244 ---- def setDoorLock(self, keyCombo): ! """ Sets the door combination for locking/unlocking. ! ! arguments: ! ! 'keyCombo' -- (string) the "combination" for this key ! ! """ self._keyCombination = keyCombo self._isLocked = 1 *************** *** 154,159 **** def isLocked(self): """ Returns a boolean as to whether the door is locked or not. ! 1 if locked, 0 if not locked.""" return self._isLocked --- 247,256 ---- def isLocked(self): """ Returns a boolean as to whether the door is locked or not. + + returns: ! (int) 1 if locked, 0 if not locked. ! ! """ return self._isLocked *************** *** 161,165 **** """ This function gets called when a player enters the room with the door in it to add the exit that the door leads to ! (if the door is open).""" if self._isOpen: environment.addExit(self._exitName, self._adjoiningRoom) --- 258,265 ---- """ This function gets called when a player enters the room with the door in it to add the exit that the door leads to ! (if the door is open). ! ! see 'mudlib.core.Object' ! """ if self._isOpen: environment.addExit(self._exitName, self._adjoiningRoom) *************** *** 167,171 **** def objectEnteredEnvironment(self, object): """ This function gets called when a player enters the room ! to register the actions for manipulating the door.""" if object.getProperty(stdprops.IS_INTERACTIVE): object.getActionManager().addAction("open", self.openDoor) --- 267,274 ---- def objectEnteredEnvironment(self, object): """ This function gets called when a player enters the room ! to register the actions for manipulating the door. ! ! see 'mudlib.core.Object' ! """ if object.getProperty(stdprops.IS_INTERACTIVE): object.getActionManager().addAction("open", self.openDoor) *************** *** 177,181 **** def objectLeftEnvironment(self, object): """ This function gets called when a player leaves the room ! to unregister the actions for manipulating the door.""" if object.getProperty(stdprops.IS_INTERACTIVE): object.getActionManager().removeAction("open", self.openDoor) --- 280,287 ---- def objectLeftEnvironment(self, object): """ This function gets called when a player leaves the room ! to unregister the actions for manipulating the door. ! ! see 'mudlib.core.Object' ! """ if object.getProperty(stdprops.IS_INTERACTIVE): object.getActionManager().removeAction("open", self.openDoor) *************** *** 350,356 **** class Key(core.Object): ! """ ! This is a basic key for unlocking/locking a door. To match ! a specific door to a specific key, use the setKeyCombination method. """ --- 456,462 ---- class Key(core.Object): ! """This is a basic key for unlocking/locking a door. ! ! To match a specific door to a specific key, use the 'setKeyCombination' method. """ *************** *** 367,376 **** def setKeyCombination(self, keyCombo): ! """ Sets the combination for the key--this matches the key to ! a specific lock on a door or other locked object.""" self._keyCombination = keyCombo def getKeyCombination(self): ! """ Returns the combination for the key.""" return self._keyCombination --- 473,497 ---- def setKeyCombination(self, keyCombo): ! """ Sets the combination for the key. ! ! This matches the key to a specific lock on a door or other ! locked object. ! ! arguments: ! ! 'keyCombo' -- (string) the combination for this key--a unique ! id of sorts ! ! """ self._keyCombination = keyCombo def getKeyCombination(self): ! """ Returns the combination for the key. ! ! returns: ! ! (string) the combination for this key. ! ! """ return self._keyCombination Index: editor.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/editor.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** editor.py 2001/12/23 22:29:02 1.8 --- editor.py 2002/01/20 02:32:53 1.9 *************** *** 43,47 **** def editFile(self, filename): ! """Load the given file for editing, or create if none exists. """ self.editText() self._filename = filename --- 43,53 ---- def editFile(self, filename): ! """Load the given file for editing, or create if none exists. ! ! arguments: ! ! 'filename' -- (string) the name of the file to edit. ! ! """ self.editText() self._filename = filename *************** *** 64,67 **** --- 70,81 ---- (%Q), this method will not be invoked. + arguments: + + 'methodToInvokeOnExit' -- (function) the function to call when + the editor exits + + 'optionalParam=None' -- (list of args) the arguments to pass + to the method upon exit + """ self._exitMethod = methodToInvokeOnExit *************** *** 69,72 **** --- 83,89 ---- def editText(self): + """ + Sets up the mudlib.mind.Mind to us the editor's processInput. + """ stdlib.thisPlayer().getMind().pushInputProcessor(self.processInput, self.prompt) *************** *** 80,83 **** --- 97,104 ---- an editor command, then the line is appended to the buffer. + arguments: + + 'input' -- (string) input from the player + """ thisPlayer = stdlib.thisPlayer() *************** *** 230,234 **** Note that lineno should be a line number, not an array index. ! """ self._currentLine = lineno --- 251,259 ---- Note that lineno should be a line number, not an array index. ! ! arguments: ! ! 'lineno' -- (int) the line number to go to ! """ self._currentLine = lineno *************** *** 243,246 **** --- 268,275 ---- Note that lineno should be a line number, not an array index. + arguments: + + 'lineno' -- (int) the line number + """ # Argument is line number, not array index *************** *** 251,256 **** Note that firstLine and lastLine should be line numbers, not ! array indexes. """ # Remember we're working in line numbers, which start at 1, not 0. --- 280,292 ---- Note that firstLine and lastLine should be line numbers, not ! array indexes. Line numbers start at 1 while array indexes ! start at 0. ! ! arguments: + 'firstLine' -- (int) the first line bound + + 'lastLine' -- (int) the last line bound + """ # Remember we're working in line numbers, which start at 1, not 0. *************** *** 286,288 **** --- 322,331 ---- def _bufferToString(self): + """Returns the buffer as a string. + + returns: + + (string) the edit buffer + + """ return string.join(self._text, "\n") Index: emote.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/emote.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** emote.py 2002/01/05 04:43:40 1.14 --- emote.py 2002/01/20 02:32:53 1.15 *************** *** 119,122 **** --- 119,131 ---- to the list of all the emotes available so we can distinguish emotes from commands. + + arguments: + + 'manager' -- (??) + + 'actionString' -- (string) the action string + + 'function' -- (function) the function to handle the action + """ manager.addAction(actionString, function) *************** *** 908,911 **** --- 917,924 ---- def writeAction(self, action, arguments, defaultAdverb): + """ + Writes basic text for really simple emotes. Basically + it's ''You <action> <adverb>.'' + """ thisPlayer = stdlib.thisPlayer() thisRoom = thisPlayer.getEnvironment() *************** *** 930,937 **** defaultAdverb, failString, arguments): """ ! %e is the emote. ! %o is the object of the emote (the target). ! %a is an adverb. ! %sp is a possessive source (your/his/her) """ if not arguments: --- 943,979 ---- defaultAdverb, failString, arguments): """ ! 'simpleEmote' attempts to make emotes easier to create ! since many of them follow a basic syntax. In the 'displayString' ! and 'parseString' arguments, the following are used: ! ! - '%e' is the emote ! ! - '%o' is the object of the emote (the target) ! ! - '%a' is an adverb ! ! - '%sp' is a possessive source (your/his/her) ! ! arguments: ! ! 'actionString' -- (string) the one word action string or ! emote command ! ! 'parseString' -- (string) the string used by the parser ! to recognize direct objects and adverbs ! and such ! ! 'displayString' -- (string) what gets displayed to everyone ! ! 'failString' -- (string) the notification of failure (if ! the player didn't use good syntax) ! ! 'arguments' -- (list of strings) the arguments sent by ! the input processor that the player typed in ! ! returns: ! ! (int) 1 if successful, 0 if not ! """ if not arguments: Index: employable.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/employable.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** employable.py 2001/10/29 01:03:11 1.9 --- employable.py 2002/01/20 02:32:53 1.10 *************** *** 20,23 **** --- 20,24 ---- classes is very similar and should probably be moved into an Employable base class. + """ import core *************** *** 59,62 **** --- 60,73 ---- checks in this method should be above and beyond the normal ones. + + arguments: + + 'interactive' -- (mudlib.living.Interactive) the interactive + to test + + returns: + + (???) + """ return 0 *************** *** 76,79 **** --- 87,100 ---- method need not worry about standard checks. Any checks in this method should be above and beyond the normal ones. + + arguments: + + 'interactive' -- (mudlib.living.Interactive) the interactive + to test + + returns: + + (???) + """ return 0 Index: formatter.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/formatter.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** formatter.py 2002/01/16 19:36:33 1.27 --- formatter.py 2002/01/20 02:32:53 1.28 *************** *** 75,79 **** arguments: ! 'text' - (string) the text in question returns: --- 75,79 ---- arguments: ! 'text' -- (string) the text in question returns: *************** *** 111,114 **** --- 111,119 ---- Note: right now it does all the initialization up front--this should probably be moved to on demand. + + arguments: + + 'text' -- (string) the initial text to iterate over. + """ self.textlist = split_formatting_from_text(text) *************** *** 166,171 **** arguments: ! 'newtext' - (string) the text element to replace the existing ! one. """ --- 171,176 ---- arguments: ! 'newtext' -- (string) the text element to replace the existing ! one. """ *************** *** 220,225 **** arguments: ! 'newformat' - (string) the formatting element to replace the ! existing one """ --- 225,230 ---- arguments: ! 'newformat' -- (string) the formatting element to replace the ! existing one """ *************** *** 231,234 **** --- 236,247 ---- text tokens in the text list (text tokens being non-formatting). + arguments: + + 'textlist' -- (list of strings) the list of strings to parse + + returns: + + (list of strings) the list of only text elements + """ list = [] *************** *** 244,247 **** --- 257,268 ---- formatting tokens in the text list. + arguments: + + 'textlist' -- (list of strings) the list of strings to parse + + returns: + + (list of strings) the list of only format elements + """ list = [] *************** *** 265,269 **** arguments: ! 'c' - (string) the color string returns: --- 286,290 ---- arguments: ! 'c' -- (string) the color string returns: *************** *** 293,299 **** arguments: ! 'c' - (string) the color string ! 'text' - (string) the text to color returns: --- 314,320 ---- arguments: ! 'c' -- (string) the color string ! 'text' -- (string) the text to color returns: *************** *** 318,327 **** arguments: ! 'i' - how much to indent ! 'text=None' - text to indent ! 'indentfirstline=mudlib.constants.TRUE' - whether or not to ! indent the first line (default is TRUE) returns: --- 339,348 ---- arguments: ! 'i' -- how much to indent ! 'text=None' -- text to indent ! 'indentfirstline=mudlib.constants.TRUE' -- whether or not to ! indent the first line returns: *************** *** 350,354 **** arguments: ! 'text' - (string) the text to unescape returns: --- 371,375 ---- arguments: ! 'text' -- (string) the text to unescape returns: *************** *** 379,383 **** arguments: ! 'text' - (string) the text to split returns: --- 400,404 ---- arguments: ! 'text' -- (string) the text to split returns: *************** *** 420,424 **** arguments: ! 'textlist' - (list of strings) the textlist to join together returns: --- 441,445 ---- arguments: ! 'textlist' -- (list of strings) the textlist to join together returns: *************** *** 437,441 **** arguments: ! 'text' - (string) the string in question returns: --- 458,462 ---- arguments: ! 'text' -- (string) the string in question returns: *************** *** 468,476 **** arguments: ! 'text' - (string) the text in question ! 'index' - (int) the place to stick the cr ! 'indent=0' - (int) how much to indent the next line returns: --- 489,497 ---- arguments: ! 'text' -- (string) the text in question ! 'index' -- (int) the place to stick the cr ! 'indent=0' -- (int) how much to indent the next line returns: *************** *** 494,505 **** arguments: ! 'textlist' - either a string of text needing to be formatted and ! wrapped or a textlist--preferably the former. ! 'ansicolor' - whether to do ansicolor or not. ! 'wraplength' - what the length to wrap is. ! 'replace_dict' - the dict of name tags -> colors. returns: --- 515,528 ---- arguments: ! 'textlist' -- (string) or (list of strings) either a string of ! text needing to be formatted and ! wrapped or a textlist--preferably the former. ! 'ansicolor' -- (int) 1 says we support ansicolor, 0 says we ! take it all out ! 'wraplength' -- (int) how many characters to wrap at ! 'replace_dict' -- (hash) the dict of name tags -> colors returns: *************** *** 668,673 **** arguments: ! 'text' - (string) the text to frame. can have cr's in it ! if you like. returns: --- 691,696 ---- arguments: ! 'text' -- (string) the text to frame. can have cr's in it ! if you like. returns: *************** *** 707,712 **** arguments: ! 'text' - (string) the text to frame. can have cr's in it ! if you like. returns: --- 730,735 ---- arguments: ! 'text' -- (string) the text to frame. can have cr's in it ! if you like. returns: *************** *** 748,760 **** arguments: ! 'textlist' - (list) list of strings to columnize ! 'screenwidth=72' - (int) the width of the screen to ! columnize to ! 'indent=0' - (int) the number of spaces to indent lines ! 'sort=0' - (0 or 1) whether or not to sort the list before ! columnizing returns: --- 771,783 ---- arguments: ! 'textlist' -- (list) list of strings to columnize ! 'screenwidth=72' -- (int) the width of the screen to ! columnize to ! 'indent=0' -- (int) the number of spaces to indent lines ! 'sort=0' -- (0 or 1) whether or not to sort the list before ! columnizing returns: *************** *** 810,814 **** arguments: ! 'text' - (string) the text with tabs and such to columnize returns: --- 833,837 ---- arguments: ! 'text' -- (string) the text with tabs and such to columnize returns: Index: heap.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/heap.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** heap.py 2001/10/20 04:03:18 1.9 --- heap.py 2002/01/20 02:32:53 1.10 *************** *** 16,19 **** --- 16,21 ---- Heap allows you to have many of one kind of object without retaining a seperate copy in memory for each one. + + This module suffers from a lack of documentation. """ import core Index: language.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/language.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** language.py 2002/01/08 06:28:07 1.12 --- language.py 2002/01/20 02:32:53 1.13 *************** *** 119,123 **** cardinal. A cardinal is a text string like 'forty-five'. ! Returns 1 if cardinal and 0 if not. """ --- 119,130 ---- cardinal. A cardinal is a text string like 'forty-five'. ! arguments: ! ! 'text' -- (string) the text to test cardinality on ! ! returns: ! ! (int) 1 if cardinal, 0 if not ! """ *************** *** 144,149 **** any number in the text is ordinal, we say the whole thing is, as long as each token is a number string. ! Returns 1 if ordinal and 0 if not. """ --- 151,163 ---- any number in the text is ordinal, we say the whole thing is, as long as each token is a number string. + + arguments: + + 'text' -- (string) the text to test ordinality on ! returns: ! ! (int) 1 if ordinal, 0 if not ! """ *************** *** 168,173 **** def isNumber(text): """ ! Returns 1 if a number (either cardinal or ordinal) and ! 0 if not. """ if isCardinal(text) or isOrdinal(text): --- 182,195 ---- def isNumber(text): """ ! Tests whether this text is either a cardinal or ordinal number. ! ! arguments: ! ! 'text' -- (string) the text to test ! ! returns: ! ! (int) 1 if it's a number, 0 if not ! """ if isCardinal(text) or isOrdinal(text): *************** *** 198,201 **** --- 220,232 ---- the work in progress. When it's safe, we add the working quantity to the total. + + arguments: + + 'text' -- (string) the text to convert + + returns: + + (int) + """ *************** *** 241,244 **** --- 272,284 ---- """ Converts an int to a cardinal. + + arguments: + + 'value' -- (int) the int to convert to a cardinal + + returns: + + (string) the cardinal text + """ workingValue = value *************** *** 270,274 **** def isArticle(text): """ ! Returns whether the text is an article ('a', 'an', 'the', or 'some'). """ return (text == "a" or --- 310,323 ---- def isArticle(text): """ ! Tests whether the text is an article ('a', 'an', 'the', or 'some'). ! ! arguments: ! ! 'text' -- (string) the item to test article-ity ! ! returns: ! ! (int) 1 if it is an article, 0 if not ! """ return (text == "a" or *************** *** 289,292 **** --- 338,350 ---- 'a', not 'an'. Likewise, the abbreviation RCI should be preceeded with 'an', not 'a'. + + arguments: + + 'text' -- (string) the text to add the article to + + returns: + + (string) text with the article + """ tokens = formatter.split_formatting_from_text(text) *************** *** 312,315 **** --- 370,382 ---- If the token is 'you', it returns 'of you'. If the token anything else, returns 'some <text>'. + + arguments: + + 'text' -- (string) the text to add the plural indefinite article to + + returns: + + (string) the text with the plural indefinite article + """ tokens = formatter.split_formatting_from_text(text) *************** *** 337,340 **** --- 404,418 ---- front of a heap of something. some coins, a heap of cards, an army of men.... + + arguments: + + 'text' -- (string) ??? + + 'tuple' -- (??) + + returns: + + ?? + """ if isArticle(string.split(text, None, 1)[0]): *************** *** 365,368 **** --- 443,455 ---- """ Adds a definite article to the text. 'yourself' or 'the'. + + arguments: + + 'text' -- (string) + + returns: + + (string) definite article + text + """ tokens = formatter.split_formatting_from_text(text) *************** *** 389,392 **** --- 476,488 ---- nouns. This implementation capitalizes the first letter, but leaves the rest of the string unchanged. + + arguments: + + 'text' -- (string) the text to capitalize + + returns: + + (string) capitalized text + """ if not text: *************** *** 472,475 **** --- 568,580 ---- the text. This doesn't handle words like moose -> meese, or words where the plural is the same as the singular. + + arguments: + + 'text' -- (string) the text to pluralize + + returns: + + (string) the pluralized text + """ if not text: *************** *** 493,496 **** --- 598,610 ---- Returns the appropriate posessive for this living based on the gender ('his', 'her', or 'its'). + + arguments: + + 'living' -- (mudlib.living.Living) object in question + + returns: + + (string) "his" or "her" or "its" or "your" + """ if living and living.getProperty(stdprops.IS_LIVING): *************** *** 508,511 **** --- 622,634 ---- Returns the appropriate pronoun for this living based on the gender ('you', 'he', 'she', or 'it'). + + arguments: + + 'living' -- (mudlib.living.Living) the object in question + + returns: + + (string) "you" or "he" or "she" or "it" + """ if living and living.getProperty(stdprops.IS_LIVING): *************** *** 523,526 **** --- 646,658 ---- on the gender, along with a suitable linking verb ('you are', 'he is', 'she is', or 'it is'). + + arguments: + + 'living' -- (mudlib.living.Living) object in question + + returns: + + (string) "you are" or "he is" or "she is" or "it is" + """ if living and living.getProperty(stdprops.IS_LIVING): *************** *** 538,541 **** --- 670,682 ---- Returns the appropriate reflexive pronoun based on the gender ('himself', 'herself', or 'itself'). + + arguments: + + 'living' -- (mudlib.living.Living) object in question + + returns: + + (string) "himself" or "herself" or "itself" + """ if living and living.getProperty(stdprops.IS_LIVING): *************** *** 551,554 **** --- 692,704 ---- Returns the appropriate personal pronoun based on the gender ('him', 'her' or 'it'). + + arguments: + + 'living' -- (mudlib.living.Living) object in question + + returns: + + (string) "him" or "her" or "it" + """ if living and living.getProperty(stdprops.IS_LIVING): *************** *** 565,568 **** --- 715,726 ---- eg, "male" for males and "female" for females. + arguments: + + 'living' -- (mudlib.living.Living) object in question + + returns: + + (string) "male" or "female" or "neuter" + """ gender = living.getGender() *************** *** 580,583 **** --- 738,750 ---- We figure this out by whether the adverb is in our massive list of adverbs. + + arguments: + + 'text' -- (string) text to test adverb-hood + + returns: + + (int) 1 if adverb, 0 if not + """ Index: mpico.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/mpico.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** mpico.py 2001/12/23 22:29:03 1.36 --- mpico.py 2002/01/20 02:32:53 1.37 *************** *** 97,103 **** def initialize(self, filename="", text=""): ! """ ! Initializes the processors, sets us into CxC mode, and loads the file (if any). Then it draws the screen. """ who = Driver.getActiveUser() --- 97,109 ---- def initialize(self, filename="", text=""): ! """ Initializes the processors, sets us into CxC mode, and loads the file (if any). Then it draws the screen. + + Parameters + + filename -- (string) the name of the file being edited + + text -- (string) the initial text in the editing buffer + """ who = Driver.getActiveUser() Index: nomacs.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/nomacs.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** nomacs.py 2001/12/22 07:31:56 1.11 --- nomacs.py 2002/01/20 02:32:53 1.12 *************** *** 26,29 **** --- 26,32 ---- - check for binary files on load - calls to ctrl + + + This module suffers from a pretty lack of documentation. """ Index: possessed.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/possessed.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** possessed.py 2001/10/29 01:03:12 1.5 --- possessed.py 2002/01/20 02:32:53 1.6 *************** *** 14,17 **** --- 14,21 ---- ##################################################################### + """ + This module suffers from a pretty lack of documentation. + """ + from org.bluesock.bluemud.driver import Driver import stdprops Index: race.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/race.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** race.py 2001/10/20 04:03:18 1.4 --- race.py 2002/01/20 02:32:53 1.5 *************** *** 14,17 **** --- 14,21 ---- ##################################################################### + """ + This module suffers from a pretty lack of documentation. + """ + import living import constants Index: trade.py =================================================================== RCS file: /cvsroot/bluemud/bluemud/code/mudlib/trade.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** trade.py 2001/10/29 01:03:12 1.6 --- trade.py 2002/01/20 02:32:53 1.7 *************** *** 14,17 **** --- 14,21 ---- ##################################################################### + """ + This module suffers from a pretty lack of documentation. + """ + import core import stdprops |