stub a flap frame
This commit is contained in:
		
							
								
								
									
										32
									
								
								src/pyoscar/proto/flap/skel.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								src/pyoscar/proto/flap/skel.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
			
		||||
# Copyright © 2024 Nicole O'Connor
 | 
			
		||||
# 
 | 
			
		||||
# Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
# you may not use this file except in compliance with the License.
 | 
			
		||||
# You may obtain a copy of the License at
 | 
			
		||||
# 
 | 
			
		||||
# 	http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
# 
 | 
			
		||||
# Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
# distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
# See the License for the specific language governing permissions and
 | 
			
		||||
# limitations under the License.
 | 
			
		||||
 | 
			
		||||
FLAP__MARKER            = b"*"
 | 
			
		||||
FLAP__FRAME_SIGNON      = 0x1
 | 
			
		||||
FLAP__FRAME_DATA        = 0x2
 | 
			
		||||
FLAP__FRAME_ERROR       = 0x3
 | 
			
		||||
FLAP__FRAME_SIGNOFF     = 0x4
 | 
			
		||||
FLAP__FRAME_KEEP_ALIVE  = 0x5
 | 
			
		||||
 | 
			
		||||
FLAP__SEQUENCE          = -1
 | 
			
		||||
 | 
			
		||||
class FlapFrame:
 | 
			
		||||
    payload: bytes = None
 | 
			
		||||
 | 
			
		||||
    # str() or bytes() should return the raw frame data
 | 
			
		||||
    def __bytes__(self):
 | 
			
		||||
        return self.payload
 | 
			
		||||
    def __str__(self):
 | 
			
		||||
        return self.payload.decode()
 | 
			
		||||
    
 | 
			
		||||
@@ -147,4 +147,5 @@ BUDDY__REJECT_NOTIFICATION      = 0xA  # sent if a user has too many watchers
 | 
			
		||||
BUDDY__ARRIVED                  = 0xB  # your friend is online
 | 
			
		||||
BUDDY__DEPARTED                 = 0xC  # your friend is offline
 | 
			
		||||
BUDDY__ADD_TEMP_BUDDIES         = 0xF  # temporary buddy list
 | 
			
		||||
BUDDY__DEL_TEMP_BUDDIES         = 0x10
 | 
			
		||||
BUDDY__DEL_TEMP_BUDDIES         = 0x10
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user