def setup(self): """ Prepare the execution of the action. """ # Set default change ownership flag, umask, relay regexps os.umask(0o77) Time.setcurtime(Globals.current_time) SetConnections.UpdateGlobal("client_conn", Globals.local_connection) Globals.postset_regexp('no_compression_regexp', Globals.no_compression_regexp_string) for conn in Globals.connections: conn.robust.install_signal_handlers() conn.Hardlink.initialize_dictionaries() return 0
def setup(self): """ Prepare the execution of the action. Return 0 if everything looked good, else an error code. """ if self.values.tempdir: # At least until Python 3.10, the module tempfile doesn't work # properly, # especially under Windows, if tempdir is stored as bytes. # See https://github.com/python/cpython/pull/20442 tempfile.tempdir = self.values.tempdir # Set default change ownership flag, umask, relay regexps os.umask(0o77) SetConnections.UpdateGlobal("client_conn", Globals.local_connection) Globals.postset_regexp('no_compression_regexp', Globals.no_compression_regexp_string) for conn in Globals.connections: conn.robust.install_signal_handlers() conn.Hardlink.initialize_dictionaries() return 0