summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2016-07-09 02:32:21 -0400
committerJordan Wiens <jordan@psifertex.com>2016-07-09 02:32:21 -0400
commitb6b76645f0a5e7e631363c4b4ae6383993669abf (patch)
treed50eae258b98ae57b9b22164eeb0f3c1bacf74d6 /python
parentc85d93f505f53f921dd2d7b2d774ff75979261f7 (diff)
few small typos and add convenience getter/setter for function.name
Diffstat (limited to 'python')
-rw-r--r--python/__init__.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/python/__init__.py b/python/__init__.py
index fbe6fa61..98b16b95 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -192,7 +192,7 @@ class FileMetadata(object):
@property
def filename(self):
- """Backing filename"""
+ """Backing filename (read-only)"""
return core.BNGetFilename(self.handle)
@filename.setter
@@ -201,7 +201,7 @@ class FileMetadata(object):
@property
def modified(self):
- """Boolean result of whether the file is modified"""
+ """Boolean result of whether the file is modified (read-only)"""
return core.BNIsFileModified(self.handle)
@modified.setter
@@ -218,7 +218,7 @@ class FileMetadata(object):
@property
def has_database(self):
- """Whether the FileMetadata is backed by a database"""
+ """Whether the FileMetadata is backed by a database (read-only)"""
return core.BNIsBackedByDatabase(self.handle)
@property
@@ -231,7 +231,7 @@ class FileMetadata(object):
@property
def offset(self):
- """Current offset into the file"""
+ """Current offset into the file (read-only)"""
return core.BNGetCurrentOffset(self.handle)
@offset.setter
@@ -247,7 +247,7 @@ class FileMetadata(object):
@property
def saved(self):
- """Set to mark file as saved"""
+ """Boolean returns if the file has changed since last save. Set to mark whether the file is saved."""
return not core.BNIsFileModified(self.handle)
@saved.setter
@@ -2209,6 +2209,20 @@ class Function(object):
core.BNFreeFunction(self.handle)
@property
+ def name(self):
+ """Symbol name for the function"""
+ return self.symbol.name
+
+ @name.setter
+ def name(self,value):
+ if value is None:
+ if self.symbol is not None:
+ self.view.undefine_user_symbol(self.symbol)
+ else:
+ symbol = Symbol(FunctionSymbol,self.start,value)
+ self.view.define_user_symbol(symbol)
+
+ @property
def view(self):
"""Function view (read-only)"""
return self._view
@@ -2886,7 +2900,7 @@ class FunctionGraph(object):
@property
def function(self):
- """Function for a function graph(read-only)"""
+ """Function for a function graph (read-only)"""
func = core.BNGetFunctionForFunctionGraph(self.handle)
if func is None:
return None