From 3e6f96cfe39a2e31a8267f343d87d31de56e8f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= Date: Wed, 19 Aug 2015 17:48:03 +0300 Subject: [PATCH 1/2] pull up webkit only to cli options --- gradify.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gradify.py b/gradify.py index 4b67f65..5f4d9af 100644 --- a/gradify.py +++ b/gradify.py @@ -13,7 +13,7 @@ class Gradify(): """ # Cross browser prefixes. - BROWSER_PREFIXES = ["", "-webkit-", "-moz-", "-o-", "-ms-"] + BROWSER_PREFIXES = ["-webkit-", "-moz-", "-o-", "-ms-", ""] # Demo browser execution DEMO_CMD = { @@ -35,8 +35,8 @@ def __init__(self, black_sensitivity=4.3, white_sensitivity = 3, num_colors=4, r self.num_done = 0 - if webkit_only: - self.BROWSER_PREFIXES= ["-webkit-"] + if self.args.webkit_only or webkit_only: + self.BROWSER_PREFIXES= ["-webkit-", ""] self.IGNORED_COLORS = { "BLACK": { @@ -76,6 +76,7 @@ def init_CLI_args(self): self.parser.add_argument("-f", "--file", help="Gradify single file") self.parser.add_argument("-c", "--classname", help="Specific classname of CSS to add gradients to (default is 'gradify')") self.parser.add_argument("--demo", help="Create example HTML file displaying results, opens when completed", action="store_true") + self.parser.add_argument("--webkit-only", help="Generate css for webkit only", action="store_true") self.args = self.parser.parse_args() return From 56f46f76711641fe97b075df8c0c1c2cf695910c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= Date: Wed, 19 Aug 2015 17:50:09 +0300 Subject: [PATCH 2/2] fix --- gradify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gradify.py b/gradify.py index 5f4d9af..0a6b387 100644 --- a/gradify.py +++ b/gradify.py @@ -35,6 +35,8 @@ def __init__(self, black_sensitivity=4.3, white_sensitivity = 3, num_colors=4, r self.num_done = 0 + self.init_CLI_args() + if self.args.webkit_only or webkit_only: self.BROWSER_PREFIXES= ["-webkit-", ""] @@ -48,7 +50,6 @@ def __init__(self, black_sensitivity=4.3, white_sensitivity = 3, num_colors=4, r "radius": white_sensitivity } } - self.init_CLI_args() if self.args.demo: self.demo_file = "demo.html"