


<!doctype html>
<html lang="en" dir="ltr">
    <head>
      
      
        <title>
            
            OpenHatch - 
Projects - todo_cli.py 

            
        </title>


        <link rel="shortcut icon" href="/favicon.ico" />
	
        <link rel="canonical" href="https://openhatch.org/projects/todo_cli.py" />
	
        <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
        <meta http-equiv='Content-Language' content='en-us' />
        <meta name='Description' content='OpenHatch, the open source involvement engine.'>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <style type='text/css'> /*<![CDATA[*/
            

            
            @import url(/static/packed/openhatch.css?1519487256);
            

            

            body { 
            #landing a.blog-feed { 
                background-image:
                url(/static/images/base/landing/feed-icon-16x16-sprited.png) }
            .person {
                font-size: 80%; }
            .geocode {
                font-size: 80%; }
            body#profile #importer { 
                background-image:
                url(/static/images/ship.png) }
            body#profile #progressbar.working .ui-progressbar-value { 
                background-image:
                url(/static/css/jquery-ui-lightness/images/pbar-ani.gif); }
            body#profile .portfolio_entry > .actions li.save_and_publish_button *,
            body#profile .portfolio_entry > .actions li.save_button * { 
                background-image:
                url(/static/images/icons/publish.png); }
            body#profile .portfolio_entry > .actions li.delete_portfolio_entry a { 
                background-image:
                url(/static/images/icons/delete.png); }
            body#profile .citations li .actions a.delete_citation { 
                background-image:
                url(/static/images/icons/delete-citation.png); }
            body#profile #portfolio.viewer .portfolio_entry .submodule { 
                background-image:
                url(/static/images/profile/portfolio/portfolio-entry-bg.png) }
            body#project #wannahelp-button { 
                background-image:
                url(/static/images/wannahelp-button-bg.png); }
            body#project #wannahelp-button:active { 
                background-image:
                url(/static/images/wannahelp-button-bg-active.png); }
            body#project #wannahelp-button:hover,
            body#project #wannahelp-button:focus { 
                background-image:
                url(/static/images/wannahelp-button-bg-hover.png); }
            body#project #wannahelp-button:hover:active { 
                background-image:
                url(/static/images/wannahelp-button-bg-hover-active.png); }
            body#project .next_steps_for_helpers { 
                background-image:
                url(/static/images/bg-translucent-green.png); }
            #footer { background: #333 url('/static/images/dark-hatch.png') repeat; }

            

#big-project-list form p label{ text-align: left; display: block; width: 100%;}
#big-project-list form input[type='text'] { font-family: sans-serif; float: left; width: 20em; font-size: 1.5em; padding: 4px; }
#big-project-list form input[type='submit'] { font-family: sans-serif; float: left; font-weight: normal; font-size: 1.5em; padding: 4px 8px 3px 8px; position: relative; top: -1px; }
#big-project-list .note { margin-left: 2em; font-weight: normal; }

            /*]]>*/
        </style>

        <!--[if lt IE 8]>
        <script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js"
        type="text/javascript"></script>
        <![endif]-->
	
		<script type="text/javascript" src="/static/packed/header.js?1519487256"></script>
	
        
        <link rel="stylesheet/less" type="text/css" href="/static/less/base/base.less">
        <link rel="stylesheet/less" type="text/css" href="/static/less/base/one_column.less">
        <link rel="stylesheet/less" type="text/css" href="/static/less/base/two_column.less">
        <link rel="stylesheet/less" type="text/css" href="/static/less/base/three_column.less">
        <link rel="stylesheet/less" type="text/css" href="/static/less/base/landing.less">
        
        <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
        <script src="/static/js/less-1.3.0.min.js" type="text/javascript"></script>
        
        

    </head>

    
    <body id='project' class='two_columns'>

        <div id="nav-container">

                
                


<div id='nav'>
        <h1>
            <a href='/'>
                <img src='/static/images/the-logo-bluegreen-87px.png'
                        width='87' height='60' alt='openhatch' />
            </a>
        </h1>
        
        <ul id='topnavlinks'>
            <li><a href='/donate/'>donate</a></li>
            <li><a href='/missions/'>training</a></li>
            <li><a href='/events/'>events</a></li>
            <li><a href='/search/'>projects</a></li>
            <li><a href='/people/'>people</a></li>
        </ul>
        <ul id='account-links'>
            
                <li><a id='login' href='/account/login/'>log in / <strong>sign up</strong></a></li>
                
            
        </ul>

</div><!-- /#nav -->&nbsp;



                
                
        </div>
        
        <div id="container">
                
                <div id="pagetop">
                    

    <noscript>
        <style type='text/css'>
            li form * { display: inherit ! important; }
            li form strong { display: inline ! important; }
            li form.answer_question { float: left; background-color: #ffc; }
            body#project li form a.collapse_answer_form { display: none ! important; }
        </style>
    </noscript>

    <h3 class='supertitle'><a href='/projects/'>&laquo; Projects</a></h3>
    <h1>todo_cli.py</h1>

    <div class='next_steps_for_helpers contains_just_the_head collapsed module' style='background-image: url(/static/images/bg-translucent-green.png); display: none;'> 
        <div class='module-head'>
            <h3>Next steps for helpers
                <a id='show' style='font-weight: normal;' href='#'>(show)</a>
		<form style="display: none;" id="show_form" method='POST' action="/+do/profile.views.set_expand_next_steps_do"><input type='hidden' name='csrfmiddlewaretoken' value='FbjtQ97m7UteItS78JTljeqnN3C0OnjE' />
		  <input type="hidden" name="value" value="True" />
		</form>
                <a id='hide' style='font-weight: normal;' href='#'>(hide)</a>
		<form style="display: none;" id="hide_form" method='POST' action="/+do/profile.views.set_expand_next_steps_do"><input type='hidden' name='csrfmiddlewaretoken' value='FbjtQ97m7UteItS78JTljeqnN3C0OnjE' />
		  <input type="hidden" name="value" value="False" />
		</form>
            </h3>
        </div>
    </div>

    <div class='next_steps_for_helpers contains_just_the_body collapsed module' style='display: none;'>
        <div class='module-body'>
                <ul class='raquo_bullets'>
                    <li><a href='/profile/views/edit_info'>
                            Talk about your skills and interests on your profile</a></li>
                    <li><a href='/search/?q=todo_cli.py&toughness=bitesize'>
                            Find a bite-size bug in todo_cli.py
                        </a></li>
                    <li><a href='/profile/views/edit_info#contact_blurb'>
                                Make sure your contact info is up to date</a></li>
                </ul>
            </span>
        </div>
    </div>


                </div>
                <div id='content'>
                    
<div class="column two-column-left">
    
<div id='project-tab-container' class='module contains_questions'>
    <ul class='module-head tab_nav'>
            <li class='ui-state-active'>
                <h3><a href='#chatter'>Q&A</a></h3>
            </li>
             
    </ul>
    <div id="chatter" class='module-body tab'>
        <div style="font-size: 1.3em" class="you-are-missing-things">
        
        <noscript><div>Please enable javascript in order to post answers.</div></noscript>
        </div>
        <ul id='paragraph_questions' class='questions'>
            
                <li>
                    <h3><strong>Q:</strong>
                        

    <span>I'd like to participate. How do I begin?</span>








                    </h3>
                    <ul class='answers'>
                        

                        
                        <li>
                            
                                
<form
    
    class="answer_question" 
    name='question-short-1' method='post' 
    action='/+do/project.views.create_answer_do'><input type='hidden' name='csrfmiddlewaretoken' value='FbjtQ97m7UteItS78JTljeqnN3C0OnjE' />
    <input type="hidden" name="question__pk" value="1" />
    <input type="hidden" name="project__pk" value="3356" />
    
        <div class="show_when_editing">
            <a href="#" style='float: right; font-weight: bold; position: relative; top: -5px;' class="collapse_answer_form" id="collapse_answer_form_">[X]</a>
            <label style='float: left;' for='answer-question0'>
                Add an answer
            </label>
        </div>
        <textarea class='add_an_answer'
            id='answer-question0'
            title='Add an answer'
            name='answer__text'
            ></textarea>
        
    <div class='show_when_editing'>
        <input type='submit' value='Submit'>
        <div class='input-note'>

            
            <ul class='sections'>
                <li>
                <p>
                <strong>Tip</strong>:
                </p>
                <p>
                Talk about diverse kinds of contributions.  Include URLs if
                relevant (we'll automatically linkify them).
                </p>
                </li>
                <li>
                <p>
                <strong>Examples</strong>:
                </p>
                <p class='example'>
                Here's how to download and patch our codes&hellip; 
                </p>
                <p class='example'>
                Read about our death-defying mailing list and momentous IRC
                channel at http://lobstermag.net.
                </p>
                </li>
            </ul>
            
        </div>
    </div><!-- /.show_when_editing -->
</form>

                            
                        </li>
                    </ul>
                </li>
            
                <li>
                    <h3><strong>Q:</strong>
                        







    <span>Other than writing code, how can I contribute?</span>


                    </h3>
                    <ul class='answers'>
                        

                        
                        <li>
                            
                                
<form
    
    class="answer_question" 
    name='question-long-2'
    method='POST'
    action='/+do/project.views.create_answer_do'
    ><input type='hidden' name='csrfmiddlewaretoken' value='FbjtQ97m7UteItS78JTljeqnN3C0OnjE' />

    <input type='hidden' name='project__pk' value='3356'>
    <input type='hidden' name='question__pk' value='2'>
    <div class="show_when_editing">
        <a href="#" style='float: right; font-weight: bold; position: relative; top: -5px;' class="collapse_answer_form" id="collapse_answer_form_">[X]</a>
        <label style='float: left;' for='q2-answer__title'>
            
            Describe a task 
            
        </label>
    </div>
    
        <input type='text' name='answer__title'

            
            title='Describe a task'
            

        id='q2-answer__title' 
        class='add_an_answer'/>
        
    <div class="show_when_editing">
        
        
        
        <label for='q2-answer__text'>
            Further info</label>
        
        <textarea id='q2-answer__text' 
            name='answer__text'></textarea>
        <div class='input-note'>
            
            <ul class='sections'>
                <li>
                <p>
                <strong>Tip</strong>:
                </p>
                <p>
                Discuss documentation,
                testing, webmastering,
                and/or publicity.
                </p>
                <p>Include URLs if relevant (we'll
                automatically linkify them). </p>
                </li>
                <li>
                <p>
                <strong>Example</strong>:
                </p>
                <p class='example'>
                We need people to download version
                0.4.5 and make sure the frobulator
                still frobulates correctly.
                </p>
                </li>
            </ul>
            
            

            
        </div>

        <input type='submit' value='Submit'>
                        </div>
                </form>

                            
                        </li>
                    </ul>
                </li>
            
                <li>
                    <h3><strong>Q:</strong>
                        





    <span>What's a good bug
        
        for a newcomer to tackle?</span>




                    </h3>
                    <ul class='answers'>
                        

                        
                        <li>
                            
                                
<form
    
    class="answer_question" 
    name='question-long-3'
    method='POST'
    action='/+do/project.views.create_answer_do'
    ><input type='hidden' name='csrfmiddlewaretoken' value='FbjtQ97m7UteItS78JTljeqnN3C0OnjE' />

    <input type='hidden' name='project__pk' value='3356'>
    <input type='hidden' name='question__pk' value='3'>
    <div class="show_when_editing">
        <a href="#" style='float: right; font-weight: bold; position: relative; top: -5px;' class="collapse_answer_form" id="collapse_answer_form_">[X]</a>
        <label style='float: left;' for='q3-answer__title'>
            
            Describe an issue
            
        </label>
    </div>
    
        <input type='text' name='answer__title'

            
            title='Describe an issue'
            

        id='q3-answer__title' 
        class='add_an_answer'/>
        
    <div class="show_when_editing">
        
        
        <label for='q3-answer__text'>
            Further info</label>
        
        
        <textarea id='q3-answer__text' 
            name='answer__text'></textarea>
        <div class='input-note'>
            
            

            
            <ul class='sections'>
                <li>
                <p>
                <strong>Tip</strong>:
                </p>
                <p>
                Many projects have
                good small tasks that can teach newcomers
                how the project works. Now's your chance to
                share one of them!
                </p>
                <p>
                Include URLs if relevant (we'll
                automatically linkify them). </p>
                </li>
                <li>
                <p>
                <strong>Example</strong>:
                </p>
                <p class='example'>
                Someone could improve the
                photo upload dialog box so that it lets
                you resize the photo before sending it
                to the web.
                </p>
                </li>
            </ul>
            
        </div>

        <input type='submit' value='Submit'>
                        </div>
                </form>

                            
                        </li>
                    </ul>
                </li>
            
                <li>
                    <h3><strong>Q:</strong>
                        



    <span>What is a bug or issue with <b>todo_cli.py</b>
    that you've been putting off, neglecting, or
    just plain avoiding?</span>






                    </h3>
                    <ul class='answers'>
                        

                        
                        <li>
                            
                                
<form
    
    class="answer_question" 
    name='question-long-4'
    method='POST'
    action='/+do/project.views.create_answer_do'
    ><input type='hidden' name='csrfmiddlewaretoken' value='FbjtQ97m7UteItS78JTljeqnN3C0OnjE' />

    <input type='hidden' name='project__pk' value='3356'>
    <input type='hidden' name='question__pk' value='4'>
    <div class="show_when_editing">
        <a href="#" style='float: right; font-weight: bold; position: relative; top: -5px;' class="collapse_answer_form" id="collapse_answer_form_">[X]</a>
        <label style='float: left;' for='q4-answer__title'>
            
            Describe an issue
            
        </label>
    </div>
    
        <input type='text' name='answer__title'

            
            title='Describe an issue'
            

        id='q4-answer__title' 
        class='add_an_answer'/>
        
    <div class="show_when_editing">
        
        <label for='q4-answer__text'>
            What makes the situation sub-optimal?</label>
        
        
        
        <textarea id='q4-answer__text' 
            name='answer__text'></textarea>
        <div class='input-note'>
            
            
            <ul class='sections'>
                <li>
                <p>
                <strong>Examples</strong>:
                </p>
                <p class='example'>
                I don't know how to get started with
                internationalizing my app.
                </p>
                <p class='example'>
                Bug 392 about printing was filed five
                years ago, and I don't even know if
                printing still works.
                </p>
                <p class='example'>
                I want help from a C coder writing a
                Maildir patch for Alpine.
                </p>
                </li>
                <li>
                <p>
                <strong>Note</strong>:
                </p>
                <p>
                If this issue was formally
                filed on the web, be sure to
                include the URL.
                </p>
                </li>
            </ul>
            

            
        </div>

        <input type='submit' value='Submit'>
                        </div>
                </form>

                            
                        </li>
                    </ul>
                </li>
            
        </ul>
        <strong id="other-questions">
            <a href="/projects/suggest_question/?project__pk=3356">
                What else do you want to talk about?
            </a>
        </strong>
    </div><!-- /#chatter -->
</div><!-- /.module #requests -->


</div>
<div class="column two-column-right">
    
    <div class='module' id='about'>
        <div class='module-head'>
            <h3>About todo_cli.py</h3>
            <ul>
                <li>
                    <a href='/+projedit/todo_cli.py'>Edit project settings</a>
                </li>
            </ul>
        </div>
        <div class='module-body'>
            <div class='project_icon' 
                    style="float: left; width: 64px; margin-right: 20px;
                    background-image: url(/static/no-project-icon.png)"
                    ><span class='alt-text'>
                        (logo)
                    </span></div>
            <div style='float: left; width: 70%;'>
                
                    <h2 style='font-size: 1.3em; font-weight: normal;'>
                        <span><p>Command line to do application. Uses sqlalchemy to create and store a sqlite3 database. </p></span>
                    </h2>
                    <p style='font-size: .9em; margin: 5px 0 0 40px;'>
                        from the profile of
                        <a href='/people/Mark/'>
                            
                            

<span class='full_name'>Mark&nbsp;Freeman</span><span class='space_between_name_and_username'>&nbsp;</span><span class='parenthesis'>(</span><span class='username_parenthesized'>Mark</span><span class='parenthesis'>)</span>

                            
                        </a>
                    </p>
                

                

                

            </div>
        </div>
    </div>


    
        <div class='module' id='wannahelp'>
            <form id='want2help_form' action="/+do/project.views.wanna_help_do" method="POST"><input type='hidden' name='csrfmiddlewaretoken' value='FbjtQ97m7UteItS78JTljeqnN3C0OnjE' />
                <input type='hidden' name='project' value='3356'>
                <input type='submit' id='wannahelp-button' rel='tipsy-south' title='Click to add yourself to the list of people who want to contribute. People of all levels are welcome!' value='I want to help'>
            </form>
        </div>
    


<div class='module' id='wanna_help'>
    

    <div class='head'>
        <h3>People who want to help <span style='font-weight: normal;'>(none listed yet)</span></h3>
        
    </div>
    
    </form>




</div>

<div class='module' id='contributors'>
    <div class='module-head'>
        <h3>Registered contributors (1)</h3>
            <ul>
                <li>
                    
                        <a class='actionlink' href='/people/?q=project:"todo_cli.py"'>See all</a>
                    
                    <a class='actionlink' href='/+portfolio/editor/?add_project_name=todo_cli.py'>Add yourself</a>
                </li>
            </ul>
    </div>
    
        <div class='module-body'>
            <ul class="people-list">
                
                    




<li id="person_summary_924"
        class="">
    <a href="/people/Mark/">
    
        <img src=/static/static/photos/profile-photos/b9dfb7a03bc34cba81cf36fd4f4b98f0-thumbnail
            
                width='40'
                height='51'
            
        />
    
    <span class="people-view-info">
        

        <span class="name">
            

            
                Mark Freeman
            

            
                <span class='username'>
                    Mark
                </span>
            
            
        </span>

        

        
        <span class="location">
            Leeds, AL, United States
        </span>
        

        
        
            
                <span class="people-view-projects">
                    <span style="color: #999;">projects:</span>
                    
                        

                    OpenHatch, todo_cli.py, pylilydtk
                    
                        
                    



                    
                </span>
            
        

        
        
            
                <span class="people-view-tags">
                    <span style="color: #999;">tags:</span>
                    
                        

                    android, coding, documentation, java, mobile, python, testing
                    
                        
                    



                    
                </span>
            
            
        
    </span>
    </a>
</li>


                
            </ul>
        </div>
    
</div>

<div class='module' id='bugs'>
    <div class='module-head'> <h3>Volunteer opportunities, etc.</h3> </div>
    <div class='module-body'>
        <style>
            #bugs p { margin-top: 0; }
        </style>
        
            <p>
                No volunteer opportunities in todo_cli.py indexed here yet. 
                <a href='/+projedit/todo_cli.py#edit_bug_trackers'>
                    Add a bug tracker</a>.

            </p>
    
  
  
  
  
  


          <p>
              No one on OpenHatch has signed up as a mentor
              for todo_cli.py. Can you?
              <a href="/profile/views/edit_info">Add the tag</a>.
          </p>




  
  
  

  

  You can <a id='show_copypastebox' href='#'>embed the "I want to help" button</a> on your website. (<a href='/blog/2010/let-people-help-your-project-give-them-a-button-to-click/'>More about this</a>.)
  <div id='copypastebox'>
      <textarea style='font-size: .8em; font-family: monospace;'>
<form method="POST" action="http://491219a0-0d37-45c2-9670-4eb8ee3c6802.prvt.dyno.rt.heroku.com:4244/+do/project.views.wanna_help_do">
    <input type="hidden" name="from_offsite" value="True" />
    <input type="hidden" value="3356" name="project"/>
    <input type="submit" value="I want to help" rel="tipsy-south" id="openhatch-wannahelp-button" original-title="Click to add yourself to the list of people who want to contribute. People of all levels are welcome!"/>
</form>

<style>
    @import url('http://491219a0-0d37-45c2-9670-4eb8ee3c6802.prvt.dyno.rt.heroku.com:4244/static/css/tipsy.css');
</style>

<style type="text/css">
#openhatch-wannahelp-button:hover, #openhatch-wannahelp-button:focus { background-image:url('http://491219a0-0d37-45c2-9670-4eb8ee3c6802.prvt.dyno.rt.heroku.com:4244/static/images/wannahelp-button-bg-hover.png'); color:#222; text-decoration:none; }
#openhatch-wannahelp-button { background: #C8E29D url('http://491219a0-0d37-45c2-9670-4eb8ee3c6802.prvt.dyno.rt.heroku.com:4244/static/images/wannahelp-button-bg.png') repeat-x scroll center top; border:3px solid #fff;  cursor:pointer; cursor: hand; font-family: Helvetica, sans-serif; font-size:13pt; font-weight:normal; text-align:center; text-shadow:0 1px 0 #fff; white-space:normal; }
#openhatch-wannahelp-button { -moz-border-radius: 8px; color: #444; float:left; padding:10px 20px; display:block; padding:2px 8px; }
#openhatch-wannahelp-button:focus { outline-color:-moz-use-text-color; outline-style:none; outline-width:medium; }
</style>


<script type="text/javascript" src="http://491219a0-0d37-45c2-9670-4eb8ee3c6802.prvt.dyno.rt.heroku.com:4244/static/packed/selections_for_widget.js?1519487354"></script>

</textarea>
  </div>

    </div>
</div><!-- /.module #bugs -->


</div>
<!--- end second column -->
<div class="more-content">
    
    
</div>
<!--- end more_content -->

                </div><!-- /#content -->
		<div class="clearfix"></div>
        </div><!-- /#container -->

        <div id='footer-wrapper'>
          <div id='footer'>
            
	    <div class="threecol">
              <div class="column">
                <h3>OpenHatch organization</h3>

                <ul>
                  <li><a href="/about/">about openhatch</a></li>
                  <li><a href="/sponsors/">sponsors</a></li>
                  <li><a href="/blog/">blog</a></li>
                  <li><a href="/contact/">contact</a></li>
                  <li><a href="https://openhatch.org/wiki/Privacy_policy">privacy policy</a></li>
                </ul>
              </div>

	      <div class="column">
		<h3>OpenHatch web app code</h3>
		<ul>
		  <li><a href="http://openhatch.readthedocs.org/en/latest">Intro for developers</a></li>
		  <li><a href="https://github.com/openhatch/oh-mainline">Github (source code)</a></li>
		  <li><a href="http://lists.openhatch.org/mailman/listinfo/devel">Devel mailing list</a></li>
		  <li><a href="https://openhatch.org/bugs/">Bug tracker</a></li>
		  
		</ul>
	      </div>

	      <div class="column">
		<h3>Other web tools</h3>
		<ul>
                  <li><a href="/wiki/">wiki</a></li>
                  <li><a href="http://forum.openhatch.org/">forum</a></li>
		</ul>
	      </div>
              <!-- Google Custom Search Box -->
              <script>
                  (function() {
                    var cx = '005653286234967232733:xv_tz2v3ive';
                    var gcse = document.createElement('script');
                    gcse.type = 'text/javascript';
                    gcse.async = true;
                    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
                        '//www.google.com/cse/cse.js?cx=' + cx;
                    var s = document.getElementsByTagName('script')[0];
                    s.parentNode.insertBefore(gcse, s);
                  })();
                </script>
                <gcse:search></gcse:search>
             <!-- end Google Custom Search Box -->
	    </div>
            
          </div>
        </div>

        
        
	<!--Includes for the javascript bundle are in base/assets.py-->
	
		<script type="text/javascript" src="/static/packed/openhatch.js?1519487256"></script>
	

        
<script type='text/javascript'>
    $(function(){
        $('.step-checkbox').click(function() {
            $(this).toggleClass('step-checkbox-checked');
            $(this).toggleClass('step-checkbox-unchecked');
            return false;
        });
    });
</script>

<script type='text/javascript'>
$(function(){
        $('#project-tab-container').tabs({
            cookie: {
                // keeps tab choice for one day
                expires: 1
            }
        });
        $('.invisible_if_js').removeClass('invisible_if_js');
});
</script>

    <script type='text/javascript'>
        
        
        $(function() {
            $('.add_an_answer')
                .focus(function() {
                    $form = $(this).parent();
                    $form.addClass('active');
                    $form.find('input:text, textarea').unbind('blur');
                });

            // Bind a function to the 'x' on input forms.  this function collapses the form
            $('.collapse_answer_form').click(function(){
                $form = $(this).parent().parent();
                $form.removeClass('active');
                if($form.hasClass('is_edit_form')){
                    $form.hide();
                    answer_id = $(this).attr('id').split('_')[3];
                    console.debug(answer_id);
                    $answer = $("#answer_" + answer_id);
                    $answer.show();
                    $delete_form = $("#delete_form_" + answer_id);
                    $delete_form.show();
                    $edit_link = $("#edit_link_"  + answer_id);
                    $edit_link.show();
                }
                return false;
            });
            $('.edit_link').click(function(){
                answer_id = this.id.split('_')[2];
                $form = $("#edit_form_"  + answer_id);
                $form.show();
                $form.find('input:text, textarea').unbind('blur');
                $answer = $("#answer_"  + answer_id);
                $answer.hide();
                $delete_form = $("#delete_form_"  + answer_id);
                $delete_form.hide();
                $(this).hide();
                $form.find('input:text, textarea').focus();
                return false;
            });
            $("form.delete input").click(function(){
                return confirm('are you sure?');
            });
            ourJacker = new VoteHijacker();
            ourJacker.initialize();

            ourOtherJacker = new Want2HelpJacker();
            ourOtherJacker.initialize();
            
        });


var VoteHijacker = function() {};

VoteHijacker.prototype =
{
    initialize: function()
    {
        this.registerEventHandlers();
    },

    registerEventHandlers: function()
    {
        $('form.answervote').each(function() {
            var form = this;
            var answer__pk = /(\d+)$/.exec(form.id)[1];
            var action = /(up|down|clear)vote/.exec(form.action)[1];
            var prefix = 'answer';
            var options = {
                'dataType': 'json',
                'error': function(){
                    alert("Error voting: " + response.error_message);
                },
                'success': function createCallback(answer__pk, form) {
                    return function callback(response) {
                        if(!response.success){
                            if(response.error_message == "Not authenticated."){
                                alert("Please log in to vote.");
                            }
                            else{
                                alert("Error voting: " + response.error_message);
                            }
                            return;
                        }
                        var action = /(up|down|clear)vote/.exec(form.action)[1];
                        var upArrowType = "grey";
                        var upFormAction = "up";
                        var downArrowType = "grey";
                        var downFormAction = "down";

                        if (action == "up")
                        {
                            var upArrowType = "mod";
                            var upFormAction = "clear";
                        }
                        else if (action == "down")
                        {
                            var downArrowType = "mod";
                            var downFormAction = "clear";
                        }

                        VoteHijacker.updateArrow("up", prefix, answer__pk, upArrowType);
                        VoteHijacker.updateArrow("down", prefix, answer__pk, downArrowType);
                        VoteHijacker.updateFormAction("up", prefix, answer__pk, upFormAction);
                        VoteHijacker.updateFormAction("down", prefix, answer__pk, downFormAction);
                        VoteHijacker.updateScore(prefix, answer__pk, response.score);
                    };
                }(answer__pk, form)
            };
            $(this).ajaxForm(options);
        });
    }
};

VoteHijacker.arrowTooltipMessages = { 
    // $arrowType_$currentState: $messageToDisplay
    'down_grey': 'vote down', // grey means off, mod means on
    'up_grey': 'vote up',
    'down_mod': 'cancel vote',
    'up_mod': 'cancel vote'
};

VoteHijacker.updateArrow = function(arrowType, prefix, id, state)
{
    var $img = $('#' + prefix + arrowType + "arrow" + id);

    // Change the image source
    var img = $img.get(0);
    var re = new RegExp(arrowType + "(?:mod|grey)\\.png");
    img.src = img.src.replace(re, arrowType + state + ".png");

    // Change the tipsy text, which is stored in the title attribute
    var msg = VoteHijacker.arrowTooltipMessages[arrowType+"_"+state];
    $img.attr('title', msg);
    try{
        // fade out
        $img.getTipsy().fadeOut('slow', function() { $(this).remove(); });
    }
    catch (exception) {
        // silence errors
    }
};

VoteHijacker.updateFormAction = function(formType, prefix, id, action)
{
    var form = $('#' + prefix + formType + id).get(0);
    form.action = form.action.replace(/(?:up|down|clear)vote/, action + "vote");
};

VoteHijacker.updateScore = function(prefix, id, score)
{
    var scoreElement = $('#' + prefix + "score" + id).get(0);
    scoreElement.innerHTML = score.score;
    scoreElement.title = "after " + score.num_votes + " vote" + VoteHijacker.pluralize(score.num_votes);
};

VoteHijacker.pluralize = function(value)
{
    if (value != 1)
    {
        return "s";
    }
    return "";
};
</script>

<script type='text/javascript'>
function yay_we_want_to_help() {
   /* Create a tipsy-style message that reports success */
   var $tipsyMe = $('#wanna_help .body ul li:eq(0) a');

   /* Trigger tipsy destruction. */
   $('#wannahelp-button').getTipsy().remove();

   $('#want2help_form').remove();
   $('#next_steps_for_helpers').addClass('expanded').removeClass('collapsed');
}

$('#show, #hide').click(function () { $('.next_steps_for_helpers').toggleClass('collapsed').toggleClass('expanded'); });
$('#show').click(function () { $('#show_form').ajaxSubmit()});
$('#hide').click(function () { $('#hide_form').ajaxSubmit()});
$('#show_copypastebox').click(function() { $('#copypastebox').toggleDisplay(); return false; });

Want2HelpJacker = function () { }
Want2HelpJacker.prototype = {
    'initialize': function () {
        /* Hijack the 'I want to help' form so that it POST's asynchronously. */
        var options = {
            'url': "/+do/project.views.wanna_help_do",
            'type': 'POST',
            'success': function (response) {
                /* HACK! In the case that we need to log in, accept a message from the server
                 * indicating as much.
                 */
                if (response.substring(0, 10) === "redirect: ") {
                    var destination = response.substring(10);
                    document.location = destination;
                    return;
                }

                // otherwise, proceed as normal.

                /* Replace the list of person summaries. */
                $('#wanna_help').load(window.location + " #wanna_help")

                // Call the "Yay, we want to help" function
                yay_we_want_to_help();
            },
            'error': function () {
                $.jGrowl("Oops! Something went wrong. Please try again.");
            }
        };
        $('#want2help_form').ajaxForm(options);
        $('#want2help_form').find('input:submit').click(function () {
            $button = $(this);
            $button.val('Working...')
        });

    }
};

</script>



        
        

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-15096810-1");
pageTracker._trackPageview();
} catch(err) {}</script>
        

    </body>
</html>
