Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python cleaning #4

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from distutils.core import setup
from py2exe import *
from glob import glob
import os

version = os.environ.get("version")
Expand Down Expand Up @@ -39,8 +38,6 @@ def __init__(self, **kw):
cmdline_style='pywin32'
)

#data_files = [("Microsoft.VC90.CRT", glob(r'redist\VC90\Microsoft.VC90.CRT-'+architecture+'\*.*'))]

setup(
version = version,
package_dir = {'': 'src'},
Expand Down
2 changes: 1 addition & 1 deletion src/WpkgConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os.path
import base64
import logging
import win32crypt, pywintypes
import win32crypt
import re
import datetime

Expand Down
1 change: 0 additions & 1 deletion src/WpkgNetworkHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def connect_to_network_share(self):
logger.info("Tried to connect to share '%s', but a connection already exists. Will disconnect, and retry." % self.network_share)
self.connected = True
self.disconnect_from_network_share()
pass
elif n == winerror.ERROR_BAD_NETPATH or n == winerror.ERROR_NETWORK_UNREACHABLE: # 53_ Network path not found | 1231Network location cannot be reached
# This can indicate that the network path was wrong, or that the network is not available yet
logger.info("An issue occured when connecting to '%s', the error code is %i and the error string is '%s'" % (self.network_share, n, e))
Expand Down
2 changes: 1 addition & 1 deletion src/WpkgPipeClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import pywintypes
import win32api
import winerror
import sys, os, traceback
import os

debug = 0
def setNetworkUser(username,password):
Expand Down
5 changes: 2 additions & 3 deletions src/WpkgServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import WpkgLGPUpdater
import WpkgTranslator
import WpkgConfig
import _winreg, logging, logging.handlers
import os.path, sys
import gettext
import logging, logging.handlers
import os.path

MY_PIPE_NAME = r"\\.\pipe\WPKG"
# From http://msdn.microsoft.com/en-us/library/aa379649%28VS.85%29.aspx
Expand Down
1 change: 0 additions & 1 deletion src/WpkgWriter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- encoding: utf-8 -*-
import sys
import logging
import win32file
import pywintypes
Expand Down
1 change: 0 additions & 1 deletion src/configobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def match_utf8(encoding):

try:
any
except NameError:
def any(iterable):
for entry in iterable:
if entry:
Expand Down
3 changes: 1 addition & 2 deletions src/reboot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# RebootServer.py
import win32security
import win32api
import sys, traceback
import time
from ntsecuritycon import *
import servicemanager
Expand Down Expand Up @@ -55,4 +54,4 @@ def AbortReboot():
print "Sleeping for 10 seconds"
time.sleep(10)
print "Aborting shutdown"
AbortReboot()
AbortReboot()