<s> from errno import EROFS <EOL> from functools import wraps <EOL> from fuse import FuseOSError <EOL> from gitfs . events import ( sync_done , syncing , writers , push_successful , <EOL> fetch_successful ) <EOL> from gitfs . log import log <EOL> def write_operation ( f ) : <EOL> @ wraps ( f ) <EOL> def decorated ( * args , ** kwargs ) : <EOL> if not fetch_successful . is_set ( ) or not push_successful . is_set ( ) : <EOL> raise FuseOSError ( EROFS ) <EOL> global writers <EOL> writers += <NUM_LIT:1> <EOL> if syncing . is_set ( ) : <EOL> log . debug ( "<STR_LIT>" ) <EOL> sync_done . wait ( ) <EOL> try : <EOL> result = f ( * args , ** kwargs ) <EOL> finally : <EOL> writers -= <NUM_LIT:1> <EOL> return result <EOL> return decorated </s>
