#NEWLINE# def increment( self , minor = False , major = False ) : #NEWLINE# #INDENT# 'Return an incremented SemanticVersion.\n\n        The default behaviour is to perform a patch level increment. When\n        incrementing a prerelease version, the patch level is not changed\n        - the prerelease serial is changed (e.g. beta 0 -> beta 1).\n\n        Incrementing non-pre-release versions will not introduce pre-release\n        versions - except when doing a patch incremental to a pre-release\n        version the new version will only consist of major/minor/patch.\n\n        :param minor: Increment the minor version.\n        :param major: Increment the major version.\n        :return: A new SemanticVersion object.\n        ' #NEWLINE# if self . _prerelease_type : #NEWLINE# #INDENT# new_prerelease_type = self . _prerelease_type #NEWLINE# new_prerelease = ( self . _prerelease + 1 ) #NEWLINE# new_patch = self . _patch #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# new_prerelease_type = None #NEWLINE# new_prerelease = None #NEWLINE# new_patch = ( self . _patch + 1 ) #NEWLINE# #UNINDENT# if minor : #NEWLINE# #INDENT# new_minor = ( self . _minor + 1 ) #NEWLINE# new_patch = 0 #NEWLINE# new_prerelease_type = None #NEWLINE# new_prerelease = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# new_minor = self . _minor #NEWLINE# #UNINDENT# if major : #NEWLINE# #INDENT# new_major = ( self . _major + 1 ) #NEWLINE# new_minor = 0 #NEWLINE# new_patch = 0 #NEWLINE# new_prerelease_type = None #NEWLINE# new_prerelease = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# new_major = self . _major #NEWLINE# #UNINDENT# return SemanticVersion ( new_major , new_minor , new_patch , new_prerelease_type , new_prerelease )