Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
3381a06c
Commit
3381a06c
authored
9 years ago
by
Gigg, Martyn Anthony
Browse files
Options
Downloads
Patches
Plain Diff
Add a closed method to the Python environment in MantidPlot
This allows it to closer mimic a file-like object.
parent
0d87a244
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
MantidPlot/src/PythonScript.h
+3
-1
3 additions, 1 deletion
MantidPlot/src/PythonScript.h
MantidPlot/src/PythonScripting.h
+4
-2
4 additions, 2 deletions
MantidPlot/src/PythonScripting.h
MantidPlot/src/qti.sip
+6
-2
6 additions, 2 deletions
MantidPlot/src/qti.sip
with
13 additions
and
5 deletions
MantidPlot/src/PythonScript.h
+
3
−
1
View file @
3381a06c
...
@@ -66,8 +66,10 @@ public:
...
@@ -66,8 +66,10 @@ public:
// -------------------------- Print/error message handling ------------------
// -------------------------- Print/error message handling ------------------
/// Connects the python stdout to a Qt signal
/// Connects the python stdout to a Qt signal
inline
void
write
(
const
QString
&
text
)
{
emit
print
(
text
);
}
inline
void
write
(
const
QString
&
text
)
{
emit
print
(
text
);
}
///
'Fake' method need
ed for IPython
import
///
Simulate file-like object (requir
ed for IPython
)
inline
void
flush
()
{}
inline
void
flush
()
{}
/// Simulate file-like object (required for colorama)
inline
bool
closed
()
{
return
false
;
}
/// Is the given code complete
/// Is the given code complete
bool
compilesToCompleteStatement
(
const
QString
&
code
)
const
;
bool
compilesToCompleteStatement
(
const
QString
&
code
)
const
;
...
...
This diff is collapsed.
Click to expand it.
MantidPlot/src/PythonScripting.h
+
4
−
2
View file @
3381a06c
...
@@ -52,8 +52,10 @@ public:
...
@@ -52,8 +52,10 @@ public:
~
PythonScripting
();
~
PythonScripting
();
/// Write text to std out
/// Write text to std out
void
write
(
const
QString
&
text
)
{
emit
print
(
text
);
}
void
write
(
const
QString
&
text
)
{
emit
print
(
text
);
}
/// 'Fake' method needed for IPython import
/// Simulate file-like object (required for IPython)
void
flush
()
{}
inline
void
flush
()
{}
/// Simulate file-like object (required for colorama)
inline
bool
closed
()
{
return
false
;
}
/// 'Fake' method needed for IPython import
/// 'Fake' method needed for IPython import
void
set_parent
(
PyObject
*
)
{}
void
set_parent
(
PyObject
*
)
{}
...
...
This diff is collapsed.
Click to expand it.
MantidPlot/src/qti.sip
+
6
−
2
View file @
3381a06c
...
@@ -1287,8 +1287,10 @@ class PythonScripting
...
@@ -1287,8 +1287,10 @@ class PythonScripting
%
End
%
End
public:
public:
void
write
(
const
QString
&
);
void
write
(
const
QString
&
);
//
'Fake' methods need
ed for IPython
import
//
Simulate file-like object (requir
ed for IPython
)
void
flush
();
void
flush
();
// Simulate file-like object (required for colorama)
bool
closed
();
void
set_parent
(
SIP_PYOBJECT
);
void
set_parent
(
SIP_PYOBJECT
);
private:
private:
PythonScripting
(
const
PythonScripting
&
);
PythonScripting
(
const
PythonScripting
&
);
...
@@ -1300,8 +1302,10 @@ class PythonScript
...
@@ -1300,8 +1302,10 @@ class PythonScript
%
End
%
End
public:
public:
void
write
(
const
QString
&
);
void
write
(
const
QString
&
);
//
'Fake' method need
ed for IPython
import
//
Simulate file-like object (requir
ed for IPython
)
void
flush
();
void
flush
();
// Simulate file-like object (required for colorama)
bool
closed
();
// Line number trace
// Line number trace
void
lineNumberChanged
(
SIP_PYOBJECT
,
int
);
void
lineNumberChanged
(
SIP_PYOBJECT
,
int
);
private:
private:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment