def increment_filename(self, basename):
i = <NUM_LIT:0><EOL>while True:<EOL><INDENT>name = u'<STR_LIT>' % (basename,i)<EOL>path = self.get_path_by_name(name)<EOL>if not os.path.isfile(path):<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>i = i+<NUM_LIT:1><EOL><DEDENT><DEDENT>return path, name<EOL>
Return a non-used filename of the form basename<int>.

        This searches through the filenames (basename0, basename1, ...)
        until is find one that is not already being used. It is used to
        create Untitled and Copy names that are unique.