def copyto(self,<EOL>new_abspath=None,<EOL>new_dirpath=None,<EOL>new_dirname=None,<EOL>new_basename=None,<EOL>new_fname=None,<EOL>new_ext=None,<EOL>overwrite=False,<EOL>makedirs=False):
self.assert_exists()<EOL>p = self.change(<EOL>new_abspath=new_abspath,<EOL>new_dirpath=new_dirpath,<EOL>new_dirname=new_dirname,<EOL>new_basename=new_basename,<EOL>new_fname=new_fname,<EOL>new_ext=new_ext,<EOL>)<EOL>if p.is_not_exist_or_allow_overwrite(overwrite=overwrite):<EOL><INDENT>if self.abspath != p.abspath:<EOL><INDENT>try:<EOL><INDENT>shutil.copy(self.abspath, p.abspath)<EOL><DEDENT>except IOError as e:<EOL><INDENT>if makedirs:<EOL><INDENT>os.makedirs(p.parent.abspath)<EOL>shutil.copy(self.abspath, p.abspath)<EOL><DEDENT>else:<EOL><INDENT>raise e<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return p<EOL>
Copy this file to other place.