summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-04 19:55:56 +0200
committerhut <hut@lavabit.com>2010-04-04 19:55:56 +0200
commitda3b9d968682c220886c0e241b763f1d338d4a18 (patch)
tree4805a7e95d830082ad7fbce299b812efc5fa605d /ranger
parent3c041abb2ebc43d02f3990b5b7283170c5c728f5 (diff)
downloadranger-da3b9d968682c220886c0e241b763f1d338d4a18.tar.gz
core.actions: added set_option(optname, value) method
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 6eef3d41..ac28ed52 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -313,6 +313,10 @@ class Actions(EnvironmentAware, SettingsAware):
 		if isinstance(self.env.settings[string], bool):
 			self.env.settings[string] ^= True
 
+	def set_option(self, optname, value):
+		"""Set the value of an option named <optname>"""
+		self.env.settings[optname] = value
+
 	def sort(self, func=None, reverse=None):
 		if reverse is not None:
 			self.env.settings['sort_reverse'] = bool(reverse)
sion' href='/akkartik/mu/blame/subx/019functions.cc?h=hlt&id=01dada15c33dff954f3b76406fd9ed09ef4834c8'>^
069ed1c8 ^
62c6d163 ^
292ccba1 ^

069ed1c8 ^
292ccba1 ^







1f56ac64 ^
0cb988d0 ^
3ecd66fb ^
292ccba1 ^
871ea368 ^

292ccba1 ^





069ed1c8 ^
222c31db ^
292ccba1 ^

069ed1c8 ^
292ccba1 ^




ca00f6b9 ^
39c0d1b1 ^
0cb988d0 ^
3ecd66fb ^
292ccba1 ^
ca00f6b9 ^
39c0d1b1 ^
871ea368 ^
b6fdd2e4 ^
292ccba1 ^





0f851e48 ^

aa2e2155 ^
292ccba1 ^
ca00f6b9 ^
39c0d1b1 ^
0cb988d0 ^
292ccba1 ^
ca00f6b9 ^
39c0d1b1 ^
292ccba1 ^





069ed1c8 ^
292ccba1 ^
069ed1c8 ^
292ccba1 ^

1
2
3
4
5
6
7
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
52
53
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
79
80
81
82
83
84
85
86
87
88
89
90

         

                                          

                       
                    
      
                                           







                                                                                   
                                                 
                                  
                                                                    
                                                                   

                
                                                                 







                          
      
                                           
                                                                            
                 

                   





                                            
                                               
                                                   

                 
                                                                 




                           
                      
                      
                                           
                                                                             
                 
                         
                   
                   
                                           





                                    

                                                                     
 
               
                      
                      
                                           
    
                         
                   





                                   
                                        
              
                                                                 

        
//:: call

:(before "End Initialize Op Names")
put_new(Name, "e8", "call disp32 (call)");

:(scenario call_disp32)
% Reg[ESP].u = 0x64;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  e8                              a0 00 00 00  # call function offset at 0x000000a0
  # next EIP is 6
+run: call imm32 0x000000a0
+run: decrementing ESP to 0x00000060
+run: pushing value 0x00000006
+run: jumping to 0x000000a6

:(before "End Single-Byte Opcodes")
case 0xe8: {  // call disp32 relative to next EIP
  const int32_t offset = next32();
  trace(90, "run") << "call imm32 0x" << HEXWORD << offset << end();
//?   cerr << "push: EIP: " << EIP << " => " << Reg[ESP].u << '\n';
  push(EIP);
  EIP += offset;
  trace(90, "run") << "jumping to 0x" << HEXWORD << EIP << end();
  break;
}

//:

:(scenario call_r32)
% Reg[ESP].u = 0x64;
% Reg[EBX].u = 0x000000a0;
== 0x1
# op  ModR/M  SIB   displacement  immediate
  ff  d3                                       # call function offset at EBX
  # next EIP is 3
+run: call to r/m32
+run: r/m32 is EBX
+run: decrementing ESP to 0x00000060
+run: pushing value 0x00000003
+run: jumping to 0x000000a3

:(before "End Op ff Subops")
case 2: {  // call function pointer at r/m32
  trace(90, "run") << "call to r/m32" << end();
  const int32_t* offset = effective_address(modrm);
  push(EIP);
  EIP += *offset;
  trace(90, "run") << "jumping to 0x" << HEXWORD << EIP << end();
  break;
}

:(scenario call_mem_at_r32)
% Reg[ESP].u = 0x64;
% Reg[EBX].u = 0x2000;
== 0x1  # code segment
# op  ModR/M  SIB   displacement  immediate
  ff  13                                       # call function offset at *EBX
  # next EIP is 3
== 0x2000  # data segment
a0 00 00 00  # 0xa0
+run: call to r/m32
+run: effective address is 0x00002000 (EBX)
+run: decrementing ESP to 0x00000060
+run: pushing value 0x00000003
+run: jumping to 0x000000a3

//:: ret

:(before "End Initialize Op Names")
put_new(Name, "c3", "return from most recent unfinished call (ret)");

:(scenario ret)
% Reg[ESP].u = 0x2000;
== 0x1  # code segment
# op  ModR/M  SIB   displacement  immediate
  c3
== 0x2000  # data segment
10 00 00 00  # 0x10
+run: return
+run: popping value 0x00000010
+run: jumping to 0x00000010

:(before "End Single-Byte Opcodes")
case 0xc3: {  // return from a call
  trace(90, "run") << "return" << end();
  EIP = pop();
  trace(90, "run") << "jumping to 0x" << HEXWORD << EIP << end();
  break;
}