From a48bbee889af8d39b0ef907e1af746bc47fe053d Mon Sep 17 00:00:00 2001 From: klorpa <30924131+klorpa@users.noreply.github.com> Date: Wed, 27 Feb 2019 23:36:31 -0600 Subject: [PATCH] NotMuch --- artTools/vector_clothing_replicator.py | 8 --- artTools/vector_layer_split.py | 30 --------- artTools/vector_revamp_layer_split.py | 67 --------------------- src/facilities/farmyard/food/pFoodCrisis.tw | 12 ---- src/uncategorized/remoteSurgery.tw | 17 ------ 5 files changed, 134 deletions(-) diff --git a/artTools/vector_clothing_replicator.py b/artTools/vector_clothing_replicator.py index f4bd3ba53ef..6d3f0549be6 100644 --- a/artTools/vector_clothing_replicator.py +++ b/artTools/vector_clothing_replicator.py @@ -67,19 +67,11 @@ def get_points(xpath_shape): points = [] path_length = None for path_data in paths_data: -<<<<<<< HEAD p = parse_path(path_data) points += [ p.point(1.0/float(REFERENCE_PATH_SAMPLES)*i) for i in range(REFERENCE_PATH_SAMPLES) ] -======= - p = parse_path(path_data) - points += [ - p.point(1.0/float(REFERENCE_PATH_SAMPLES)*i) - for i in range(REFERENCE_PATH_SAMPLES) - ] ->>>>>>> 14b240a283262b8791485ed8f234dfbe31a62dc7 if (not points): raise RuntimeError( 'No paths for reference points found by selector "%s".'%(xpath_shape) diff --git a/artTools/vector_layer_split.py b/artTools/vector_layer_split.py index e6022ad7d34..abff29fc4a7 100644 --- a/artTools/vector_layer_split.py +++ b/artTools/vector_layer_split.py @@ -69,15 +69,9 @@ layers = tree.xpath('//svg:g',namespaces=ns) for layer in layers: i = layer.get('id') if ( # disregard non-content groups -<<<<<<< HEAD i.endswith("_") or # manually suppressed with underscore i.startswith("XMLID") or # Illustrator generated group i.startswith("g") # Inkscape generated group -======= - i.endswith("_") or # manually suppressed with underscore - i.startswith("XMLID") or # Illustrator generated group - i.startswith("g") # Inkscape generated group ->>>>>>> 14b240a283262b8791485ed8f234dfbe31a62dc7 ): continue # create new canvas @@ -92,7 +86,6 @@ for layer in layers: # TODO: extract only referenced defs (filters, gradients, ...) # TODO: detect necessity by traversing the elements. do not stupidly search in the string representation if ("filter:" in svg.decode('utf-8')): -<<<<<<< HEAD # it seems there is a filter referenced in the generated SVG, re-insert defs from main document canvas.insert(0,defs) # re-generate output @@ -114,29 +107,6 @@ for layer in layers: else: svg = svg.replace('<g ','<g transform="\'+_art_transform+\'"') # otherwise use default scaling svg = svg.encode('utf-8') -======= - # it seems there is a filter referenced in the generated SVG, re-insert defs from main document - canvas.insert(0,defs) - # re-generate output - svg = etree.tostring(output, pretty_print=False) - - if (output_format == 'tw'): - # remove unnecessary attributes - # TODO: never generate unnecessary attributes in the first place - svg = svg.decode('utf-8') - svg = regex_xmlns.sub('',svg) - svg = svg.replace(' inkscape:connector-curvature="0"','') # this just saves space - svg = svg.replace('\n','').replace('\r','') # print cannot be multi-line - svg = regex_space.sub('><',svg) # remove indentation - svg = svg.replace('svg:','') # svg namespace was removed - if ("Boob" in i): # internal groups are used for scaling - svg = svg.replace('<g ','<g transform="\'+_artTransformBoob+\'"') # boob art uses the boob scaling - elif ("Belly" in i): - svg = svg.replace('<g ','<g transform="\'+_artTransformBelly+\'"') # belly art uses the belly scaling - else: - svg = svg.replace('<g ','<g transform="\'+_art_transform+\'"') # otherwise use default scaling - svg = svg.encode('utf-8') ->>>>>>> 14b240a283262b8791485ed8f234dfbe31a62dc7 # save SVG string to file i = layer.get('id') diff --git a/artTools/vector_revamp_layer_split.py b/artTools/vector_revamp_layer_split.py index 6e66922a3c0..eee6817c4f8 100644 --- a/artTools/vector_revamp_layer_split.py +++ b/artTools/vector_revamp_layer_split.py @@ -74,7 +74,6 @@ regex_transformAttr = re.compile('transform="[^"]*"', ) # find all groups layers = tree.xpath('//svg:g', namespaces=ns) for layer in layers: -<<<<<<< HEAD i = layer.get('id') if ( # disregard non-content groups i.endswith("_") or # manually suppressed with underscore @@ -139,69 +138,3 @@ for layer in layers: f.write("<<print '<html>".encode("utf-8")) f.write(svg) f.write("</html>' >>".encode("utf-8")) -======= - i = layer.get('id') - if ( # disregard non-content groups - i.endswith("_") or # manually suppressed with underscore - i.startswith("XMLID") or # Illustrator generated group - i.startswith("g") # Inkscape generated group - ): - continue - # create new canvas - output = copy.deepcopy(template) - # copy all shapes into template - canvas = output.getroot() - for e in layer: - canvas.append(e) - # represent template as SVG (binary string) - svg = etree.tostring(output, pretty_print=False) - # poor man's conditional defs insertion - # TODO: extract only referenced defs (filters, gradients, ...) - # TODO: detect necessity by traversing the elements. do not stupidly search in the string representation - if ("filter:" in svg.decode('utf-8')): - # it seems there is a filter referenced in the generated SVG, re-insert defs from main document - canvas.insert(0, defs) - # re-generate output - svg = etree.tostring(output, pretty_print=False) - elif ("clip-path=" in svg.decode('utf-8')): - # it seems there is a clip path referenced in the generated SVG, re-insert defs from main document - canvas.insert(0, defs) - # re-generate output - svg = etree.tostring(output, pretty_print=False) - - if (output_format == 'tw'): - # remove unnecessary attributes - # TODO: never generate unnecessary attributes in the first place - svg = svg.decode('utf-8') - svg = regex_xmlns.sub('', svg) - svg = svg.replace(' inkscape:connector-curvature="0"', '') # this just saves space - svg = svg.replace('\n', '').replace('\r', '') # print cannot be multi-line - svg = regex_space.sub('><', svg) # remove indentation - svg = svg.replace('svg:', '') # svg namespace was removed - - transformGroups = regex_transformVar.findall(svg) - - if (len(transformGroups) > 0): - svg = regex_transformAttr.sub('', svg) - for transformGroup in transformGroups: - transformValue = regex_transformValue.search(transformGroup) - if (transformValue is not None): - svg = svg.replace(transformGroup, ' transform="\'+' + transformValue.group() + '+\'" ') # internal groups are used for scaling - - svg = svg.encode('utf-8') - - # save SVG string to file - i = layer.get('id') - output_path = os.path.join(output_directory, i + '.' + output_format) - with open(output_path, 'wb') as f: - if (output_format == 'svg'): - # Header for normal SVG (XML) - f.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'.encode("utf-8")) - f.write(svg) - elif (output_format == 'tw'): - # Header for SVG in Twine file (SugarCube print statement) - f.write((':: Art_Vector_Revamp_%s [nobr]\n\n' % (i)).encode("utf-8")) - f.write("<<print '<html>".encode("utf-8")) - f.write(svg) - f.write("</html>' >>".encode("utf-8")) ->>>>>>> 14b240a283262b8791485ed8f234dfbe31a62dc7 diff --git a/src/facilities/farmyard/food/pFoodCrisis.tw b/src/facilities/farmyard/food/pFoodCrisis.tw index 7b75065c161..83caafcd75f 100644 --- a/src/facilities/farmyard/food/pFoodCrisis.tw +++ b/src/facilities/farmyard/food/pFoodCrisis.tw @@ -35,11 +35,7 @@ <br><<link "Give them enough to survive on">> <<replace "#result">> You have your own problems to deal with, but that doesn't mean you don't look out for your own. You have a number of rationing stations set up throughout $arcologies[0].name and announce that each citizen is entitled to two full meals a day, just enough for your citizens not to starve. Your citizens are @@.green;happy@@ to hear that their leader is looking out for them. -<<<<<<< HEAD - <<run repX(500, "event")>> -======= <<run repX(2500, "event")>> ->>>>>>> 14b240a283262b8791485ed8f234dfbe31a62dc7 <<set cashX(forceNeg(_price), "farmyard")>> <<set $rations = 1>> <</replace>> <<if ($PC.trading >= 50) || ($PC.career == "capitalist")>>//This will cost <<print cashFormat(_price)>> and some upkeep, @@.springgreen;reduced by your knowledge of trading@@//<<else>>//This will cost <<print cashFormat(_price)>> and incur significant upkeep costs//<</if>> @@ -70,11 +66,7 @@ <br><<link "Provide them with enough sustenance to survive on too">> <<replace "#result">> As much as you'd like to provide them with all of the food in the world, it simply is not feasible in your current situation. Therefore, you announce to the leaders that you will provide them only enough rations to live off of. The leaders understand, and are @@.green;pleased@@ to hear that you would provide for them at all. -<<<<<<< HEAD - <<run repX(500, "event")>> -======= <<run repX(2500, "event")>> ->>>>>>> 14b240a283262b8791485ed8f234dfbe31a62dc7 <<set cashX(forceNeg(_price), "farmyard")>> <<set $rations = 3>> <</replace>> @@ -109,11 +101,7 @@ <br><<link "Politely decline their offer, but continue giving them rations">> <<replace "#result">> Things have been going fairly well for you, but not //that// well — setting up an entirely new place to buy, sell, and store food would no doubt be an expensive undertaking. You tell the citizens that while you can't spare the resources to create a new market at the moment, you will honor your past agreement and continue giving them free rations. The people initially seem a bit disappointed that you don't seem to want to expand $arcologies[0].name, but are ultimately @@.green;glad@@ to hear that you'll continue taking care of them. -<<<<<<< HEAD - <<run repX(500, "event")>> -======= <<run repX(2500, "event")>> ->>>>>>> 14b240a283262b8791485ed8f234dfbe31a62dc7 <<set cashX(forceNeg(_price), "farmyard")>> <<set $rations = 5>> <</replace>> diff --git a/src/uncategorized/remoteSurgery.tw b/src/uncategorized/remoteSurgery.tw index 7e75b4ffddb..70d25de441a 100644 --- a/src/uncategorized/remoteSurgery.tw +++ b/src/uncategorized/remoteSurgery.tw @@ -226,22 +226,6 @@ $He has <<else>> You done goofed. //Report This// <</if>> -<<<<<<< HEAD -<<if $activeSlave.earT != "none" && $seeExtreme == 1 && $activeSlave.indentureRestrictions < 1>> - [[Remove them|Surgery Degradation][$activeSlave.earT = "none", $cash -= $surgeryCost, $activeSlave.health -= 20, $surgeryType = "earGone"]] -<</if>> - -<<if $surgeryUpgrade == 1>><br> - Give $him: - <<if $activeSlave.earT != "neko">> - [[Cat Ears|Surgery Degradation][$activeSlave.earT = "neko", $activeSlave.earTColor = $activeSlave.hColor, $cash -= $surgeryCost, $activeSlave.health -= 10, $surgeryType = "earMajor"]]<</if>> - <<if $activeSlave.earT != "inu">> - | [[Dog Ears|Surgery Degradation][$activeSlave.earT = "inu", $activeSlave.earTColor = $activeSlave.hColor, $cash -= $surgeryCost, $activeSlave.health -= 10, $surgeryType = "earMajor"]]<</if>> - <<if $activeSlave.earT != "kit">> - | [[Fox Ears|Surgery Degradation][$activeSlave.earT = "kit", $activeSlave.earTColor = $activeSlave.hColor, $cash -= $surgeryCost, $activeSlave.health -= 10, $surgeryType = "earMajor"]]<</if>> - <<if $activeSlave.earT != "tanuki">> - | [[Tanuki Ears|Surgery Degradation][$activeSlave.earT = "tanuki", $activeSlave.earTColor = $activeSlave.hColor, $cash -= $surgeryCost, $activeSlave.health -= 10, $surgeryType = "earMajor"]]<</if>> -======= <<if $activeSlave.indentureRestrictions >= 2>> //$His indenture forbids elective surgery// <<else>> @@ -272,7 +256,6 @@ $He has [[Remove them|Surgery Degradation][$activeSlave.earTColor = "hairless", $cash -= $surgeryCost, $activeSlave.health -= 10, $surgeryType = "earMinor"]] <</if>> <</if>> ->>>>>>> 14b240a283262b8791485ed8f234dfbe31a62dc7 <</if>> <<if $activeSlave.earImplant == 1>> -- GitLab