Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ jobs:
path: |
dist/*.whl

imports:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pip install isort pycln pyopengl
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think it doesn't require pyopengl installation everytime in the CI - can be added to the ignore list when there are even many internal imports? This one little demo anyway does a * star import, so doesn't help, and the demo doesn't change in eons.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for pycln to be able to analyse it (because it does a star import). But I can also add it to pycln ignores to not have to import it in CI if the CI job stays.

- run: pycln . --config=pycln.toml --check
- run: isort . --diff --check-only

black:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 6 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[isort]
py_version=37
profile = black
combine_as_imports = true
# TODO: Decide if this is wanted:
# combine_straight_imports = true
4 changes: 2 additions & 2 deletions AutoDuck/BuildHHP.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import sys
import glob
import os
import shutil
import sys

"""
BuildHHP.py
Expand Down
3 changes: 1 addition & 2 deletions AutoDuck/Dump2HHC.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import copy
import os
import sys
import pprint
import copy

"""
Dump2HHC.py
Expand Down
1 change: 0 additions & 1 deletion AutoDuck/InsertExternalOverviews.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import sys
import string

"""
Replace: <!--index:extopics-->
Expand Down
1 change: 0 additions & 1 deletion AutoDuck/TOCToHHK.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import os.path
import sys

Expand Down
4 changes: 1 addition & 3 deletions AutoDuck/document_object.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import sys

from xml.sax import make_parser, handler
from xml.sax import handler, make_parser


class categoryHandler(handler.ContentHandler):
Expand Down
5 changes: 4 additions & 1 deletion AutoDuck/fixHelpCompression.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# fixHelpCompression.py
# Add a compression option to the generated help project file.
import sys, os, win32api
import os
import sys

import win32api

fname = sys.argv[1]

Expand Down
4 changes: 3 additions & 1 deletion AutoDuck/makedfromi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import sys, string, os, getopt
import getopt
import os
import sys

# Run this passing a ".i" file as param. Will generate ".d"

Expand Down
2 changes: 1 addition & 1 deletion AutoDuck/py2d.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
import sys
import types
import re


def ad_escape(s):
Expand Down
4 changes: 2 additions & 2 deletions Pythonwin/Scintilla/src/LexGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# Does not regenerate the Visual C++ 6 project files but does the VS .NET
# project file.

import glob
import os
import string
import sys
import os
import glob

# EOL constants
CR = "\r"
Expand Down
12 changes: 6 additions & 6 deletions Pythonwin/pywin/Demos/app/basictimerapp.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# basictimerapp - a really simple timer application.
# This should be run using the command line:
# pythonwin /app demos\basictimerapp.py
import win32ui
import win32api
import win32con
import sys
from pywin.framework import app, cmdline, dlgappcore, cmdline
import timer
import time
import string

import timer
import win32api
import win32con
import win32ui
from pywin.framework import app, cmdline, dlgappcore


class TimerAppDialog(dlgappcore.AppDialog):
Expand Down
7 changes: 3 additions & 4 deletions Pythonwin/pywin/Demos/app/customprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@

# This sample was contributed by Roger Burnham.

from pywin.mfc import docview, dialog, afxres
from pywin.framework import app

import win32api
import win32con
import win32ui
import win32api
from pywin.framework import app
from pywin.mfc import afxres, dialog, docview

PRINTDLGORD = 1538
IDC_PRINT_MAG_EDIT = 1010
Expand Down
6 changes: 5 additions & 1 deletion Pythonwin/pywin/Demos/app/demoutils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Utilities for the demos

import sys, win32api, win32con, win32ui
import sys

import win32api
import win32con
import win32ui

NotScriptMsg = """\
This demo program is not designed to be run as a Script, but is
Expand Down
5 changes: 3 additions & 2 deletions Pythonwin/pywin/Demos/app/dlgappdemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
# This module must be specified on the commandline to PythonWin only.
# eg, PythonWin /app dlgappdemo.py

from pywin.framework import dlgappcore, app
import win32ui
import sys

import win32ui
from pywin.framework import app, dlgappcore


class TestDialogApp(dlgappcore.DialogApp):
def CreateDialog(self):
Expand Down
5 changes: 2 additions & 3 deletions Pythonwin/pywin/Demos/app/dojobapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
# This should be run using the command line:
# pythonwin /app demos\dojobapp.py

import win32ui

import win32api
import win32con
import sys
import win32ui
from pywin.framework import app, dlgappcore
import string


class DoJobAppDialog(dlgappcore.AppDialog):
Expand Down
3 changes: 2 additions & 1 deletion Pythonwin/pywin/Demos/app/helloapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@

import win32con
import win32ui
from pywin.mfc import window, dialog, afxres
from pywin.mfc import afxres, dialog, window
from pywin.mfc.thread import WinApp


# The main frame.
# Does almost nothing at all - doesnt even create a child window!
class HelloWindow(window.Wnd):
Expand Down
9 changes: 4 additions & 5 deletions Pythonwin/pywin/Demos/cmdserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

# Demo code that is not Pythonwin related, but too good to throw away...

import win32api
import _thread
import sys
from pywin.framework import winout

import _thread, sys

import traceback

import win32api
from pywin.framework import winout


class ThreadWriter:
"Assign an instance to sys.stdout for per-thread printing objects - Courtesy Guido!"
Expand Down
6 changes: 3 additions & 3 deletions Pythonwin/pywin/Demos/createwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
# the parameters to OnPaint are.
#

from pywin.mfc import dialog, window
import win32ui
import win32con
import win32api
import win32con
import win32ui
from pywin.mfc import dialog, window


class Control(window.Wnd):
Expand Down
6 changes: 5 additions & 1 deletion Pythonwin/pywin/Demos/demoutils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Utilities for the demos

import sys, win32api, win32con, win32ui
import sys

import win32api
import win32con
import win32ui

NotScriptMsg = """\
This demo program is not designed to be run as a Script, but is
Expand Down
6 changes: 3 additions & 3 deletions Pythonwin/pywin/Demos/dibdemo.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# A demo which creates a view and a frame which displays a PPM format bitmap
#
# This hasnnt been run in a while, as I dont have many of that format around!
import win32ui
import win32con

import win32api
import string
import win32con
import win32ui


class DIBView:
Expand Down
11 changes: 3 additions & 8 deletions Pythonwin/pywin/Demos/dlgtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@
#
# ID's for the tabstop dialog - out test.
#
from win32ui import IDD_SET_TABSTOPS
from win32ui import IDC_EDIT_TABS
from win32ui import IDC_PROMPT_TABS
from win32con import IDOK
from win32con import IDCANCEL

import win32ui
import win32con

import win32ui
from pywin.mfc import dialog
from win32con import IDCANCEL
from win32ui import IDC_EDIT_TABS, IDC_PROMPT_TABS, IDD_SET_TABSTOPS


class TestDialog(dialog.Dialog):
Expand Down
2 changes: 1 addition & 1 deletion Pythonwin/pywin/Demos/dyndlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# Parameter 6 - Extra data


import win32ui
import win32con
import win32ui
from pywin.mfc import dialog, window


Expand Down
6 changes: 2 additions & 4 deletions Pythonwin/pywin/Demos/fontdemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
# >>> f2 = {'name':'Courier New', 'height':24, 'italic':1}
# >>> d.SetFont (f2)

import win32ui
import win32con
import win32api

import win32con
import win32ui
from pywin.mfc import docview


# font is a dictionary in which the following elements matter:
# (the best matching font to supplied parameters is returned)
# name string name of the font as known by Windows
Expand Down
5 changes: 3 additions & 2 deletions Pythonwin/pywin/Demos/guidemo.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# GUI Demo - just a worker script to invoke all the other demo/test scripts.
import win32ui
import __main__
import sys

import __main__
import regutil
import win32api
import win32ui

demos = [ # ('Font', 'import fontdemo;fontdemo.FontDemo()'),
("Open GL Demo", "import openGLDemo;openGLDemo.test()"),
Expand Down
7 changes: 4 additions & 3 deletions Pythonwin/pywin/Demos/hiertest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import win32ui
import os
import commctrl

from pywin.tools import hierlist
import commctrl
import win32ui
from pywin.mfc import docview, window
from pywin.tools import hierlist


# directory listbox
# This has obvious limitations - doesnt track subdirs, etc. Demonstrates
Expand Down
2 changes: 1 addition & 1 deletion Pythonwin/pywin/Demos/menutest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Run this as a python script, to gray "close" off the edit window system menu.
from pywin.framework import interact
import win32con
from pywin.framework import interact

if __name__ == "__main__":
import demoutils
Expand Down
6 changes: 5 additions & 1 deletion Pythonwin/pywin/Demos/ocx/demoutils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Utilities for the demos

import sys, win32api, win32con, win32ui
import sys

import win32api
import win32con
import win32ui

NotScriptMsg = """\
This demo program is not designed to be run as a Script, but is
Expand Down
10 changes: 7 additions & 3 deletions Pythonwin/pywin/Demos/ocx/flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
# Update to the path of the .swf file (note it could be a true URL)
flash_url = "c:\\bounce.swf"

import win32ui, win32con, win32api, regutil
from pywin.mfc import window, activex
from win32com.client import gencache
import sys

import regutil
import win32api
import win32con
import win32ui
from pywin.mfc import activex, window
from win32com.client import gencache

FlashModule = gencache.EnsureModule("{D27CDB6B-AE6D-11CF-96B8-444553540000}", 0, 1, 0)

if FlashModule is None:
Expand Down
11 changes: 8 additions & 3 deletions Pythonwin/pywin/Demos/ocx/msoffice.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
# It is not comlpete yet, but it _does_ show an Excel spreadsheet in a frame!
#

import win32ui, win32uiole, win32con, regutil
from pywin.mfc import window, activex, object, docview
import regutil
import win32con
import win32ui
import win32uiole
from pywin.mfc import activex, docview, object, window
from win32com.client import gencache

# WordModule = gencache.EnsureModule('{00020905-0000-0000-C000-000000000046}', 1033, 8, 0)
Expand Down Expand Up @@ -132,7 +135,9 @@ def Create(self, title, rect=None, parent=None):


def Demo():
import sys, win32api
import sys

import win32api

docName = None
if len(sys.argv) > 1:
Expand Down
Loading