formats.
)
-Find sponsors. This project will take a long time, and in its infant
-stages, having a hard and small core which does a lot of work, is more
-efficient than lots of people doing small subprojects. Finanicial
-support would be desirable.
-
--- /dev/null
+c''4 \p c \ff c^\ff
+c \p \< \! c \ff\> c \!c-\p
{
dims.push (y);
Score_element *e =dynamic_cast<Score_element*>(elem_l_arr_[i]);
+
+ SCM extra_dims = e->get_elt_property (extra_space_scm_sym);
+ if (extra_dims != SCM_BOOL_F)
+ {
+ extra_dims = SCM_CDR (extra_dims);
+ dims.top ()[LEFT] -= gh_scm2double (SCM_CAR (extra_dims));
+ dims.top ()[RIGHT] += gh_scm2double (SCM_CAR (extra_dims));
+ }
+
elems.push (e);
}
}
}
}
+/*
+ Some interesting item came across. Lets attach the text and the
+ positioner to the item.
+
+*/
+
void
Bar_script_engraver::do_acknowledge_element (Item *i)
{
staff_side_p_->dim_cache_[axis_]->parent_l_
= i->dim_cache_[axis_];
+ if (!text_p_->dim_cache_[other_axis]->parent_l_)
+ text_p_->dim_cache_[other_axis]->parent_l_ = i->dim_cache_[other_axis];
staff_side_p_->add_support (i);
/*
#include "break-align-item.hh"
#include "dimensions.hh"
+#include "p-score.hh"
void
Break_align_item::do_pre_processing()
Axis_align_item::do_pre_processing();
}
+
+
+
Break_align_item::Break_align_item ()
{
stacking_dir_ = RIGHT;
threshold_interval_[SMALLER] = 1.5 PT;
set_axis (X_AXIS);
}
+
+void
+Break_align_item::add_breakable_item (Item *it)
+{
+ SCM pr = it->remove_elt_property (break_priority_scm_sym);
+
+ if (pr == SCM_BOOL_F)
+ return;
+
+ int priority = gh_scm2int (SCM_CDR (pr));
+
+ Score_element * column_l = get_elt_by_priority (priority);
+ Axis_group_item * hg=0;
+ if (column_l)
+ {
+ hg = dynamic_cast<Axis_group_item*> (column_l);
+ }
+ else
+ {
+ hg = new Axis_group_item;
+ hg->set_axes (X_AXIS,X_AXIS);
+
+ /*
+ this is quite ridiculous, but we do this anyway, to ensure that no
+ warning bells about missing Y refpoints go off later on.
+ */
+ hg->dim_cache_[Y_AXIS]->parent_l_ = dim_cache_[Y_AXIS];
+ hg->set_elt_property (ly_symbol("origin"),
+ SCM_EOL);
+
+ pscore_l_->typeset_element (hg);
+ add_element_priority (hg, priority);
+
+ if (priority == 0)
+ center_l_ = hg;
+ }
+
+ hg->set_elt_property (ly_symbol("origin"),
+ scm_cons (gh_str02scm (it->name()),
+ hg->get_elt_property (ly_symbol ("origin"))));
+ hg->add_element (it);
+
+
+}
return j;
}
-/** This complicated routine moves note columns around horizontally
- (and rests vertically) to ensure that notes don't clash.
+/** This complicated routine moves note columns around horizontally to
+ ensure that notes don't clash.
This should be done better, probably.
/*
- commandrequest.cc -- implement Nonmusical reqs
+ command-request.cc -- implement non-musical reqs
source file of the GNU LilyPond music typesetter
DOUT << length_mom_;
}
-
-
-
void
Time_signature_change_req::do_print() const
{
bool
Time_signature_change_req::do_equal_b (Request * r) const
{
- Time_signature_change_req * m = dynamic_cast <Time_signature_change_req *> (r);
+ Time_signature_change_req * m
+ = dynamic_cast <Time_signature_change_req *> (r);
return m && m->beats_i_ == beats_i_
&& one_beat_i_ == m->one_beat_i_;
Crescendo::Crescendo ()
{
grow_dir_ =0;
- dir_ = DOWN;
dyn_b_drul_[LEFT] = dyn_b_drul_[RIGHT] =false;
}
-Interval
-Crescendo::symbol_height () const
-{
- return get_symbol ().dim_[Y_AXIS];
-}
-static Real absdyn_dim = 10 PT; // ugh
+
Molecule
Crescendo::get_symbol () const
{
Real w_dim = extent (X_AXIS).length ();
+ Real absdyn_dim = paper_l ()-> get_realvar (ly_symbol ("crescendo_shorten"));
if (dyn_b_drul_[LEFT])
{
w_dim -= absdyn_dim;
Crescendo::do_brew_molecule_p () const
{
Molecule* m_p =0;
+ Real absdyn_dim = paper_l ()-> get_realvar (ly_symbol ("crescendo_shorten"));
Real x_off_dim=0.0;
if (dyn_b_drul_[LEFT])
x_off_dim += absdyn_dim;
m_p = new Molecule;
Molecule s (get_symbol ());
m_p->add_molecule (s);
- m_p->translate (Offset (x_off_dim, coordinate_offset_f_));
+ m_p->translate_axis (x_off_dim, X_AXIS);
return m_p;
}
-
{
G_text_item * text_p_;
G_staff_side_item * staff_side_p_;
+ G_staff_side_spanner * ss_span_p_;
+ G_staff_side_spanner * to_end_ss_span_p_;
+
Crescendo * to_end_cresc_p_;
Crescendo * cresc_p_;
text_p_ =0;
staff_side_p_ =0;
to_end_cresc_p_ = cresc_p_ = 0;
+ ss_span_p_ = to_end_ss_span_p_=0;
cresc_req_l_ = 0;
}
Dynamic_engraver::do_process_requests()
{
Crescendo* new_cresc_p=0;
+ G_staff_side_spanner * new_sss_p =0;
for (int i=0; i < dynamic_req_l_arr_.size(); i++)
{
if (Text_script_req *absd =
announce_element (Score_element_info (staff_side_p_, absd));
}
else if (Span_req *span_l
- = dynamic_cast <Span_req *> (dynamic_req_l_arr_[i]))
+ = dynamic_cast <Span_req *> (dynamic_req_l_arr_[i]))
{
if (span_l->span_dir_ == STOP)
{
{
assert (!to_end_cresc_p_);
to_end_cresc_p_ =cresc_p_;
+ to_end_ss_span_p_ = ss_span_p_ ;
+
cresc_p_ = 0;
+ ss_span_p_ =0;
Scalar prop = get_property ("dynamicDir", 0);
if (prop.isnum_b ())
{
- to_end_cresc_p_->dir_ = (Direction) (int) prop;
+ to_end_ss_span_p_->dir_ = (Direction) (int) prop;
}
}
new_cresc_p = new Crescendo;
new_cresc_p->grow_dir_ = (span_l->span_type_str_ == "crescendo") ? BIGGER : SMALLER;
announce_element (Score_element_info (new_cresc_p, span_l));
+
+ new_sss_p = new G_staff_side_spanner;
+ new_sss_p->set_victim (new_cresc_p);
+ new_sss_p->axis_ = Y_AXIS;
+ announce_element (Score_element_info (new_sss_p, span_l));
}
}
}
{
::warning (_ ("Too many crescendi here"));
typeset_element (cresc_p_);
+ typeset_element (ss_span_p_);
cresc_p_ = 0;
+ ss_span_p_ =0;
}
cresc_p_ = new_cresc_p;
+ ss_span_p_ = new_sss_p;
cresc_p_->set_bounds(LEFT,get_staff_info().musical_pcol_l ());
+ ss_span_p_->set_bounds (LEFT,get_staff_info().musical_pcol_l ());
if (text_p_)
{
cresc_p_->dyn_b_drul_[LEFT] = true;
if (cresc_p_)
{
typeset_element (cresc_p_ );
+ typeset_element (ss_span_p_);
+ ss_span_p_ =0;
cresc_req_l_->warning (_ ("unended crescendo"));
cresc_p_ =0;
}
if (to_end_cresc_p_)
{
to_end_cresc_p_->set_bounds(RIGHT,get_staff_info().musical_pcol_l ());
+ to_end_ss_span_p_->set_bounds(RIGHT,get_staff_info().musical_pcol_l ());
typeset_element (to_end_cresc_p_);
+ typeset_element (to_end_ss_span_p_);
to_end_cresc_p_ =0;
+ to_end_ss_span_p_ =0;
}
+
if (text_p_)
{
typeset_element (text_p_);
if (staff_side_p_)
staff_side_p_->add_support (i.elem_l_);
- if (to_end_cresc_p_)
- to_end_cresc_p_->add_support (i.elem_l_);
+ if (to_end_ss_span_p_)
+ to_end_ss_span_p_->add_support (i.elem_l_);
- if (cresc_p_)
- cresc_p_->add_support (i.elem_l_);
+ if (ss_span_p_)
+ ss_span_p_->add_support (i.elem_l_);
}
}
/*
- g-staff-side.cc -- implement G_staff_side_item
+ g-staff-side.cc -- implement G_staff_side_element
source file of the GNU LilyPond music typesetter
#include "warn.hh"
#include "dimensions.hh"
-G_staff_side_item::G_staff_side_item ()
+G_staff_side_element::G_staff_side_element ()
{
dir_ = CENTER;
to_position_l_ = 0;
void
-G_staff_side_item::do_pre_processing ()
+G_staff_side_element::do_pre_processing ()
{
if (!dir_)
dir_ = get_default_direction ();
}
Direction
-G_staff_side_item::get_default_direction () const
+G_staff_side_element::get_default_direction () const
{
return DOWN;
}
void
-G_staff_side_item::set_victim (Score_element *e)
+G_staff_side_element::set_victim (Score_element *e)
{
add_dependency (e);
to_position_l_ = e;
}
void
-G_staff_side_item::add_support (Score_element*e)
+G_staff_side_element::add_support (Score_element*e)
{
add_dependency (e);
support_l_arr_.push (e);
void
-G_staff_side_item::do_substitute_element_pointer (Score_element*o, Score_element*n)
+G_staff_side_element::do_substitute_element_pointer (Score_element*o, Score_element*n)
{
Staff_symbol_referencer::do_substitute_element_pointer (o,n);
if (o == to_position_l_)
}
void
-G_staff_side_item::position_self ()
+G_staff_side_element::position_self ()
{
if (to_position_l_ &&
to_position_l_->get_elt_property (transparent_scm_sym) != SCM_BOOL_F)
{
Score_element * e = support_l_arr_ [i];
Real coord = e->relative_coordinate (common, axis_);
+
dim.unite (coord + e->extent (axis_));
}
}
}
void
-G_staff_side_item::do_post_processing ()
+G_staff_side_element::do_post_processing ()
{
if (axis_ == Y_AXIS)
position_self ();
void
-G_staff_side_item::do_add_processing ()
+G_staff_side_element::do_add_processing ()
{
if (staff_support_b_
&& axis_ == Y_AXIS && staff_symbol_l ())
}
Interval
-G_staff_side_item::do_height () const
+G_staff_side_element::do_height () const
{
Interval i;
if (to_position_l_)
return i;
}
+void
+G_staff_side_element::do_print () const
+{
+#ifndef NPRINT
+ if (to_position_l_)
+ DOUT << "positioning " << to_position_l_->name();
+
+ DOUT << "axis == " << axis_name_str (axis_)
+ << ", dir == " << to_str (dir_ );
+#endif
+}
+
+
Interval
G_staff_side_item::do_width () const
{
return to_position_l_->extent (X_AXIS);
return i;
}
+
void
G_staff_side_item::do_print () const
{
-#ifndef NPRINT
- if (to_position_l_)
- DOUT << "positioning " << to_position_l_->name();
+ G_staff_side_element::do_print ();
+}
- DOUT << "axis == " << axis_name_str (axis_)
- << ", dir == " << to_str (dir_ );
-#endif
+void
+G_staff_side_spanner::do_print () const
+{
+ G_staff_side_element::do_print ();
}
gh_double2scm(stem_l_->staff_line_leading_f ()
* gh_scm2double (p)));
}
- G_staff_side_item :: do_pre_processing ();
+ G_staff_side_item::do_pre_processing ();
}
{
return classname (this);
}
+
+void
+Graphical_element::print () const
+{
+#ifndef NPRINT
+ DOUT << classname (this) << "{\n";
+ do_print ();
+ DOUT << "}\n";
+#endif
+}
/// align breakable items (clef, bar, etc.)
class Break_align_item : public Axis_align_item {
+
protected:
virtual void do_pre_processing();
public:
+ void add_breakable_item (Item *it);
+
Break_align_item ();
VIRTUAL_COPY_CONS(Score_element);
#ifndef CRESCENDO_HH
#define CRESCENDO_HH
-#include "staff-side.hh"
#include "spanner.hh"
/**
The hairpin symbol. (cresc)
*/
-class Crescendo : public Spanner , public Staff_side {
+class Crescendo : public Spanner {
public:
int grow_dir_;
protected:
VIRTUAL_COPY_CONS(Score_element);
virtual Molecule*do_brew_molecule_p() const;
- virtual Interval symbol_height() const;
-
private:
Molecule get_symbol() const;
#ifndef G_STAFF_SIDE_HH
#define G_STAFF_SIDE_HH
+#include "spanner.hh"
#include "item.hh"
#include "staff-symbol-referencer.hh"
Amount of extra space to add.
*/
-class G_staff_side_item : public Item, public Staff_symbol_referencer
+class G_staff_side_element : public Staff_symbol_referencer
{
void position_self ();
//junkme.
bool staff_support_b_;
- G_staff_side_item ();
+ G_staff_side_element ();
void set_victim (Score_element*);
void add_support (Score_element*);
virtual Direction get_default_direction () const;
protected:
virtual Interval do_height () const;
- virtual Interval do_width () const;
virtual void do_print () const;
virtual void do_add_processing ();
virtual void do_substitute_element_pointer (Score_element*,Score_element*);
virtual void do_post_processing ();
};
+class G_staff_side_item : public G_staff_side_element, public Item
+{
+public:
+ VIRTUAL_COPY_CONS(Score_element);
+protected:
+ virtual Interval do_width () const;
+ virtual void do_print () const;
+};
+
+class G_staff_side_spanner : public G_staff_side_element, public Spanner
+{
+public:
+ VIRTUAL_COPY_CONS(Score_element);
+protected:
+ virtual void do_print () const;
+};
+
#endif /* G_STAFF_SIDE_HH */
Graphical_element *parent_l (Axis a) const;
virtual void do_print () const;
+ virtual void print () const;
};
#endif // GRAPHICAL_ELEMENT_HH
DECLARE_LY_SYMBOL(damping);
DECLARE_LY_SYMBOL(dashed);
DECLARE_LY_SYMBOL(extremal);
+DECLARE_LY_SYMBOL(extra_space);
DECLARE_LY_SYMBOL(dir_forced);
DECLARE_LY_SYMBOL(extender_height);
DECLARE_LY_SYMBOL(filledbox);
String style_str_;
protected:
VIRTUAL_COPY_CONS(Music);
+ virtual bool do_equal_b (Request*)const;
virtual void do_print () const;
};
<< ", style = " << style_str_;
}
+bool
+Text_script_req::do_equal_b (Request *r) const
+{
+ Text_script_req * t = dynamic_cast<Text_script_req*>(r);
+ return t && t->text_str_ == text_str_ && t->style_str_ == style_str_;
+}
+
void
Articulation_req::do_print () const
{
#include "request.hh"
#include "debug.hh"
-
-
-
void
Request::do_print() const
{
}
-
-
-
bool
Request::equal_b (Request *r) const
{
Request::do_equal_b (Request*) const
{
return true;
-
}
(c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-
#include "axis-group-item.hh"
#include "score-priority-engraver.hh"
#include "item.hh"
typeset_element (halign_p_);
halign_p_ =0;
}
-
-}
-
-void
-Score_priority_engraver::add_horizontal_group (Item* it, int priority)
-{
- if (!halign_p_)
- {
- halign_p_ = new Break_align_item;
- halign_p_->set_elt_property (breakable_scm_sym, SCM_BOOL_T);
- announce_element (Score_element_info (halign_p_,0));
- }
-
- if (priority == 0)
- halign_p_->center_l_ = it;
-
- halign_p_->add_element_priority (it, priority);
-
- column_p_arr_.push (it);
}
+/*
+ TODO: move this logic into Break_align_item
+ */
void
Score_priority_engraver::acknowledge_element (Score_element_info inf)
{
if (c->empty_b () || c->parent_l_)
return;
- SCM pr = item_l->remove_elt_property (break_priority_scm_sym);
-
- if (pr == SCM_BOOL_F)
- return;
-
- bool breakable = (item_l->remove_elt_property (breakable_scm_sym) != SCM_BOOL_F);
+ bool breakable
+ = (item_l->remove_elt_property (breakable_scm_sym) != SCM_BOOL_F);
if (!breakable)
return ;
-
- int priority = gh_scm2int (SCM_CDR (pr));
-
- Score_element * column_l = 0;
- if (halign_p_)
- column_l = halign_p_->get_elt_by_priority (priority);
- Axis_group_item * hg=0;
- if (column_l)
- {
- hg = dynamic_cast<Axis_group_item*> (column_l);
- }
- else
+
+
+ if (!halign_p_)
{
- hg = new Axis_group_item;
- hg->set_axes (X_AXIS,X_AXIS);
- hg->set_elt_property (ly_symbol("origin"),
- SCM_EOL);
- announce_element (Score_element_info (hg,0));
- add_horizontal_group (hg, priority);
+ halign_p_ = new Break_align_item;
+ halign_p_->set_elt_property (breakable_scm_sym, SCM_BOOL_T);
+ announce_element (Score_element_info (halign_p_,0));
}
-
- hg->set_elt_property (ly_symbol("origin"),
- scm_cons (gh_str02scm (item_l->name()),
- hg->get_elt_property (ly_symbol ("origin"))));
- hg->add_element (item_l);
-
+
+ halign_p_->add_breakable_item (item_l);
}
}
if (pc != il->column_l ())
{
/* this shouldn't happen, but let's continue anyway. */
- warning (_("Single_malt_grouping_item: I've been drinking too much (fixme)"));
+ programming_error (_("Single_malt_grouping_item: I've been drinking too much"));
continue; /*UGH UGH*/
}
% Multi-measure rests
mmrest_x_minimum = 2.0*\staffheight;
+
+% chop off this much when next to pp / ff sign.
+crescendo_shorten = 4.0 * \interline;
+
% in internote.
restcollision_minimum_dist = 3.0;
restcollision_minimum_beamdist = 1.5;
# (not finished.)
#
-name = 'abc-to-ly'
+program_name = 'abc-to-ly'
version = '0.1'
-
+import __main__
import getopt
import sys
import re
import string
+
+
header = {}
global_voice_stuff = []
default_len = 4
+global_key = [0] * 7 # UGH
+
def dump_header (hdr):
print '};'
def set_default_length (s):
- m = re.match ('1/(.*)$', s)
+ m = re.search ('1/([0-9]+)', s)
if m:
- default_len = string.atoi ( m.group (1))
+ __main__.default_len = string.atoi ( m.group (1))
-def parse_timesig (s):
- m = re.match ('^M: *(.*)$', s)
- if m:
- print '\meter %s; ' % m.group (1)
-
-def parse_key (s):
- m = re.match ('^K: *(.*)$', s)
- if m:
- print '\key %s; ' % m.group (1)
-
def gulp_file(f):
try:
i = open(f)
return s
+# pitch manipulation. Tuples are (name, alteration).
+# 0 is (central) C. Alteration -1 is a flat, Alteration +1 is a sharp
+# pitch in semitones.
+def semitone_pitch (tup):
+ p =0
+
+ t = tup[0]
+ p = p + 12 * (t / 7)
+ t = t % 7
+
+ if t > 2:
+ p = p- 1
+
+ p = p + t* 2 + tup[1]
+ return p
+
+def fifth_above_pitch (tup):
+ (n, a) = (tup[0] + 4, tup[1])
+
+ difference = 7 - (semitone_pitch ((n,a)) - semitone_pitch (tup))
+ a = a + difference
+
+ return (n,a)
+
+def sharp_keys ():
+ p = (0,0)
+ l = []
+ k = 0
+ while 1:
+ l.append (p)
+ (t,a) = fifth_above_pitch (p)
+ if semitone_pitch((t,a)) % 12 == 0:
+ break
+
+ p = (t % 7, a)
+ return l
+
+def flat_keys ():
+ p = (0,0)
+ l = []
+ k = 0
+ while 1:
+ l.append (p)
+ (t,a) = quart_above_pitch (p)
+ if semitone_pitch((t,a)) % 12 == 0:
+ break
+
+ p = (t % 7, a)
+ return l
+
+def quart_above_pitch (tup):
+ (n, a) = (tup[0] + 3, tup[1])
+
+ difference = 5 - (semitone_pitch ((n,a)) - semitone_pitch (tup))
+ a = a + difference
+
+ return (n,a)
+
+
+def compute_key (k):
+ k = string.lower (k)
+ intkey = (ord (k[0]) - ord('a') + 5) % 7
+ intkeyacc =0
+ k = k[1:]
+
+ if k and k[0] == 'b':
+ intkeyacc = -1
+ k = k[1:]
+ elif k and k[0] == '#':
+ intkeyacc = 1
+ k = k[1:]
+
+ keytup = (intkey, intkeyacc)
+
+ sharp_key_seq = sharp_keys ()
+ flat_key_seq = flat_keys ()
+
+ accseq = None
+ accsign = 0
+ if keytup in sharp_key_seq:
+ accsign = 1
+ key_count = sharp_key_seq.index (keytup)
+ accseq = map (lambda x: (4*x -1 ) % 7, range (1, key_count + 1))
+
+ elif keytup in flat_key_seq:
+ accsign = -1
+ key_count = flat_key_seq.index (keytup)
+ accseq = map (lambda x: (3*x + 3 ) % 7, range (1, key_count + 1))
+ else:
+ raise "Huh"
+
+ key_table = [0] * 7
+ for a in accseq:
+ key_table[a] = key_table[a] + accsign
+
+
+ return key_table
+
def try_parse_header_line (ln):
m = re.match ('^(.): *(.*)$', ln)
if g == 'M':
global_voice_stuff.append ('\\time %s;' % a)
if g == 'K':
+ __main__.global_key =compute_key (a)# ugh.
+
global_voice_stuff.append ('\\key %s;' % a)
if g == 'O':
header ['origin'] = a
return m
+def pitch_to_mudela_name (name, acc):
+ s = ''
+ if acc < 0:
+ s = 'es'
+ acc = -acc
+ elif acc > 0:
+ s = 'is'
+
+ if name > 4:
+ name = name -7
+ return chr (name + ord('c')) + s * acc
+
+def octave_to_mudela_quotes (o):
+ s =''
+ if o < 0:
+ o = -o
+ s=','
+ else:
+ s ='\''
-# WAT IS ABC EEN ONTZETTENDE PROGRAMMEERPOEP !
+ return s * o
+
+def parse_num (str):
+ durstr = ''
+ while str[0] in "1234567890":
+ durstr = durstr + str[0]
+ str = str[1:]
+
+ n = None
+ if durstr:
+ n =string.atoi (durstr)
+ return (str,n)
+
+def duration_to_mudela_duration (multiply_tup, defaultlen):
+ base = 1
+
+# WAT IS ABC EEN ONTZETTENDE PROGRAMMEERPOEP !
def try_parse_note (str):
mud = ''
slur_begin = 1
str = str[1:]
- acc = None
+ acc = 0
if str[0] in '^=_':
c = str[0]
str = str[1:]
notename = 0
if str[0] in "abcdefg":
- notename = ord(str[0]) - ord('a')
+ notename = (ord(str[0]) - ord('a') + 5)%7
str = str[1:]
else:
return str # failed; not a note!
while str[0] == '\'':
octave = octave + 1
str = str[1:]
- divide =0
+
+ num = 0
+ den = 0
+
+ (str, num) = parse_num (str)
+ if not num:
+ num = 1
+
if str[0] == '/':
divide =1
str = str[1:]
- durstr = ''
- while str[0] in "1234567890":
- durstr = durstr + str[0]
- str = str[1:]
+ (str, den) =parse_num (str)
- duration_mult = 1
- if durstr:
- duration_mult = string.atoi (durstr)
+ if not den: den = 1
+
+ print duration_to_mudela_duration ((num,den), default_len)
+ print '%s%s%d' % (pitch_to_mudela_name(notename, acc + global_key[notename]) , octave_to_mudela_quotes (octave), duration_mult)
-
slur_end =0
if str[0] == ')':
slur_begin = 1
def identify():
- print '%s %s' % (name, version)
+ print '%s %s' % (program_name, version)
def help ():
print r"""
-h, --help this help.
"""
+
+
identify()
(options, files) = getopt.getopt (sys.argv[1:], 'h', ['help'])