<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_working_directory(self, dirname):

 """Set current working directory.
 In the workingdirectory and explorer plugins.
 """

        if dirname:
            self.main.workingdirectory.chdir(dirname, refresh_explorer=True,
                                             refresh_console=False)