~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/console/help.html

  • Committer: mattgiuca
  • Date: 2008-02-15 00:39:02 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:468
db.py: Epic Refactor.
Replaced all the user management methods with very generic methods that take
dictionaries and will work for any DB table. Essentially this now provides us
with a generic high-level database API.

Then put all the user management methods back in, as simple wrappers to the
generic methods.

The user management methods, however, have all had their interfaces changed.
They now take dictionaries of key:value pairs to be put in the DB instead of
arguments. This serves 2 purposes: firstly, it's MUCH easier to add new fields
now (2 or 3 points of control, down from about 7 points of control). Secondly,
it allows None (NULL in SQL) to be distinguished from omitted fields (this
particularly applies to update_user.

Notes: Preserved some of the changes (the self-closing object) from
    r466 [conway]. Most of these have been lost in the refactor, and are no
    longer necessary as dicts are now general (do not need to explicitly
    specify keys).

    I am committing this checkpoint even though it will break makeuser.
    Need to make major changes to that anyway, so it might as well be broken
    for the time being.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<p>The IVLE <strong>console</strong> is a programming console for python which 
2
 
provides features similar to the built in python command line console or <a 
3
 
href="http://en.wikipedia.org/wiki/IDLE_(Python)">IDLE GUI</a>.<p>
4
 
 
5
 
<h2>Getting Started with Console</h2>
6
 
<h3>Entering python code</h3>
7
 
<p>Using the console is fairly straight forward. Simply enter in any valid 
8
 
python code into the input text box located just to the right of the 
9
 
<code>&gt;&gt;&gt;</code> marks at the bottom of the screen. Once finished 
10
 
simply press ENTER to execute that line.</p>
11
 
<div class="example" style="border: solid 1px black; padding: 0.5em">
12
 
    <label id="console_prompt">&gt;&gt;&gt;&nbsp;</label>
13
 
    <input id="console_inputText"
14
 
      type="text" size="80" value="print 'Hello, world!'" readonly />
15
 
    <input type='button' value='Interrupt' disabled />
16
 
    <input type='button' value='Clear Output' disabled />
17
 
</div>
18
 
<p>Sometimes statements may expect more than 1 line, for example after an 
19
 
<code>if</code> or <code>for</code> statements. This is indicated by 
20
 
<code>...</code> to the left of the input box. Complete the command by typing 
21
 
in any additional lines and then press ENTER with an empty line to execute the 
22
 
code block.</p>
23
 
<p>Finally, some commands may expect input from the user (such as 
24
 
<code>raw_input() function</code>). In this case <code>+++</code> will be shown 
25
 
next to to the input text box to indicate that the console is expecting some 
26
 
input from the user.</p>
27
 
<h3>Console output</h3>
28
 
<div class="example">
29
 
    <div id="console_body">
30
 
        <div style="background-color: gray; border: 2px solid black; padding:       
31
 
        2px; color: black; font-family: monospace; font-weight: bold;">Python 
32
 
        Console</div>
33
 
    </div>
34
 
    <div style="overflow-y: scroll; margin: 0.5em">
35
 
        <code>
36
 
        <span style="color:#800">&gt;&gt;&gt;</span>
37
 
        <span style="color:gray">i</span><br/>
38
 
        <span style="color:red">name 'i' is not defined</span><br/>
39
 
        <span style="color:#800">&gt;&gt;&gt; </span>
40
 
        <span style="color:gray">i=2</span><br/>
41
 
        <span style="color:#800">&gt;&gt;&gt; </span>
42
 
        <span style="color:gray">print i</span><br/>
43
 
        2
44
 
        <code>
45
 
    </div>
46
 
    <div id="console_inputArea">
47
 
        <label id="console_prompt">&gt;&gt;&gt;&nbsp;</label>
48
 
        <input id="console_inputText" type="text" size="80" value="print i+2" 
49
 
        readonly />
50
 
        <input type='button' value='Interrupt' disabled />
51
 
        <input type='button' value='Clear Output' disabled />
52
 
    </div>
53
 
</div>
54
 
 
55
 
<p>All the commands you have entered as well as their output are shown in the 
56
 
text area above the input box. Lines beginning with a <code style="color: 
57
 
#800">&gt;&gt;&gt;</code> are your input lines, while lines in read (such as 
58
 
<code style="color: red">invalid syntax (&lt;input&gt;, line 1)
59
 
</code>) are errors or exceptions generated by your code.</p>
60
 
<h3>Console history</h3>
61
 
<p>You can also see all the lines you have previously entered into the console 
62
 
this session by pressing the UP arrow while in the text box. Pressing the DOWN 
63
 
arrow will show you more recent line histories or bring you back to your 
64
 
current line. You can even re-execute a line just by pressing the ENTER 
65
 
key.</p>
66
 
 
67
 
<h2>When things go wrong...</h2>
68
 
<h3>Interrupting commands</h3>
69
 
<p>It is possible to enter commands that will make the console become unusable 
70
 
or spend a long time attempting to run your command. (For example, infinite 
71
 
loops like <code>while True: print "Hello, world!"</code>). You can stop 
72
 
execution of a loop by clicking on the <emph>Interrupt</emph> button which will 
73
 
allow you to enter commands again.</p>
74
 
<h3>Restarting the console</h3>
75
 
<p>If things go really wrong, you can restart the console simply by clicking 
76
 
the <emph>Console</emph> button to start a new console. Be aware that you will 
77
 
loose all the variables and functions you had entered in to your previous 
78
 
console.</p>
 
1
<p>Console</p>
 
2
<p>TODO: Write Console help</p>