3434
3535STATES = [
3636 "START" ,
37- "START_BOUNDARY" , "HEADER_FEILD_START " , "HEADER_FIELD" , "HEADER_VALUE_START" , "HEADER_VALUE" ,
37+ "START_BOUNDARY" , "HEADER_FIELD_START " , "HEADER_FIELD" , "HEADER_VALUE_START" , "HEADER_VALUE" ,
3838 "HEADER_VALUE_ALMOST_DONE" , "HEADRES_ALMOST_DONE" , "PART_DATA_START" , "PART_DATA" , "PART_DATA_END" , "END"
3939]
4040
@@ -789,9 +789,9 @@ def _internal_write(self, data, length):
789789 # Depending on our state...
790790 if state == STATE_BEFORE_FIELD :
791791 # If the 'found_sep' flag is set, we've already encountered
792- # and skipped a single seperator . If so, we check our strict
792+ # and skipped a single separator . If so, we check our strict
793793 # parsing flag and decide what to do. Otherwise, we haven't
794- # yet reached a seperator , and thus, if we do, we need to skip
794+ # yet reached a separator , and thus, if we do, we need to skip
795795 # it as it will be the boundary between fields that's supposed
796796 # to be there.
797797 if ch == AMPERSAND or ch == SEMICOLON :
@@ -809,7 +809,7 @@ def _internal_write(self, data, length):
809809 "semicolon at %d" , i )
810810 else :
811811 # This case is when we're skipping the (first)
812- # seperator between fields, so we just set our flag
812+ # separator between fields, so we just set our flag
813813 # and continue on.
814814 found_sep = True
815815 else :
@@ -822,14 +822,14 @@ def _internal_write(self, data, length):
822822 found_sep = False
823823
824824 elif state == STATE_FIELD_NAME :
825- # Try and find a seperator - we ensure that, if we do, we only
825+ # Try and find a separator - we ensure that, if we do, we only
826826 # look for the equal sign before it.
827827 sep_pos = data .find (b'&' , i )
828828 if sep_pos == - 1 :
829829 sep_pos = data .find (b';' , i )
830830
831831 # See if we can find an equals sign in the remaining data. If
832- # so, we can immedately emit the field name and jump to the
832+ # so, we can immediately emit the field name and jump to the
833833 # data state.
834834 if sep_pos != - 1 :
835835 equals_pos = data .find (b'=' , i , sep_pos )
@@ -849,7 +849,7 @@ def _internal_write(self, data, length):
849849 # No equals sign found.
850850 if not strict_parsing :
851851 # See also comments in the STATE_FIELD_DATA case below.
852- # If we found the seperator , we emit the name and just
852+ # If we found the separator , we emit the name and just
853853 # end - there's no data callback at all (not even with
854854 # a blank value).
855855 if sep_pos != - 1 :
@@ -859,13 +859,13 @@ def _internal_write(self, data, length):
859859 i = sep_pos - 1
860860 state = STATE_BEFORE_FIELD
861861 else :
862- # Otherwise, no seperator in this block, so the
862+ # Otherwise, no separator in this block, so the
863863 # rest of this chunk must be a name.
864864 self .callback ('field_name' , data , i , length )
865865 i = length
866866
867867 else :
868- # We're parsing strictly. If we find a seperator ,
868+ # We're parsing strictly. If we find a separator ,
869869 # this is an error - we require an equals sign.
870870 if sep_pos != - 1 :
871871 e = QuerystringParseError (
@@ -877,7 +877,7 @@ def _internal_write(self, data, length):
877877 e .offset = i
878878 raise e
879879
880- # No seperator in the rest of this chunk, so it's just
880+ # No separator in the rest of this chunk, so it's just
881881 # a field name.
882882 self .callback ('field_name' , data , i , length )
883883 i = length
@@ -895,7 +895,7 @@ def _internal_write(self, data, length):
895895 self .callback ('field_data' , data , i , sep_pos )
896896 self .callback ('field_end' )
897897
898- # Note that we go to the seperator , which brings us to the
898+ # Note that we go to the separator , which brings us to the
899899 # "before field" state. This allows us to properly emit
900900 # "field_start" events only when we actually have data for
901901 # a field of some sort.
@@ -1006,7 +1006,7 @@ def __init__(self, boundary, callbacks={}, max_size=float('inf')):
10061006 self .max_size = max_size
10071007 self ._current_size = 0
10081008
1009- # Setup marks. These are used to track the state of data recieved .
1009+ # Setup marks. These are used to track the state of data received .
10101010 self .marks = {}
10111011
10121012 # TODO: Actually use this rather than the dumb version we currently use
@@ -1500,7 +1500,7 @@ class FormParser:
15001500 :class:`File`, but you can provide your own class if you
15011501 wish to customize behaviour. The class will be
15021502 instantiated as FileClass(file_name, field_name), and it
1503- must provide the folllowing functions::
1503+ must provide the following functions::
15041504 file_instance.write(data)
15051505 file_instance.finalize()
15061506 file_instance.close()
@@ -1509,7 +1509,7 @@ class FormParser:
15091509 :class:`Field`, but you can provide your own class if
15101510 you wish to customize behaviour. The class will be
15111511 instantiated as FieldClass(field_name), and it must
1512- provide the folllowing functions::
1512+ provide the following functions::
15131513 field_instance.write(data)
15141514 field_instance.finalize()
15151515 field_instance.close()
0 commit comments