]> iEval git - gruntmaster-handlers.git/commitdiff
Move FORMAT_EXTENSION here
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 26 Jan 2014 07:13:44 +0000 (09:13 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 26 Jan 2014 07:13:44 +0000 (09:13 +0200)
lib/Gruntmaster/Handlers.pm

index c88f3289e878353438c5f1a64ad6fa327e1059df..f0281f2826f939da53e258a279818821d7e934b0 100644 (file)
@@ -20,7 +20,17 @@ use File::Basename qw/fileparse/;
 use File::Temp qw/tempdir/;
 use File::Copy qw/move/;
 use Gruntmaster::Data qw/contest_start contest_end push_job set_job_inmeta insert_user PUBLISH/;
-use Gruntmaster::Page::Log;
+
+use constant FORMAT_EXTENSION => {
+       C => 'c',
+       CPP => 'cpp',
+       MONO => 'cs',
+       JAVA => 'java',
+       PASCAL => 'pas',
+       PERL => 'pl',
+       PYTHON => 'py',
+       RUBY => 'rb',
+};
 
 sub aputs{
        my ($r, $str) = @_;
@@ -46,14 +56,14 @@ sub submit{
          defined $private ? (private => $private) : (),
          defined $contest ? (contest => $contest, private => 1) : (),
          filesize => length $prog,
-         extension => Gruntmaster::Page::Log::FORMAT_EXTENSION->{$format},
+         extension => FORMAT_EXTENSION->{$format},
   );
 
   set_job_inmeta $job, {
          files => {
                  prog => {
                          format => $format,
-                         name => 'prog.' . Gruntmaster::Page::Log::FORMAT_EXTENSION->{$format},
+                         name => 'prog.' . FORMAT_EXTENSION->{$format},
                          content => $prog,
                  }
          }
This page took 0.025406 seconds and 4 git commands to generate.