Skip to content

Commit

Permalink
Fixed issues in fork
Browse files Browse the repository at this point in the history
  • Loading branch information
Locercus committed Oct 3, 2015
1 parent 6ccb22e commit f8d3d84
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
screenshot.png
*.md.html
*.pyc
*.pyc
10 changes: 6 additions & 4 deletions checkdependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

dirname = os.path.dirname(__file__)
sys.path.append(os.path.join(dirname, "lib"))

import wireutils
wireutils.cprintconf.name = "Perdyshot"
wireutils.cprintconf.color= wireutils.bcolors.DARKCYAN
Expand All @@ -33,7 +34,7 @@ def hasModule(name):

def checkModule(name):
installed = hasModule(name)
wireutils.cprint("Module {name} installed: {installed}", name=name, installed=installed)
wireutils.cprint("Module {name} installed: {installed}", name = name, installed = installed)

return installed

Expand All @@ -51,7 +52,7 @@ def manualInstallNotify(name, tutorial):

def checkApplication(name, friendlyName, tutorial):
installed = spawn.find_executable(name) != None
wireutils.cprint("Executable {name} ({readable}) found: {installed} ", name=name, readable=friendlyName, installed=installed)
wireutils.cprint("Executable {name} ({readable}) found: {installed} ", name = name, readable = friendlyName, installed = installed)

if not installed:
manualInstallNotify(friendlyName, tutorial)
Expand All @@ -63,7 +64,7 @@ def checkApplication(name, friendlyName, tutorial):
try:
wireutils.cprint("""Perdyshot dependency checker
============================\n""",
strip=True)
strip = True)

ROOT = os.geteuid() == 0

Expand Down Expand Up @@ -103,4 +104,5 @@ def checkApplication(name, friendlyName, tutorial):


checkApplication("convert", "ImageMagick", "http://www.imagemagick.org/script/binary-releases.php")
except (KeyboardInterrupt, EOFError): print
except (KeyboardInterrupt, EOFError):
print
8 changes: 5 additions & 3 deletions cli/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from configobj import ConfigObj
from validate import Validator

import argparse, os, sys, signal, time, temppath
import argparse, os, sys, signal, time, tempfile

dirname = os.path.dirname(__file__)
sys.path.append(os.path.join(dirname, os.path.pardir, "lib"))

import wireutils
wireutils.cprintconf.name = "Perdyshot"
wireutils.cprintconf.color= wireutils.bcolors.DARKCYAN
Expand Down Expand Up @@ -38,7 +39,7 @@ def main(argSource):
config = ConfigObj(os.path.join(dirname, os.path.pardir, 'perdyshot.conf'), encoding = 'UTF8', configspec = os.path.join(dirname, os.path.pardir, 'perdyshot.conf.spec'))
validator = Validator()
if not config.validate(validator):
wireutils.cprint("Invalid configuration file", color=wireutils.bcolors.DARKRED)
wireutils.cprint("Invalid configuration file", color = wireutils.bcolors.DARKRED)
sys.exit(1)


Expand Down Expand Up @@ -428,6 +429,7 @@ def activate():
if __name__ == '__main__':
try:
main(sys.argv[1:])
except (KeyboardInterrupt, EOFError): print
except (KeyboardInterrupt, EOFError):
print

signal.signal(signal.SIGINT, signal.SIG_DFL)
14 changes: 7 additions & 7 deletions cli/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from configobj import ConfigObj
from validate import Validator

import argparse
import subprocess, time, sys, os, signal, argparse, tempfile

dirname = os.path.dirname(__file__)
sys.path.append(os.path.join(dirname, os.path.pardir, "lib"))

import wireutils
wireutils.cprintconf.name = "Perdyshot"
wireutils.cprintconf.color= wireutils.bcolors.DARKCYAN
Expand All @@ -16,8 +17,6 @@
# We use PIL for simple tasks and ImageMagick for computationally-heavy tasks
from PIL import Image, ImageOps

import subprocess, time, sys, os, signal

def main(argSource):
cwd = os.getcwd()

Expand Down Expand Up @@ -47,7 +46,7 @@ def main(argSource):
config = ConfigObj(os.path.join(dirname, os.path.pardir, 'perdyshot.conf'), encoding = 'UTF8', configspec = os.path.join(dirname, os.path.pardir, 'perdyshot.conf.spec'))
validator = Validator()
if not config.validate(validator):
wireutils.cprint("Invalid configuration file", color=wireutils.bcolors.DARKRED)
wireutils.cprint("Invalid configuration file", color = wireutils.bcolors.DARKRED)
sys.exit(1)


Expand Down Expand Up @@ -80,7 +79,7 @@ def pixbuf2image(pix):
window = root.get_active_window()

if window == None:
wireutils.cprint("Failed to capture window, exiting.", color=wireutils.bcolors.DARKRED)
wireutils.cprint("Failed to capture window, exiting.", color = wireutils.bcolors.DARKRED)
sys.exit(1)

# And its geometry
Expand Down Expand Up @@ -340,12 +339,13 @@ def pixbuf2image(pix):
wireutils.cprint("Post-processing time: %.2f seconds" % (totalTime - partialTime))
wireutils.cprint("Total time: %.2f seconds" % (totalTime - startTime))
print
wireutils.cprint("Saved as {fname}.", fname=filename)
wireutils.cprint("Saved as {name}.", name = filename)


if __name__ == '__main__':
try:
main(sys.argv[1:])
except (KeyboardInterrupt, EOFError): print
except (KeyboardInterrupt, EOFError):
print

signal.signal(signal.SIGINT, signal.SIG_DFL)

0 comments on commit f8d3d84

Please sign in to comment.