From c1d7918c2790c50ee926e38978ffa6a68e1a101e Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sat, 8 Apr 2017 19:13:59 +0300 Subject: [PATCH] Fix some typos as reported by codespell. Thanks to Jan for inspiring this. --- docs/README.SOURCE | 2 +- html-src/rules/flowerclock.html | 2 +- html-src/rules/greatwall.html | 2 +- html-src/rules/hanafudafourseasons.html | 2 +- html-src/rules/matsukiri.html | 2 +- html-src/rules/oonsoo.html | 6 +++--- html-src/rules/oonsootimestwo.html | 4 ++-- html-src/wikipedia/perseverance.html | 2 +- pysollib/configobj/configobj.py | 6 +++--- pysollib/configobj/validate.py | 2 +- pysollib/game.py | 2 +- pysollib/macosx/appSupport.py | 2 +- pysollib/move.py | 2 +- pysollib/pysolgtk/selectgame.py | 2 +- pysollib/resource.py | 2 +- pysollib/stack.py | 10 +++++----- pysollib/stats.py | 10 +++++----- pysollib/tile/selectgame.py | 2 +- pysollib/tile/ttk.py | 4 ++-- pysollib/tk/selectgame.py | 2 +- tests/board_gen/ms_deals1.py | 2 +- 21 files changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/README.SOURCE b/docs/README.SOURCE index 4d613d93..6dcf410a 100644 --- a/docs/README.SOURCE +++ b/docs/README.SOURCE @@ -122,7 +122,7 @@ The toolkit layer ship with every Python installation, but a very experimental version for Gnome (using the pygnome and pygtk bindings) exists as well. - A more exicting idea is to use JPython to make PySol run under a + A more exciting idea is to use JPython to make PySol run under a Java VM using Swing as the toolkit. Because Tkinter is the "main" interface other toolkit layers have diff --git a/html-src/rules/flowerclock.html b/html-src/rules/flowerclock.html index 9464ec22..c6f698bd 100644 --- a/html-src/rules/flowerclock.html +++ b/html-src/rules/flowerclock.html @@ -19,7 +19,7 @@ more than eight cards in a row.

The cards in the tableau build from first rank to fourth, without regard -to suit. The third and fourth rank cards are interchangable. Any card +to suit. The third and fourth rank cards are interchangeable. Any card can be played on the canvas.

diff --git a/html-src/rules/greatwall.html b/html-src/rules/greatwall.html index 54129af3..7a3ec2eb 100644 --- a/html-src/rules/greatwall.html +++ b/html-src/rules/greatwall.html @@ -11,7 +11,7 @@ Move all cards to the foundations. Cards can be played on the tableau by suits or by rank. Plum 1 plays on Pine 1, Maple 3 on Mum 3, Pine 2 on Phoenix 2, etc. Any second rank card can be played on -any first. The third and fourth ranks are interchangable +any first. The third and fourth ranks are interchangeable for all suits. Only first rank cards can be played on the canvas. There can be no more than 26 cards in a row.

diff --git a/html-src/rules/hanafudafourseasons.html b/html-src/rules/hanafudafourseasons.html index 832d7687..2d255b36 100644 --- a/html-src/rules/hanafudafourseasons.html +++ b/html-src/rules/hanafudafourseasons.html @@ -8,7 +8,7 @@ Arrange all the cards on the rows. This is a Fan type game adapted to the Hanafuda cards. The tableau consists of twelve rows. Any stack may be moved, but only a first rank card -will play on an empty row. The trash cards are not interchangable, +will play on an empty row. The trash cards are not interchangeable, and no more than eight cards can be played on a row. The game is won when all twelve suits are arranged in order in their respective places on the tableau. diff --git a/html-src/rules/matsukiri.html b/html-src/rules/matsukiri.html index 05385bad..d0226e7b 100644 --- a/html-src/rules/matsukiri.html +++ b/html-src/rules/matsukiri.html @@ -10,7 +10,7 @@ Move all cards to the foundation.

The cards can only be moved to the foundation as entire suits, in order. As in Oonsoo, -the third and fourth rank cards are interchangable +the third and fourth rank cards are interchangeable for all suits except Rain. Only first rank cards can play on the canvas. First build the suits on the tableau. Then pick up all four cards at once and drop them on the foundation. The foundation will only accept diff --git a/html-src/rules/oonsoo.html b/html-src/rules/oonsoo.html index fd2a6a65..c4213a5a 100644 --- a/html-src/rules/oonsoo.html +++ b/html-src/rules/oonsoo.html @@ -10,9 +10,9 @@ Arrange all twelve suits in order.

When the hand is dealt there are two rows of six cards face down with six more face up on top. You can play a card on another card if it's -in the same suit and in decending rank order. The third and fourth -rank cards are interchangable for all suits except Rain. Plum 4 on -Plum 3 is ok. Plum 3 on Plum 4 is ok. Gaji can only be played on +in the same suit and in descending rank order. The third and fourth +rank cards are interchangeable for all suits except Rain. Plum 4 on +Plum 3 is OK. Plum 3 on Plum 4 is OK. Gaji can only be played on Rain 3.

Strategy

diff --git a/html-src/rules/oonsootimestwo.html b/html-src/rules/oonsootimestwo.html index 95d15558..3a7371a4 100644 --- a/html-src/rules/oonsootimestwo.html +++ b/html-src/rules/oonsootimestwo.html @@ -10,8 +10,8 @@ Arrange all twelve suits in order.

When the hand is dealt there are two rows of six cards face down with six more face up on top. You can play a card on another card if it's -in the same suit and in decending rank order. The third and fourth -rank cards are interchangable for all suits except Rain. Plum 4 on +in the same suit and in descending rank order. The third and fourth +rank cards are interchangeable for all suits except Rain. Plum 4 on Plum 3 is ok. Plum 3 on Plum 4 is ok. Gaji can only be played on Rain 3. diff --git a/html-src/wikipedia/perseverance.html b/html-src/wikipedia/perseverance.html index 1718de54..299c7e4a 100644 --- a/html-src/wikipedia/perseverance.html +++ b/html-src/wikipedia/perseverance.html @@ -22,7 +22,7 @@ sequence of cards as a unit to another pile with an appropriate card (e.g.

When all possible moves are made (or the player has done all the possible moves one can make), the piles are picked up in reverse order. For example, -the twelth pile is placed over the eleventh pile, and this new pile is placed +the twelfth pile is placed over the eleventh pile, and this new pile is placed on the tenth pile, and so on. Then, without shuffling, the cards are dealt to as many piles of four as the remaining decks will allow. To ensure that the order of the cards is not disturbed for the most part, it is suggested that diff --git a/pysollib/configobj/configobj.py b/pysollib/configobj/configobj.py index 1036e0d7..e5bc096d 100644 --- a/pysollib/configobj/configobj.py +++ b/pysollib/configobj/configobj.py @@ -261,7 +261,7 @@ class DuplicateError(ConfigObjError): class ConfigspecError(ConfigObjError): """ - An error occured whilst parsing a configspec. + An error occurred whilst parsing a configspec. """ class InterpolationError(ConfigObjError): @@ -791,7 +791,7 @@ class Section(dict): unless ``raise_errors=False``, in which case set the return value to ``False``. - Any unrecognised keyword arguments you pass to walk, will be pased on + Any unrecognised keyword arguments you pass to walk, will be passed on to the function you pass in. Note: if ``call_on_sections`` is ``True`` then - on encountering a @@ -1600,7 +1600,7 @@ class ConfigObj(Section): Handle an error according to the error settings. Either raise the error or store it. - The error will have occured at ``cur_index`` + The error will have occurred at ``cur_index`` """ line = infile[cur_index] cur_index += 1 diff --git a/pysollib/configobj/validate.py b/pysollib/configobj/validate.py index cb403543..1509c609 100644 --- a/pysollib/configobj/validate.py +++ b/pysollib/configobj/validate.py @@ -863,7 +863,7 @@ def is_boolean(value): except KeyError: raise VdtTypeError(value) # we do an equality test rather than an identity test - # this ensures Python 2.2 compatibilty + # this ensures Python 2.2 compatibility # and allows 0 and 1 to represent True and False if value == False: return False diff --git a/pysollib/game.py b/pysollib/game.py index 71b696a4..91d45655 100644 --- a/pysollib/game.py +++ b/pysollib/game.py @@ -1980,7 +1980,7 @@ Congratulations, you did it ! to_stack, ncards = s.canDropCards(self.s.foundations) if to_stack: # each single drop is undo-able (note that this call - # is before the acutal move) + # is before the actual move) self.finishMove() if sound: self.playSample("autodrop", priority=30) diff --git a/pysollib/macosx/appSupport.py b/pysollib/macosx/appSupport.py index 0e157a8d..936e0b32 100644 --- a/pysollib/macosx/appSupport.py +++ b/pysollib/macosx/appSupport.py @@ -28,7 +28,7 @@ import sys from Tkinter import Menu, Text, TclError def runningAsOSXApp(): - """ Returns True iff running from the PySol.app bundle on OSX """ + """ Returns True if-and-only-if running from the PySol.app bundle on OSX """ return (sys.platform == 'darwin' and 'PySol.app' in sys.argv[0]) def hideTkConsole(root): diff --git a/pysollib/move.py b/pysollib/move.py index 08b3cfb4..39016292 100644 --- a/pysollib/move.py +++ b/pysollib/move.py @@ -48,7 +48,7 @@ class AtomicMove: def __str__(self): return str(self.__dict__) - # Custom comparision for detecting redo moves. See Game.finishMove(). + # Custom comparison for detecting redo moves. See Game.finishMove(). def cmpForRedo(self, other): return -1 diff --git a/pysollib/pysolgtk/selectgame.py b/pysollib/pysolgtk/selectgame.py index 5539d757..69448cd3 100644 --- a/pysollib/pysolgtk/selectgame.py +++ b/pysollib/pysolgtk/selectgame.py @@ -409,7 +409,7 @@ class SelectGameDialogWithPreview(MfxDialog): self.preview_app.opt.shadow = 0 self.preview_app.opt.shade = 0 # - self.preview_app.audio = None # turn off audio for intial dealing + self.preview_app.audio = None # turn off audio for initial dealing if animations >= 0: self.preview_app.opt.animations = animations # diff --git a/pysollib/resource.py b/pysollib/resource.py index 5eda1ae2..922c63d2 100644 --- a/pysollib/resource.py +++ b/pysollib/resource.py @@ -340,7 +340,7 @@ class Cardset(Resource): nbottoms = 7, nletters = 4, nshadows = 1 + 13, - # selection criterias + # selection criteria si = si, # implicit backname = None, diff --git a/pysollib/stack.py b/pysollib/stack.py index 7238e0f3..57f93cf1 100644 --- a/pysollib/stack.py +++ b/pysollib/stack.py @@ -454,16 +454,16 @@ class Stack: self.closeStack() return card - def insertCard(self, card, positon, unhide=1, update=1): + def insertCard(self, card, position, unhide=1, update=1): model, view = self, self - model.cards.insert(positon, card) - for c in model.cards[positon:]: + model.cards.insert(position, card) + for c in model.cards[position:]: c.tkraise(unhide=unhide) - if view.can_hide_cards and len(model.cards) >= 3 and len(model.cards)-positon <= 2: + if view.can_hide_cards and len(model.cards) >= 3 and len(model.cards)-position <= 2: # we only need to display the 2 top cards model.cards[-3].hide(self) card.item.addtag(view.group) - for c in model.cards[positon:]: + for c in model.cards[position:]: view._position(c) if update: view.updateText() diff --git a/pysollib/stats.py b/pysollib/stats.py index 45e5bd84..023bb86a 100644 --- a/pysollib/stats.py +++ b/pysollib/stats.py @@ -60,13 +60,13 @@ class PysolStatsFormatter: } sort_func = sort_functions[sort_by] g = sort_func(player=player) - twon, tlost, tgames, ttime, tmoves = 0, 0, 0, 0, 0 + t_won, tlost, tgames, ttime, tmoves = 0, 0, 0, 0, 0 for id in g: won, lost, time, moves = app.stats.getFullStats(player, id) if won > 0 or lost > 0 or id == app.game.id: # yield only played games name = app.getGameTitleName(id) - twon, tlost = twon + won, tlost + lost + t_won, tlost = t_won + won, tlost + lost ttime, tmoves = ttime+time, tmoves+moves if won + lost > 0: perc = "%.1f" % (100.0 * won / (won + lost)) @@ -77,7 +77,7 @@ class PysolStatsFormatter: yield [name, won+lost, won, lost, t, m, perc, id] tgames += 1 # summary - won, lost = twon, tlost + won, lost = t_won, tlost if won + lost > 0: if won > 0: time = format_time(ttime/tgames) @@ -111,7 +111,7 @@ class PysolStatsFormatter: return _("Game"), _("Game number"), _("Started at"), _("Status") def getLogResults(self, player, prev_games): - twon, tlost = 0, 0 + t_won, tlost = 0, 0 for pg in prev_games: if not isinstance(pg, tuple): continue @@ -144,7 +144,7 @@ class PysolStatsFormatter: date = time.strftime("%Y-%m-%d %H:%M", time.localtime(pg[3])) if pg[2] >= 0: won = pg[2] > 0 - twon, tlost = twon + won, tlost + (1 - won) + t_won, tlost = t_won + won, tlost + (1 - won) status = "*error*" if -2 <= pg[2] <= 2: status = (_("Loaded"), _("Not won"), _("Lost"), _("Won"), _("Perfect")) [pg[2]+2] diff --git a/pysollib/tile/selectgame.py b/pysollib/tile/selectgame.py index 2dc2a0e6..298e3d7d 100644 --- a/pysollib/tile/selectgame.py +++ b/pysollib/tile/selectgame.py @@ -489,7 +489,7 @@ class SelectGameDialogWithPreview(SelectGameDialog): self.preview_app.opt.shadow = 0 self.preview_app.opt.shade = 0 # - self.preview_app.audio = None # turn off audio for intial dealing + self.preview_app.audio = None # turn off audio for initial dealing if animations >= 0: self.preview_app.opt.animations = animations # diff --git a/pysollib/tile/ttk.py b/pysollib/tile/ttk.py index 2e47f7d8..0ad84837 100644 --- a/pysollib/tile/ttk.py +++ b/pysollib/tile/ttk.py @@ -693,7 +693,7 @@ class Combobox(Entry): textvariable, values, width """ # The "values" option may need special formatting, so leave to - # _format_optdict the responsability to format it + # _format_optdict the responsibility to format it if "values" in kw: kw["values"] = _format_optdict({'v': kw["values"]})[1] @@ -1023,7 +1023,7 @@ class Progressbar(Widget): """Begin autoincrement mode: schedules a recurring timer event that calls method step every interval milliseconds. - interval defaults to 50 milliseconds (20 steps/second) if ommited.""" + interval defaults to 50 milliseconds (20 steps/second) if ommitted.""" self.tk.call(self._w, "start", interval) diff --git a/pysollib/tk/selectgame.py b/pysollib/tk/selectgame.py index e99f81bf..592fcc37 100644 --- a/pysollib/tk/selectgame.py +++ b/pysollib/tk/selectgame.py @@ -490,7 +490,7 @@ class SelectGameDialogWithPreview(SelectGameDialog): self.preview_app.opt.shadow = 0 self.preview_app.opt.shade = 0 # - self.preview_app.audio = None # turn off audio for intial dealing + self.preview_app.audio = None # turn off audio for initial dealing if animations >= 0: self.preview_app.opt.animations = animations # diff --git a/tests/board_gen/ms_deals1.py b/tests/board_gen/ms_deals1.py index 75df0cdd..468e07bd 100644 --- a/tests/board_gen/ms_deals1.py +++ b/tests/board_gen/ms_deals1.py @@ -9,7 +9,7 @@ # # python make_pysol_freecell_board.py [board number] | fc-solve # -# This program is platform independant and will generate the same results +# This program is platform independent and will generate the same results # on all architectures and operating systems. # # Based on the code by Markus Franz Xaver Johannes Oberhumer.