style cleanup: pep8, indentation

This commit is contained in:
Campbell Barton
2012-03-24 07:36:32 +00:00
parent 29806d3bcf
commit 81d8f17843
30 changed files with 167 additions and 168 deletions

View File

@@ -131,7 +131,7 @@ def handle_args():
dest="sphinx_theme", dest="sphinx_theme",
type=str, type=str,
default='default', default='default',
help= help =
# see SPHINX_THEMES below # see SPHINX_THEMES below
"Sphinx theme (default='default')\n" "Sphinx theme (default='default')\n"
"Available themes\n" "Available themes\n"
@@ -448,6 +448,7 @@ else:
def is_struct_seq(value): def is_struct_seq(value):
return isinstance(value, tuple) and type(tuple) != tuple and hasattr(value, "n_fields") return isinstance(value, tuple) and type(tuple) != tuple and hasattr(value, "n_fields")
def undocumented_message(module_name, type_name, identifier): def undocumented_message(module_name, type_name, identifier):
if str(type_name).startswith('<module'): if str(type_name).startswith('<module'):
preloadtitle = '%s.%s' % (module_name, identifier) preloadtitle = '%s.%s' % (module_name, identifier)
@@ -692,6 +693,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
# TODO - currently only used for classes # TODO - currently only used for classes
# grouping support # grouping support
module_grouping = MODULE_GROUPING.get(module_name) module_grouping = MODULE_GROUPING.get(module_name)
def module_grouping_index(name): def module_grouping_index(name):
if module_grouping is not None: if module_grouping is not None:
try: try:
@@ -711,7 +713,6 @@ def pymodule2sphinx(basepath, module_name, module, title):
return module_grouping_index(name) return module_grouping_index(name)
# done grouping support # done grouping support
file = open(filepath, "w", encoding="utf-8") file = open(filepath, "w", encoding="utf-8")
fw = file.write fw = file.write

View File

@@ -22,6 +22,7 @@ import bpy
from bpy.types import Menu, Operator from bpy.types import Menu, Operator
from bpy.props import StringProperty, BoolProperty from bpy.props import StringProperty, BoolProperty
class AddPresetBase(): class AddPresetBase():
'''Base preset class, only for subclassing '''Base preset class, only for subclassing
subclasses must define subclasses must define

View File

@@ -1088,6 +1088,7 @@ class VIEW3D_MT_brush(Menu):
layout.prop(brush, "use_persistent") layout.prop(brush, "use_persistent")
layout.operator("sculpt.set_persistent_base") layout.operator("sculpt.set_persistent_base")
class VIEW3D_MT_brush_paint_modes(Menu): class VIEW3D_MT_brush_paint_modes(Menu):
bl_label = "Enabled Modes" bl_label = "Enabled Modes"

View File

@@ -538,8 +538,7 @@ typedef struct FT_Outline_
short* contours; /* the contour end points */ short* contours; /* the contour end points */
int flags; /* outline masks */ int flags; /* outline masks */
} FT_Outline;
} FT_Outline;
#endif #endif

View File

@@ -288,7 +288,7 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
if (BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel -= 1; if (BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel -= 1;
BM_elem_flag_disable(e, BM_ELEM_SELECT); BM_elem_flag_disable(e, BM_ELEM_SELECT);
if ( bm->selectmode == SCE_SELECT_EDGE || if (bm->selectmode == SCE_SELECT_EDGE ||
bm->selectmode == SCE_SELECT_FACE || bm->selectmode == SCE_SELECT_FACE ||
bm->selectmode == (SCE_SELECT_EDGE | SCE_SELECT_FACE)) bm->selectmode == (SCE_SELECT_EDGE | SCE_SELECT_FACE))
{ {

View File

@@ -73,15 +73,15 @@ static GPUBufferState GLStates = 0;
static GPUAttrib attribData[MAX_GPU_ATTRIB_DATA] = { { -1, 0, 0 } }; static GPUAttrib attribData[MAX_GPU_ATTRIB_DATA] = { { -1, 0, 0 } };
/* stores recently-deleted buffers so that new buffers won't have to /* stores recently-deleted buffers so that new buffers won't have to
be recreated as often * be recreated as often
*
only one instance of this pool is created, stored in * only one instance of this pool is created, stored in
gpu_buffer_pool * gpu_buffer_pool
*
note that the number of buffers in the pool is usually limited to * note that the number of buffers in the pool is usually limited to
MAX_FREE_GPU_BUFFERS, but this limit may be exceeded temporarily * MAX_FREE_GPU_BUFFERS, but this limit may be exceeded temporarily
when a GPUBuffer is released outside the main thread; due to OpenGL * when a GPUBuffer is released outside the main thread; due to OpenGL
restrictions it cannot be immediately released * restrictions it cannot be immediately released
*/ */
typedef struct GPUBufferPool { typedef struct GPUBufferPool {
/* number of allocated buffers stored */ /* number of allocated buffers stored */
@@ -160,7 +160,7 @@ static void gpu_buffer_pool_free(GPUBufferPool *pool)
if (!pool) if (!pool)
return; return;
while(pool->totbuf) while (pool->totbuf)
gpu_buffer_pool_delete_last(pool); gpu_buffer_pool_delete_last(pool);
MEM_freeN(pool->buffers); MEM_freeN(pool->buffers);
@@ -248,7 +248,7 @@ GPUBuffer *GPU_buffer_alloc(int size)
out-of-memory errors? looks a bit iffy to me out-of-memory errors? looks a bit iffy to me
though, at least on Linux I expect malloc() would though, at least on Linux I expect malloc() would
just overcommit. --nicholas */ just overcommit. --nicholas */
while(!buf->pointer && pool->totbuf > 0) { while (!buf->pointer && pool->totbuf > 0) {
gpu_buffer_pool_delete_last(pool); gpu_buffer_pool_delete_last(pool);
buf->pointer = MEM_mallocN(size, "GPUBuffer.pointer"); buf->pointer = MEM_mallocN(size, "GPUBuffer.pointer");
} }
@@ -279,7 +279,7 @@ void GPU_buffer_free(GPUBuffer *buffer)
if (BLI_thread_is_main()) { if (BLI_thread_is_main()) {
/* in main thread, safe to decrease size of pool back /* in main thread, safe to decrease size of pool back
down to MAX_FREE_GPU_BUFFERS */ down to MAX_FREE_GPU_BUFFERS */
while(pool->totbuf >= MAX_FREE_GPU_BUFFERS) while (pool->totbuf >= MAX_FREE_GPU_BUFFERS)
gpu_buffer_pool_delete_last(pool); gpu_buffer_pool_delete_last(pool);
} }
else { else {
@@ -507,7 +507,7 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object,
if (useVBOs) { if (useVBOs) {
success = 0; success = 0;
while(!success) { while (!success) {
/* bind the buffer and discard previous data, /* bind the buffer and discard previous data,
avoids stalling gpu */ avoids stalling gpu */
glBindBufferARB(target, buffer->id); glBindBufferARB(target, buffer->id);
@@ -543,7 +543,7 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object,
if (dm->drawObject->legacy == 0) { if (dm->drawObject->legacy == 0) {
uploaded = GL_FALSE; uploaded = GL_FALSE;
/* attempt to upload the data to the VBO */ /* attempt to upload the data to the VBO */
while(uploaded == GL_FALSE) { while (uploaded == GL_FALSE) {
(*copy_f)(dm, varray, cur_index_per_mat, mat_orig_to_new, user); (*copy_f)(dm, varray, cur_index_per_mat, mat_orig_to_new, user);
/* glUnmapBuffer returns GL_FALSE if /* glUnmapBuffer returns GL_FALSE if
* the data store is corrupted; retry * the data store is corrupted; retry
@@ -1161,8 +1161,8 @@ void GPU_buffer_unbind(void)
} }
/* confusion: code in cdderivedmesh calls both GPU_color_setup and /* confusion: code in cdderivedmesh calls both GPU_color_setup and
GPU_color3_upload; both of these set the `colors' buffer, so seems * GPU_color3_upload; both of these set the `colors' buffer, so seems
like it will just needlessly overwrite? --nicholas */ * like it will just needlessly overwrite? --nicholas */
void GPU_color3_upload(DerivedMesh *dm, unsigned char *data) void GPU_color3_upload(DerivedMesh *dm, unsigned char *data)
{ {
if (dm->drawObject == 0) if (dm->drawObject == 0)

View File

@@ -245,9 +245,6 @@ CExpression* COperator2Expr::CheckLink(std::vector<CBrokenLinkInfo*>& brokenlink
*/ */
return Release(); return Release();
} }

View File

@@ -62,7 +62,7 @@ void SCA_IInputDevice::ClearStatusTable(int tableid)
const SCA_InputEvent& SCA_IInputDevice::GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode) const SCA_InputEvent& SCA_IInputDevice::GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)
{ {
// cerr << "SCA_IInputDevice::GetEventValue" << endl; // cerr << "SCA_IInputDevice::GetEventValue" << endl;
return m_eventStatusTables[m_currentTable][inputcode]; return m_eventStatusTables[m_currentTable][inputcode];
} }

View File

@@ -64,7 +64,7 @@ SCA_IInputDevice* SCA_KeyboardManager::GetInputDevice()
void SCA_KeyboardManager::NextFrame() void SCA_KeyboardManager::NextFrame()
{ {
//const SCA_InputEvent& event = GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0; //const SCA_InputEvent& event = GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0;
// cerr << "SCA_KeyboardManager::NextFrame"<< endl; // cerr << "SCA_KeyboardManager::NextFrame"<< endl;
SG_DList::iterator<SCA_ISensor> it(m_sensors); SG_DList::iterator<SCA_ISensor> it(m_sensors);
for (it.begin();!it.end();++it) for (it.begin();!it.end();++it)
{ {