]> mj.ucw.cz Git - moe.git/blobdiff - submit/MO/Submit.pm
Parts of local history.
[moe.git] / submit / MO / Submit.pm
index 15e6d7c3584030291c0123b4d23045ac13a9ee64..a375058cc07176f2eea79bacf2b245fbf1931c55 100644 (file)
@@ -9,6 +9,7 @@ use warnings;
 use IO::Socket::INET;
 use IO::Socket::SSL; # qw(debug3);
 use Sherlock::Object;
+use POSIX;
 
 sub new($) {
        my $user = $ENV{"USER"} or die "Environment variable USER not set\n";
@@ -18,10 +19,12 @@ sub new($) {
        my $self = {
                "Contest" => "CPSPC 2007",
                "Server" => "localhost:8888",
-               "Key" => "$mo/key.pem",
+               "Key" => "$mo/key.pem",         # Keys and certificates
                "Cert" => "$mo/cert.pem",
                "CACert" => "$mo/ca-cert.pem",
                "Trace" => defined $ENV{"MO_SUBMIT_TRACE"},
+               "History" => "$home/.history";  # Keep submission history in this directory
+               "RefreshTimer" => 5000,         # How often GUI sends STATUS commands [ms]
                "user" => $user,
                "sk" => undef,
                "error" => undef,
@@ -159,4 +162,11 @@ sub send_file($$$) {
        return $self->reply;
 }
 
+sub local_submit($$$$$) {
+       my ($self, $task, $part, $ext, $filename) = @_;
+       my $hist = $self->{"History"};
+       -d $hist or mkdir $hist or return "Unable to create $hist: $!";
+       ### FIXME: Unfinished
+}
+
 1;