~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: Matt Giuca
  • Date: 2010-07-28 05:38:15 UTC
  • Revision ID: matt.giuca@gmail.com-20100728053815-6zel7yx96o0n4275
database.ProjectSubmission.get_svn_export_command now appends the file extension of the submission onto the output path, so if a student submits a file (not a directory), e.g., test.html, it will check out as 'studenta.html', not 'studenta' (so it has its correct file extension). (LP: #608040)

Show diffs side-by-side

added added

removed removed

Lines of Context:
928
928
    def get_svn_export_command(self, req):
929
929
        """Returns a Unix shell command to export a submission"""
930
930
        svn_url = self.get_svn_url(req.config)
 
931
        _, ext = os.path.splitext(svn_url)
931
932
        username = (req.user.login if req.user.login.isalnum() else
932
933
                "'%s'"%req.user.login)
933
 
        export_dir = self.assessed.principal.short_name
 
934
        # Export to a file or directory relative to the current directory,
 
935
        # with the student's login name, appended with the submitted file's
 
936
        # extension, if any
 
937
        export_path = self.assessed.principal.short_name + ext
934
938
        return "svn export --username %s -r%d '%s' %s"%(req.user.login,
935
 
                self.revision, svn_url, export_dir)
 
939
                self.revision, svn_url, export_path)
936
940
 
937
941
    @staticmethod
938
942
    def test_and_normalise_path(path):