oode 0.1.6 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +18 -60
- data/Rakefile +25 -11
- data/bin/oode +101 -98
- data/lib/oode.rb +18 -5
- data/lib/oode/domain/file.rb +27 -0
- data/lib/oode/domain/user.rb +16 -0
- data/lib/oode/ext/ext.rb +29 -0
- data/lib/oode/net/downloader.rb +8 -0
- data/lib/oode/net/session.rb +44 -0
- data/lib/oode/net/transferer.rb +10 -0
- data/lib/oode/net/uploader.rb +30 -0
- data/lib/oode/print/printer.rb +82 -0
- data/lib/oode/version.rb +1 -1
- data/man/index.txt +1 -0
- data/man/oode.1 +36 -55
- data/man/oode.1.html +127 -111
- data/man/oode.1.ronn +31 -33
- data/test/domain/oodefile_test.rb +59 -0
- data/test/domain/oodeuser_test.rb +20 -0
- data/test/helper.rb +24 -5
- data/test/net/oodedownloader_test.rb +20 -0
- data/test/net/oodesession_test.rb +21 -0
- data/test/net/oodeuploader_test.rb +23 -0
- data/test/print/oodeprinter_test.rb +255 -0
- metadata +37 -27
- data/lib/oode/colour.rb +0 -7
- data/lib/oode/file.rb +0 -28
- data/lib/oode/helper.rb +0 -20
- data/lib/oode/queue.rb +0 -118
- data/test/test_oodefile.rb +0 -8
data/lib/oode/ext/ext.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# This wonderful code taken from http://github.com/michaeldv/awesome_print.
|
2
|
+
class String
|
3
|
+
[:gray, :red, :green, :yellow, :blue, :purple, :cyan, :white].each_with_index do |color, offset|
|
4
|
+
define_method color do "\033[1;#{30+offset}m#{self}\033[0m" end
|
5
|
+
define_method :"#{color}ish" do "\033[0;#{30+offset}m#{self}\033[0m" end
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
# Allow numbers to be formatted with human readable data sizes.
|
10
|
+
class Numeric
|
11
|
+
def to_human
|
12
|
+
units = %w{B KB MB GB TB}
|
13
|
+
e = (Math.log(self)/Math.log(1024)).floor
|
14
|
+
s = "%.3f" % (to_f / 1024**e)
|
15
|
+
s.sub(/\.?0*$/, units[e])
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def error message
|
20
|
+
abort "ERROR: #{message}".red
|
21
|
+
end
|
22
|
+
|
23
|
+
def notify message
|
24
|
+
puts "INFO: #{message}".yellow
|
25
|
+
end
|
26
|
+
|
27
|
+
def warning message
|
28
|
+
puts "WARN: #{message}".purple
|
29
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'net/ssh'
|
2
|
+
|
3
|
+
SSH_ERROR = <<ERROR
|
4
|
+
Something went wrong with your SSH connection. Please file a bug report at:
|
5
|
+
|
6
|
+
http://github.com/xoebus/oode/issues
|
7
|
+
|
8
|
+
with your error message.
|
9
|
+
ERROR
|
10
|
+
|
11
|
+
module Oode
|
12
|
+
class Session
|
13
|
+
SERVER = 'ssh.inf.ed.ac.uk'
|
14
|
+
DEFAULT_HOST = 'student.login'
|
15
|
+
|
16
|
+
attr_reader :user
|
17
|
+
|
18
|
+
def initialize(user, options = {})
|
19
|
+
@user = user
|
20
|
+
@machine = options[:machine] || DEFAULT_HOST
|
21
|
+
|
22
|
+
begin
|
23
|
+
@session = Net::SSH.start(SERVER, user.username, :password => user.password)
|
24
|
+
rescue Net::SSH::AuthenticationFailed
|
25
|
+
error "Your login credentials were incorrect. Please fix this and try again."
|
26
|
+
rescue Net::SSH::Exception
|
27
|
+
error SSH_ERROR
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def connection
|
32
|
+
@session
|
33
|
+
end
|
34
|
+
|
35
|
+
def close
|
36
|
+
@session.close
|
37
|
+
end
|
38
|
+
|
39
|
+
def exec!(command, options = {})
|
40
|
+
host = options[:machine] || @machine
|
41
|
+
@session.exec!("ssh #{host} #{command}").chomp
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Oode
|
2
|
+
class Uploader < Transferer
|
3
|
+
UPLOAD_FOLDER_NAME = ".oode"
|
4
|
+
|
5
|
+
def upload!(file, options = {})
|
6
|
+
create_upload_folder
|
7
|
+
|
8
|
+
destination = options[:destination] || file.remote_path
|
9
|
+
@transfer.upload! file.path, destination
|
10
|
+
end
|
11
|
+
|
12
|
+
def clean!
|
13
|
+
command = "rm -r #{default_upload_path}"
|
14
|
+
@session.exec!(command)
|
15
|
+
end
|
16
|
+
|
17
|
+
def default_upload_path
|
18
|
+
"#{user.home}/#{UPLOAD_FOLDER_NAME}"
|
19
|
+
end
|
20
|
+
|
21
|
+
def create_upload_folder
|
22
|
+
directories = @transfer.dir.entries(user.home)
|
23
|
+
directory_names = directories.map { |d| d.name }
|
24
|
+
|
25
|
+
unless directory_names.include? UPLOAD_FOLDER_NAME
|
26
|
+
@transfer.mkdir! default_upload_path
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
SIZE_WARNING = <<WARNING
|
2
|
+
Your file is pretty big: (%s).
|
3
|
+
It may take a while to print... (don't blame me!)
|
4
|
+
WARNING
|
5
|
+
|
6
|
+
module Oode
|
7
|
+
class Printer
|
8
|
+
OO_FILETYPES = ['doc', 'docx', 'odf', 'rtf']
|
9
|
+
|
10
|
+
SIZE_LIMIT = 5242880 # 5MB
|
11
|
+
JOB_LIMIT = 5
|
12
|
+
|
13
|
+
attr_reader :printer_name
|
14
|
+
attr_reader :session
|
15
|
+
attr_reader :options
|
16
|
+
|
17
|
+
def initialize(name, session, options = {})
|
18
|
+
@printer_name = name
|
19
|
+
@session = session
|
20
|
+
@options = options
|
21
|
+
end
|
22
|
+
|
23
|
+
def print! file
|
24
|
+
check_size file
|
25
|
+
check_working
|
26
|
+
|
27
|
+
command = print_command(file)
|
28
|
+
notify "Printing file: #{command}"
|
29
|
+
session.exec!(command)
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
def print_command file
|
34
|
+
copies = @options[:number] || 1
|
35
|
+
has_layout = @options[:format] || nil
|
36
|
+
|
37
|
+
if OO_FILETYPES.include? file.extension
|
38
|
+
if !has_layout.nil? || copies != 1
|
39
|
+
warning "Cannot print #{file.basename} with formatting arguments..."
|
40
|
+
end
|
41
|
+
|
42
|
+
"soffice -pt #{printer_name} #{file.remote_path}"
|
43
|
+
else
|
44
|
+
args = ""
|
45
|
+
args << "-# #{copies} " if copies > 1
|
46
|
+
|
47
|
+
if @options[:format].eql? :four
|
48
|
+
args << "-Z 4up "
|
49
|
+
elsif @options[:format].eql? :two
|
50
|
+
args << "-Z 2up "
|
51
|
+
end
|
52
|
+
|
53
|
+
"lpr -P #{printer_name} #{args} #{file.remote_path}".squeeze " "
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def check_size file
|
58
|
+
if file.size > SIZE_LIMIT
|
59
|
+
warning SIZE_WARNING % [file.size.to_human]
|
60
|
+
false
|
61
|
+
else
|
62
|
+
true
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def check_working
|
67
|
+
unless @options[:force]
|
68
|
+
command = "lpq -P #{@printer_name}"
|
69
|
+
output = @session.exec!(command)
|
70
|
+
print_jobs = output.split("\n").length - 2
|
71
|
+
|
72
|
+
if (print_jobs > JOB_LIMIT) || !(output =~ /is not ready/).nil?
|
73
|
+
error "#{@printer_name} isn't doing too well at the moment. Try another printer."
|
74
|
+
return false
|
75
|
+
else
|
76
|
+
return true
|
77
|
+
end
|
78
|
+
end
|
79
|
+
true
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
data/lib/oode/version.rb
CHANGED
data/man/index.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
oode(1) oode.1.ronn
|
data/man/oode.1
CHANGED
@@ -1,98 +1,79 @@
|
|
1
|
-
.\" generated with Ronn/v0.
|
2
|
-
.\" http://github.com/rtomayko/ronn/
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "OODE" "1" "
|
4
|
+
.TH "OODE" "1" "April 2011" "Lolsoft" "Oode Manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
|
-
\fBoode\fR
|
7
|
+
\fBoode\fR \- work with DICE from a laptop
|
8
8
|
.
|
9
9
|
.SH "SYNOPSIS"
|
10
|
-
\fBoode\fR [\fIOPTIONS\fR] \fIFILE\fR
|
11
|
-
.
|
12
|
-
.br
|
10
|
+
\fBoode\fR [\fIGLOBAL OPTIONS\fR] \fICOMMAND\fR [\fIOPTIONS\fR] \fIFILE\fR\.\.\.
|
13
11
|
.
|
14
12
|
.SH "DESCRIPTION"
|
15
|
-
\fBoode\fR
|
16
|
-
from laptops by automating some of the tediousness from the sequence
|
17
|
-
of tasks required.
|
13
|
+
\fBoode\fR is a program that simplifies working with the DICE network from a laptop in Appleton Tower\. As of the current version \fBoode\fR is able to print to any of the printers on the DICE network with more functionality in the near future\.
|
18
14
|
.
|
19
15
|
.SH "SAMPLE USAGE"
|
20
16
|
.
|
21
17
|
.TP
|
22
|
-
\fBoode \-
|
23
|
-
|
24
|
-
.
|
25
|
-
.TP
|
26
|
-
\fBoode \-p at13c \-4 \-n 5 file.pdf\fR
|
27
|
-
Print 5 copies of \fBfile.pdf\fR to printer \fBat13c\fR using the 4\-up layout.
|
18
|
+
\fBoode print \-P at3 file\.pdf\fR
|
19
|
+
Print the file \fIfile\.pdf\fR to the printer \fIat3\fR\.
|
28
20
|
.
|
29
21
|
.TP
|
30
|
-
\fBoode \-
|
31
|
-
|
22
|
+
\fBoode print \-P at13c \-2 \-n 3 file\.pdf\fR
|
23
|
+
Print \fI3\fR copies of the file \fIfile\.pdf\fR to the printer \fIat3\fR in the \fItwo\-up\fR page layout\.
|
32
24
|
.
|
33
25
|
.SH "CONFIGURATION"
|
34
|
-
\fBoode\fR can read SSH authentication usernames and passwords from a
|
35
|
-
configuration file so you don't have to type them in every time. A
|
36
|
-
file called \fB.ooderc\fR should be placed in your home directory with
|
37
|
-
the following contents:
|
38
|
-
.
|
39
|
-
.IP "" 4
|
40
|
-
.
|
41
|
-
.nf
|
42
|
-
|
43
|
-
:user: <username>
|
44
|
-
:password: <password>
|
45
|
-
.
|
46
|
-
.fi
|
26
|
+
\fBoode\fR can read SSH authentication usernames and passwords from a configuration file so you don\'t have to type them in every time\.
|
47
27
|
.
|
48
|
-
.
|
28
|
+
.P
|
29
|
+
The following command will create the file \fB~/\.ooderc\fR that contains global options so that you don\'t have to type them each time\.
|
49
30
|
.
|
50
31
|
.P
|
51
|
-
|
52
|
-
each time.
|
32
|
+
\fBoode \-u s0xxxxxx \-p passw0rd initconfig\fR
|
53
33
|
.
|
54
|
-
.
|
55
|
-
|
34
|
+
.P
|
35
|
+
Either of these can be omitted if you would rather enter them yourself each time or you can specify them at the command line like above for individual commands\.
|
56
36
|
.
|
57
|
-
.SS "
|
37
|
+
.SS "GLOBAL OPTIONS"
|
58
38
|
.
|
59
39
|
.TP
|
60
|
-
\fB\-u\fR, \fB\-\-
|
61
|
-
|
40
|
+
\fB\-u\fR, \fB\-\-username\fR=\fIUSERNAME\fR
|
41
|
+
Your DICE username so that \fBoode\fR can authenticate\.
|
62
42
|
.
|
63
43
|
.TP
|
64
|
-
\fB\-
|
65
|
-
|
44
|
+
\fB\-p\fR, \fB\-\-password\fR=\fIPASSWORD\fR
|
45
|
+
Your DICE password so that \fBoode\fR can authenticate\.
|
66
46
|
.
|
67
|
-
.
|
47
|
+
.SH "COMMANDS"
|
48
|
+
The following options and flags can be used with \fBoode\fR:
|
49
|
+
.
|
50
|
+
.SS "Print"
|
68
51
|
.
|
69
52
|
.TP
|
70
|
-
\fB\-
|
71
|
-
|
53
|
+
\fB\-P\fR, \fB\-\-printer\fR=\fIPRINTER\fR
|
54
|
+
Use the printer, \fIPRINTER\fR, to print the \fIFILES\fR\.
|
72
55
|
.
|
73
56
|
.TP
|
74
57
|
\fB\-f\fR, \fB\-\-force\fR
|
75
|
-
|
76
|
-
.
|
77
|
-
.SS "Printing"
|
58
|
+
Force \fBoode\fR to use a certain printer even if it is not desired\.
|
78
59
|
.
|
79
60
|
.TP
|
80
61
|
\fB\-n\fR, \fB\-\-number\fR=\fINUMBER\fR
|
81
|
-
|
62
|
+
Print \fINUMBER\fR copies of the \fIFILES\fR\.
|
82
63
|
.
|
83
64
|
.TP
|
84
|
-
\fB\-2\fR, \fB\-\-two
|
85
|
-
|
65
|
+
\fB\-2\fR, \fB\-\-two\fR
|
66
|
+
Print the files in the 2\-up style\.
|
86
67
|
.
|
87
68
|
.TP
|
88
|
-
\fB\-4\fR, \fB\-\-four
|
89
|
-
|
69
|
+
\fB\-4\fR, \fB\-\-four\fR
|
70
|
+
Print the files in the 4\-up style\.
|
90
71
|
.
|
91
72
|
.SH "BUGS"
|
92
|
-
\fIhttp://github
|
73
|
+
\fIhttp://github\.com/xoebus/oode/issues\fR
|
93
74
|
.
|
94
75
|
.SH "AUTHOR"
|
95
|
-
Chris Brown :: cb@tardis
|
76
|
+
Chris Brown :: cb@tardis\.ed\.ac\.uk :: @xoebus
|
96
77
|
.
|
97
78
|
.SH "SEE ALSO"
|
98
|
-
\fIhttp://github
|
79
|
+
\fIhttp://github\.com\fR, \fIhttp://github\.com/xoebus/oode\fR
|
data/man/oode.1.html
CHANGED
@@ -2,151 +2,167 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
5
|
-
<meta name='generator' value='Ronn/v0.
|
6
|
-
<title>oode(1)
|
7
|
-
<style type='text/css'>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
5
|
+
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
6
|
+
<title>oode(1) - work with DICE from a laptop</title>
|
7
|
+
<style type='text/css' media='all'>
|
8
|
+
/* style: man */
|
9
|
+
body#manpage {margin:0}
|
10
|
+
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
|
11
|
+
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
|
12
|
+
.mp h2 {margin:10px 0 0 0}
|
13
|
+
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
|
14
|
+
.mp h3 {margin:0 0 0 4ex}
|
15
|
+
.mp dt {margin:0;clear:left}
|
16
|
+
.mp dt.flush {float:left;width:8ex}
|
17
|
+
.mp dd {margin:0 0 0 9ex}
|
18
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
|
19
|
+
.mp pre {margin-bottom:20px}
|
20
|
+
.mp pre+h2,.mp pre+h3 {margin-top:22px}
|
21
|
+
.mp h2+pre,.mp h3+pre {margin-top:5px}
|
22
|
+
.mp img {display:block;margin:auto}
|
23
|
+
.mp h1.man-title {display:none}
|
24
|
+
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
|
25
|
+
.mp h2 {font-size:16px;line-height:1.25}
|
26
|
+
.mp h1 {font-size:20px;line-height:2}
|
27
|
+
.mp {text-align:justify;background:#fff}
|
28
|
+
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
|
29
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
|
30
|
+
.mp u {text-decoration:underline}
|
31
|
+
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
|
32
|
+
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
|
33
|
+
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
|
34
|
+
.mp b.man-ref {font-weight:normal;color:#434241}
|
35
|
+
.mp pre {padding:0 4ex}
|
36
|
+
.mp pre code {font-weight:normal;color:#434241}
|
37
|
+
.mp h2+pre,h3+pre {padding-left:0}
|
38
|
+
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
|
39
|
+
ol.man-decor {width:100%}
|
40
|
+
ol.man-decor li.tl {text-align:left}
|
41
|
+
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
|
42
|
+
ol.man-decor li.tr {text-align:right;float:right}
|
43
|
+
</style>
|
44
|
+
<style type='text/css' media='print'>
|
45
|
+
/* style: print */
|
46
|
+
.mp {max-width:none}
|
47
|
+
.man-navigation {display:none !important}
|
48
|
+
.mp a[href]:not([href^="#"]):not([data-bare-link]):after {content:" " attr(href)}
|
49
|
+
</style>
|
50
|
+
<style type='text/css' media='all'>
|
51
|
+
/* style: toc */
|
52
|
+
.man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
|
53
|
+
.man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
|
54
|
+
.man-navigation a:hover {color:#111;text-decoration:underline}
|
52
55
|
</style>
|
53
56
|
</head>
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
<
|
63
|
-
|
64
|
-
|
65
|
-
<
|
66
|
-
<
|
67
|
-
|
68
|
-
<
|
69
|
-
|
70
|
-
<
|
71
|
-
|
72
|
-
<
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
<
|
57
|
+
<!--
|
58
|
+
The following styles are deprecated and will be removed at some point:
|
59
|
+
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
|
60
|
+
|
61
|
+
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
|
62
|
+
.man-navigation should be used instead.
|
63
|
+
-->
|
64
|
+
<body id='manpage'>
|
65
|
+
<div class='mp' id='man'>
|
66
|
+
|
67
|
+
<div class='man-navigation' style='display:none'>
|
68
|
+
<a href="#NAME">NAME</a>
|
69
|
+
<a href="#SYNOPSIS">SYNOPSIS</a>
|
70
|
+
<a href="#DESCRIPTION">DESCRIPTION</a>
|
71
|
+
<a href="#SAMPLE-USAGE">SAMPLE USAGE</a>
|
72
|
+
<a href="#CONFIGURATION">CONFIGURATION</a>
|
73
|
+
<a href="#COMMANDS">COMMANDS</a>
|
74
|
+
<a href="#BUGS">BUGS</a>
|
75
|
+
<a href="#AUTHOR">AUTHOR</a>
|
76
|
+
<a href="#SEE-ALSO">SEE ALSO</a>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<ol class='man-decor man-head man head'>
|
80
|
+
<li class='tl'>oode(1)</li>
|
81
|
+
<li class='tc'>Oode Manual</li>
|
82
|
+
<li class='tr'>oode(1)</li>
|
83
|
+
</ol>
|
84
|
+
|
85
|
+
<h2 id="NAME">NAME</h2>
|
86
|
+
<p class="man-name">
|
87
|
+
<code>oode</code> - <span class="man-whatis">work with DICE from a laptop</span>
|
88
|
+
</p>
|
89
|
+
|
90
|
+
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
91
|
+
|
92
|
+
<p><code>oode</code> [<var>GLOBAL OPTIONS</var>] <var>COMMAND</var> [<var>OPTIONS</var>] <var>FILE</var>...</p>
|
93
|
+
|
94
|
+
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
95
|
+
|
96
|
+
<p><code>oode</code> is a program that simplifies working with the DICE network from
|
97
|
+
a laptop in Appleton Tower. As of the current version <code>oode</code> is able to
|
98
|
+
print to any of the printers on the DICE network with more functionality
|
99
|
+
in the near future.</p>
|
100
|
+
|
101
|
+
<h2 id="SAMPLE-USAGE">SAMPLE USAGE</h2>
|
79
102
|
|
80
103
|
<dl>
|
81
|
-
<dt><code>oode -
|
82
|
-
<dt><code>oode -
|
83
|
-
<
|
104
|
+
<dt><code>oode print -P at3 file.pdf</code></dt><dd><p> Print the file <em>file.pdf</em> to the printer <em>at3</em>.</p></dd>
|
105
|
+
<dt><code>oode print -P at13c -2 -n 3 file.pdf</code></dt><dd><p>Print <em>3</em> copies of the file <em>file.pdf</em> to the printer <em>at3</em> in the
|
106
|
+
<em>two-up</em> page layout.</p></dd>
|
84
107
|
</dl>
|
85
108
|
|
86
109
|
|
87
|
-
<h2>CONFIGURATION</h2>
|
110
|
+
<h2 id="CONFIGURATION">CONFIGURATION</h2>
|
88
111
|
|
89
112
|
<p><code>oode</code> can read SSH authentication usernames and passwords from a
|
90
|
-
configuration file so you don't have to type them in every time
|
91
|
-
file called <code>.ooderc</code> should be placed in your home directory with
|
92
|
-
the following contents:</p>
|
93
|
-
|
94
|
-
<pre><code>:user: <username>
|
95
|
-
:password: <password>
|
96
|
-
</code></pre>
|
113
|
+
configuration file so you don't have to type them in every time.</p>
|
97
114
|
|
98
|
-
<p>
|
99
|
-
each time.</p>
|
115
|
+
<p>The following command will create the file <code>~/.ooderc</code> that contains
|
116
|
+
global options so that you don't have to type them each time.</p>
|
100
117
|
|
101
|
-
<
|
118
|
+
<p> <code>oode -u s0xxxxxx -p passw0rd initconfig</code></p>
|
102
119
|
|
103
|
-
<p>
|
120
|
+
<p>Either of these can be omitted if you would rather enter them yourself
|
121
|
+
each time or you can specify them at the command line like above for
|
122
|
+
individual commands.</p>
|
104
123
|
|
105
|
-
<h3>
|
124
|
+
<h3 id="GLOBAL-OPTIONS">GLOBAL OPTIONS</h3>
|
106
125
|
|
107
126
|
<dl>
|
108
|
-
<dt><code>-u</code>, <code>--
|
109
|
-
<dt><code>-
|
127
|
+
<dt><code>-u</code>, <code>--username</code>=<var>USERNAME</var></dt><dd><p> Your DICE username so that <code>oode</code> can authenticate.</p></dd>
|
128
|
+
<dt><code>-p</code>, <code>--password</code>=<var>PASSWORD</var></dt><dd><p> Your DICE password so that <code>oode</code> can authenticate.</p></dd>
|
110
129
|
</dl>
|
111
130
|
|
112
131
|
|
113
|
-
<
|
114
|
-
|
115
|
-
<dl>
|
116
|
-
<dt><code>-p</code>, <code>--printer</code>=<var>PRINTER</var></dt><dd><p> Use the printer, <var>PRINTER</var>, to print the <var>FILES</var>.</p></dd>
|
117
|
-
<dt><code>-f</code>, <code>--force</code></dt><dd><p> Force <code>oode</code> to use a certain printer even if it is not desired.</p></dd>
|
118
|
-
</dl>
|
132
|
+
<h2 id="COMMANDS">COMMANDS</h2>
|
119
133
|
|
134
|
+
<p>The following options and flags can be used with <code>oode</code>:</p>
|
120
135
|
|
121
|
-
<h3>
|
136
|
+
<h3 id="Print">Print</h3>
|
122
137
|
|
123
138
|
<dl>
|
139
|
+
<dt><code>-P</code>, <code>--printer</code>=<var>PRINTER</var></dt><dd><p> Use the printer, <var>PRINTER</var>, to print the <var>FILES</var>.</p></dd>
|
140
|
+
<dt><code>-f</code>, <code>--force</code></dt><dd><p> Force <code>oode</code> to use a certain printer even if it is not desired.</p></dd>
|
124
141
|
<dt><code>-n</code>, <code>--number</code>=<var>NUMBER</var></dt><dd><p> Print <var>NUMBER</var> copies of the <var>FILES</var>.</p></dd>
|
125
|
-
<dt><code>-2</code>, <code>--two
|
126
|
-
<dt><code>-4</code>, <code>--four
|
142
|
+
<dt><code>-2</code>, <code>--two</code></dt><dd><p> Print the files in the 2-up style.</p></dd>
|
143
|
+
<dt><code>-4</code>, <code>--four</code></dt><dd><p> Print the files in the 4-up style.</p></dd>
|
127
144
|
</dl>
|
128
145
|
|
129
146
|
|
130
|
-
<h2>BUGS</h2>
|
147
|
+
<h2 id="BUGS">BUGS</h2>
|
131
148
|
|
132
|
-
<p><a href="http://github.com/xoebus/oode/issues">http://github.com/xoebus/oode/issues</a></p>
|
149
|
+
<p><a href="http://github.com/xoebus/oode/issues" data-bare-link="true">http://github.com/xoebus/oode/issues</a></p>
|
133
150
|
|
134
|
-
<h2>AUTHOR</h2>
|
151
|
+
<h2 id="AUTHOR">AUTHOR</h2>
|
135
152
|
|
136
153
|
<p>Chris Brown :: cb@tardis.ed.ac.uk :: @xoebus</p>
|
137
154
|
|
138
|
-
<h2>SEE ALSO</h2>
|
155
|
+
<h2 id="SEE-ALSO">SEE ALSO</h2>
|
139
156
|
|
140
|
-
<p><a href="http://github.com">http://github.com</a>,
|
141
|
-
<a href="http://github.com/xoebus/oode">http://github.com/xoebus/oode</a></p>
|
157
|
+
<p><a href="http://github.com" data-bare-link="true">http://github.com</a>, <a href="http://github.com/xoebus/oode" data-bare-link="true">http://github.com/xoebus/oode</a></p>
|
142
158
|
|
143
159
|
|
144
|
-
<ol class='foot man'>
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
</ol>
|
160
|
+
<ol class='man-decor man-foot man foot'>
|
161
|
+
<li class='tl'>Lolsoft</li>
|
162
|
+
<li class='tc'>April 2011</li>
|
163
|
+
<li class='tr'>oode(1)</li>
|
164
|
+
</ol>
|
149
165
|
|
150
|
-
</div>
|
166
|
+
</div>
|
151
167
|
</body>
|
152
168
|
</html>
|