Skip to content

Commit

Permalink
Replace tabs with spaces in strings (#2167)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Jan 15, 2024
1 parent 0bbc2bc commit bc22bb8
Show file tree
Hide file tree
Showing 13 changed files with 289 additions and 289 deletions.
2 changes: 1 addition & 1 deletion Pythonwin/pywin/Demos/guidemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
("Dynamic window creation", "import createwin;createwin.demo()"),
("Various Dialog demos", "import dlgtest;dlgtest.demo()"),
("OCX Control Demo", "from ocx import ocxtest;ocxtest.demo()"),
("OCX Serial Port Demo", "from ocx import ocxserialtest; ocxserialtest.test()"),
("OCX Serial Port Demo", "from ocx import ocxserialtest; ocxserialtest.test()"),
(
"IE4 Control Demo",
'from ocx import webbrowser; webbrowser.Demo("http://www.python.org")',
Expand Down
18 changes: 9 additions & 9 deletions Pythonwin/pywin/docking/DockingBar.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,15 @@ def OnWindowPosChanged(self, msg):
return 0
lparam = msg[3]
""" LPARAM used with WM_WINDOWPOSCHANGED:
typedef struct {
HWND hwnd;
HWND hwndInsertAfter;
int x;
int y;
int cx;
int cy;
UINT flags;} WINDOWPOS;
"""
typedef struct {
HWND hwnd;
HWND hwndInsertAfter;
int x;
int y;
int cx;
int cy;
UINT flags;} WINDOWPOS;
"""
format = "PPiiiii"
bytes = win32ui.GetBytes(lparam, struct.calcsize(format))
hwnd, hwndAfter, x, y, cx, cy, flags = struct.unpack(format, bytes)
Expand Down
48 changes: 24 additions & 24 deletions Pythonwin/pywin/scintilla/IDLEenvironment.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,30 +533,30 @@ def test():
e.SetSel((4, 4))

skip = """
TestCheck("insert", e, 4)
TestCheck("insert wordstart", e, 3)
TestCheck("insert wordend", e, 8)
TestCheck("insert linestart", e, 0)
TestCheck("insert lineend", e, 12)
TestCheck("insert + 4 chars", e, 8)
TestCheck("insert +4c", e, 8)
TestCheck("insert - 2 chars", e, 2)
TestCheck("insert -2c", e, 2)
TestCheck("insert-2c", e, 2)
TestCheck("insert-2 c", e, 2)
TestCheck("insert- 2c", e, 2)
TestCheck("1.1", e, 1)
TestCheck("1.0", e, 0)
TestCheck("2.0", e, 13)
try:
TestCheck("sel.first", e, 0)
print("*** sel.first worked with an empty selection")
except TextError:
pass
e.SetSel((4,5))
TestCheck("sel.first- 2c", e, 2)
TestCheck("sel.last- 2c", e, 3)
"""
TestCheck("insert", e, 4)
TestCheck("insert wordstart", e, 3)
TestCheck("insert wordend", e, 8)
TestCheck("insert linestart", e, 0)
TestCheck("insert lineend", e, 12)
TestCheck("insert + 4 chars", e, 8)
TestCheck("insert +4c", e, 8)
TestCheck("insert - 2 chars", e, 2)
TestCheck("insert -2c", e, 2)
TestCheck("insert-2c", e, 2)
TestCheck("insert-2 c", e, 2)
TestCheck("insert- 2c", e, 2)
TestCheck("1.1", e, 1)
TestCheck("1.0", e, 0)
TestCheck("2.0", e, 13)
try:
TestCheck("sel.first", e, 0)
print("*** sel.first worked with an empty selection")
except TextError:
pass
e.SetSel((4,5))
TestCheck("sel.first- 2c", e, 2)
TestCheck("sel.last- 2c", e, 3)
"""
# Check EOL semantics
e.SetSel((4, 4))
TestGet("insert lineend", "insert lineend +1c", t, "\n")
Expand Down
10 changes: 5 additions & 5 deletions com/win32com/client/gencache.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,12 @@ def _Dump():

def usage():
usageString = """\
Usage: gencache [-q] [-d] [-r]
Usage: gencache [-q] [-d] [-r]
-q - Quiet
-d - Dump the cache (typelibrary description and filename).
-r - Rebuild the cache dictionary from the existing .py files
"""
-q - Quiet
-d - Dump the cache (typelibrary description and filename).
-r - Rebuild the cache dictionary from the existing .py files
"""
print(usageString)
sys.exit(1)

Expand Down
50 changes: 25 additions & 25 deletions com/win32com/makegw/makegw.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ def _write_ifc_h(f, interface):
class Py{interface.name} : public Py{interface.base}
{{
public:
MAKE_PYCOM_CTOR(Py{interface.name});
static {interface.name} *GetI(PyObject *self);
static PyComTypeObject type;
MAKE_PYCOM_CTOR(Py{interface.name});
static {interface.name} *GetI(PyObject *self);
static PyComTypeObject type;
// The Python methods
// The Python methods
"""
)
for method in interface.methods:
Expand All @@ -159,8 +159,8 @@ class Py{interface.name} : public Py{interface.base}
f"""\
protected:
Py{interface.name}(IUnknown *pdisp);
~Py{interface.name}();
Py{interface.name}(IUnknown *pdisp);
~Py{interface.name}();
}};
"""
)
Expand All @@ -175,9 +175,9 @@ def _write_ifc_cpp(f, interface):
// Interface Implementation
Py{name}::Py{name}(IUnknown *pdisp):
Py{base}(pdisp)
Py{base}(pdisp)
{{
ob_type = &type;
ob_type = &type;
}}
Py{name}::~Py{name}()
Expand All @@ -186,7 +186,7 @@ def _write_ifc_cpp(f, interface):
/* static */ {name} *Py{name}::GetI(PyObject *self)
{{
return ({name} *)Py{base}::GetI(self);
return ({name} *)Py{base}::GetI(self);
}}
""".format(
Expand All @@ -203,9 +203,9 @@ def _write_ifc_cpp(f, interface):
// @pymethod |Py{interfacename}|{method}|Description of {method}.
PyObject *Py{interfacename}::{method}(PyObject *self, PyObject *args)
{{
{interfacename} *p{ptr} = GetI(self);
if ( p{ptr} == NULL )
return NULL;
{interfacename} *p{ptr} = GetI(self);
if ( p{ptr} == NULL )
return NULL;
""".format(
**strdict
)
Expand Down Expand Up @@ -282,14 +282,14 @@ def _write_ifc_cpp(f, interface):
strdict["cleanup"] = cleanup
strdict["cleanup_gil"] = cleanup_gil
f.write(
""" HRESULT hr;
PY_INTERFACE_PRECALL;
hr = p{ptr}->{method}({argsCOM} );
""" HRESULT hr;
PY_INTERFACE_PRECALL;
hr = p{ptr}->{method}({argsCOM} );
{cleanup}
PY_INTERFACE_POSTCALL;
PY_INTERFACE_POSTCALL;
{cleanup_gil}
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, p{ptr}, IID_{interfacename} );
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, p{ptr}, IID_{interfacename} );
""".format(
**strdict
)
Expand Down Expand Up @@ -336,14 +336,14 @@ def _write_ifc_cpp(f, interface):
interfacebase = interface.base
f.write(
"""\
{{ NULL }}
{{ NULL }}
}};
PyComTypeObject Py{name}::type("Py{name}",
&Py{interfacebase}::type,
sizeof(Py{name}),
Py{name}_methods,
GET_PYCOM_CTOR(Py{name}));
&Py{interfacebase}::type,
sizeof(Py{name}),
Py{name}_methods,
GET_PYCOM_CTOR(Py{name}));
""".format(
**locals()
)
Expand Down Expand Up @@ -372,8 +372,8 @@ def _write_gw_h(f, interface):
class {gname} : public {base_name}, public {name}
{{
protected:
{gname}(PyObject *instance) : {base_name}(instance) {{ ; }}
PYGATEWAY_MAKE_SUPPORT2({gname}, {name}, IID_{name}, {base_name})
{gname}(PyObject *instance) : {base_name}(instance) {{ ; }}
PYGATEWAY_MAKE_SUPPORT2({gname}, {name}, IID_{name}, {base_name})
"""
)
Expand Down
Loading

0 comments on commit bc22bb8

Please sign in to comment.