From 7113bab80df32b20979e9e235586f65627a82618 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 27 May 2013 20:21:21 +0300 Subject: Remap technicianName --- gsxws/repairs.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gsxws') diff --git a/gsxws/repairs.py b/gsxws/repairs.py index 4b752ab..878d4ab 100644 --- a/gsxws/repairs.py +++ b/gsxws/repairs.py @@ -248,6 +248,10 @@ class IndirectOnsiteRepair(Repair): self.purchaseOrderNumber = self.poNumber del(self._data['poNumber']) + if getattr(self, "diagnosedByTechId"): + self.technicianName = self.diagnosedByTechId + del(self._data['diagnosedByTechId']) + return self._submit("repairData", "CreateIndirectOnsiteRepair", "repairConfirmation") -- cgit v1.2.3 From 591a3ae6ec8e7170157bc90ae55eef4ca7f735b0 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Sat, 1 Jun 2013 10:21:35 +0300 Subject: Use separate cache file for each session --- gsxws/core.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'gsxws') diff --git a/gsxws/core.py b/gsxws/core.py index f586606..a49ea6f 100644 --- a/gsxws/core.py +++ b/gsxws/core.py @@ -145,40 +145,42 @@ class GsxError(Exception): class GsxCache(object): """ - >>> GsxCache('spam').set('eggs').get() + The cache creates a separate shelf for each GSX session. + + >>> GsxCache('test').set('spam', 'eggs').get('spam') 'eggs' """ shelf = None tmpdir = tempfile.gettempdir() - filename = os.path.join(tmpdir, "gsxws.tmp") def __init__(self, key, expires=timedelta(minutes=20)): self.key = key self.expires = expires - self.shelf = shelve.open(self.filename, protocol=-1) self.now = datetime.now() + filename = os.path.join(self.tmpdir, "gsxws_%s.db" % key) + self.shelf = shelve.open(filename, protocol=-1) if not self.shelf.get(key): # Initialize the key - self.set(None) + self.set(key, None) - def get(self): + def get(self, key): try: - d = self.shelf[self.key] + d = self.shelf[key] if d['expires'] > self.now: return d['value'] else: - del self.shelf[self.key] + del self.shelf[key] except KeyError: return None - def set(self, value): + def set(self, key, value): d = { 'value': value, 'expires': self.now + self.expires } - self.shelf[self.key] = d + self.shelf[key] = d return self @@ -465,14 +467,14 @@ class GsxSession(GsxObject): def login(self): global GSX_SESSION - if not self._cache.get() is None: - GSX_SESSION = self._cache.get() + if not self._cache.get("session") is None: + GSX_SESSION = self._cache.get("session") else: self._req = GsxRequest(AuthenticateRequest=self) result = self._req._submit("Authenticate") self._session_id = result[0].userSessionId GSX_SESSION = self.get_session() - self._cache.set(GSX_SESSION) + self._cache.set("session", GSX_SESSION) return GSX_SESSION -- cgit v1.2.3 From 4192b0ad78b87eb4688af5cfae07c74a08bd8336 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Sat, 1 Jun 2013 10:21:48 +0300 Subject: Deleted comptia.json --- gsxws/comptia.json | 297 ----------------------------------------------------- gsxws/comptia.py | 4 - 2 files changed, 301 deletions(-) delete mode 100644 gsxws/comptia.json (limited to 'gsxws') diff --git a/gsxws/comptia.json b/gsxws/comptia.json deleted file mode 100644 index 92d6f1c..0000000 --- a/gsxws/comptia.json +++ /dev/null @@ -1,297 +0,0 @@ -{ - "E": { - "E01": "Repairable accidental damage (OOW) - Customer Satisfaction codes", - "E02": "Controls not responding (wheel-button-touch screen)", - "E03": "Any Battery issue", - "E04": "Any Display issue", - "E05": "Input Output issue (audio-video-USB-WiFi)", - "E06": "Alert messages appearing on screen or computer", - "E07": "Will not boot-dead-no power-unusually hot", - "E08": "Fails Service diagnostics", - "E09": "Issue with accessories" - }, - "B": { - "B01": "Liquid or Corrosion Damage", - "B03": "Any Battery issue", - "B06": "Alert message on screen or computer", - "B07": "No Power-will not boot-unusually warm", - "B08": "No Service - dropped calls", - "B0A": "Any Camera issue", - "B0B": "Any audio issue", - "B0C": "Connectivity (Web-GPS-WiFi-BT)", - "B0D": "Display or image issue", - "B0E": "Multi-touch control", - "B0F": "Button or switch issues", - "B0G": "Enclosure issue", - "B0H": "Sensors (Accelerometer, ALS, Proximity)", - "B0J": "Wired Connection (iTunes or accessory)", - "B0K": "SIM Issue", - "B0L": "Unstable device (resets-crashes-frozen)" - }, - "F": { - "F0A": "LCI - Liquid Contamination Indicator On", - "F0B": "Oxidation/Corrosion - No LCI Activated", - "F1A": "Physical Damege - Enclosure", - "F1B": "Physical Damege - LCD/Display", - "F1C": "Engraving Issue", - "F2A": "Controls Not Responding (button-switch)", - "F2B": "Touch/Multi-Touch Control Issues", - "F2C": "Sensor - Accelerometer, ALS, Gyro, HE Issue", - "F3A": "Battery Issue", - "F4A": "Display issue", - "F5A": "Connectivity - USB", - "F5B": "Cellular Data Issue", - "F5D": "Input Issue - Audio/Video", - "F5E": "Output Issue - Audio/Video", - "F5F": "Camera Issue", - "F5G": "Connectivity - Wifi Issue", - "F5H": "Connectivity - Bluetooth Issue", - "F6A": "Alert Messages On Screen or Computer", - "F7A": "Will Not Boot-Dead-No Power", - "F7B": "Unusually Hot", - "F8A": "Fails Functional Test", - "F9A": "Issue With Accessory" - }, - "5": { - "M01": "No Power/No Light", - "M02": "Has Power/Light But Will Not Boot", - "M03": "Caused No Video", - "M04": "Caused Video Distortion", - "M05": "Hang/Freeze Up", - "M06": "Kernel Panic-Restart Required Message", - "M07": "Memory Errors/Not Recognized", - "M08": "Random Shutdown w/Reset During Use", - "M09": "Caused Audio Issue", - "M10": "Ethernet Port/Device Issue", - "M11": "Airport/Bluetooth", - "M12": "Firewire Port/Device Issues", - "M13": "Caused Camera Issue", - "M14": "Modem Issues", - "M15": "USB Port/Device Issues (Not Power)", - "M16": "Caused Keyboard/Trackpad Issue", - "M17": "I/O Expansion Slot", - "M18": "Caused Fan/Thermal Issue", - "M19": "Cannot Detect Hard/Optical Drive", - "M20": "Does Not Detect/Charge Battery", - "M21": "Won't Detect Working Power Adapter", - "M22": "Sleep/Wake Issue", - "M23": "Sensors Test Failed", - "M24": "Connectors - Broken/Damaged", - "M25": "No Backlight/Has Boot Image", - "M26": "No Video to External Video", - "M27": "SD Card Issue", - "M28": "HDMI Issue", - "M29": "Caused Whole Screen Flicker", - "M30": "No Power/No Adapter LED", - "M31": "Video Distortion On External Display", - "M32": "Thunderbolt Display Functionality Issue", - "M33": "Thunderbolt Port Inoperative", - "M34": "Thunderbolt not passing enough power", - "M35": "Airport Not Recognized", - "M36": "Bluetooth Not Recognized", - "M37": "USB Device Not Detected", - "M38": "USB Port Has Insufficient Power", - "M39": "Boots To 3 Beeps-Memory not recog", - "M85": "Unusually Hot - Overheat", - "M90": "Liquid Spill/LSI Tripped", - "M99": "Un-Categorized Symptom", - "Z03": "MB Pro NVIDIA Issue", - "Z04": "MB Pro NVIDIA Issue (Multiple Issues)", - "Z17": "ATI 2600 XT-No Video", - "Z18": "ATI 2600 XT-No Video/multi-issue", - "Z19": "ATI 2600 XT-Distorted Video", - "Z20": "ATI 2600 XT-Distorted Video/multi-issue", - "Z33": "MBPRO 15 Kernel Panic", - "Z34": "MBPRO 15 Kernel Panic (multi-issue)" - }, - "3": { - "J01": "Optical Drive Won't Accept Optical Media", - "J02": "Optical Drive Won't Eject Optical Media", - "J03": "Optical Media Read/Write Data Error", - "J04": "Optical Drive Noisy", - "J05": "Optical Drive Physical Damage", - "J06": "Optical Video Problems", - "J07": "Optical Drive Not Performing To Spec", - "J08": "Firmware Issues", - "J09": "Optical Drive Not Recognized", - "H01": "Hard Drive Not Recognized/Mount", - "H02": "Hard Drive Can't Boot", - "H03": "Hard Drive Read/Write Problem", - "H04": "Drive - Pins/Connector bent/broken", - "H05": "Hard Drive Bad Sector/Defective", - "H06": "Hard Drive Operational But Noisy", - "H07": "Hard Drive Formatting Issues", - "H08": "Hard Drive Firmware Issues", - "H90": "Liquid Spill/LSI Tripped", - "H99": "Un-Categorized Symptom", - "Z29": "iMac (Mid 2011) Hard Drive Program", - "Z30": "iMac (Mid 2011) Hard Drive Program (multiple issues)" - }, - "9": { - "N01": "No Power/Dead Unit", - "N02": "TimeCapsule - Internal HDD Not Mounting/Seen", - "N03": "Overheating/Fan in Full Speed", - "N04": "No/Poor WiFi Signal", - "N05": "Backup Issues", - "N06": "Can't Configure or Upgrade Firmware", - "N07": "Amber LED Flashes", - "N08": "USB Connection Issue/Ext USB Devices", - "N09": "Random Disconnect/Network Connection Issues", - "N10": "Wireless Distribution Setup Issue", - "N11": "Audio Issue", - "N13": "Kernel Panic/Freeze", - "N14": "Performance Issue/Slow Connection", - "N15": "Bluetooth Issue", - "N16": "Modem - Defective", - "N17": "Mechanical Damage/Cosmetic Issues", - "N18": "Airport Card - Not Recognized", - "N19": "Can't Connect", - "N20": "Firmware Update/Restore Issue", - "N21": "Cosmetic Issue", - "N85": "Unusually Hot - Overheat", - "N90": "Liquid Spill/LSI Tripped", - "N99": "Un-Categorized Symptom", - "Z13": "Time Capsule Power Supply", - "Z14": "TC PS Multiple Issues" - }, - "8": { - "T01": "No Power/Dead Unit", - "T02": "AppleTV - No Video Output", - "T03": "AppleTV - Distorted Video", - "T04": "AppleTV - No/Poor Wireless Signal", - "T05": "AppleTV - Won't Sync", - "T06": "AppleTV - No Audio", - "T07": "AppleTV - No Audio in HDMI", - "T08": "Won't Boot Up", - "T09": "System Hang/Freeze Up", - "T10": "Distorted or Cracking Audio", - "T11": "Unusually Hot - Overheat", - "T13": "Mechanical/Cosmetic Issue", - "T14": "Ethernet Connectivity Issue", - "T15": "Wireless (Wi-Fi) Connectivity Issue", - "T16": "Cosmetic Issue", - "T90": "Liquid Spill/LSI Tripped", - "T99": "Un-Categorized Symptom" - }, - "4": { - "K01": "Specific Key(s) Do Not Work", - "K02": "No Mouse/Trackpad Response", - "K03": "Built-In Keyboard Locks Up", - "K04": "Wrong Keyboard Language", - "K05": "Sticky Keys", - "K06": "Defective Mouse Jogball", - "K07": "Wireless Input Device - Can't Pair", - "K08": "Wireless Input Device - Lost Connection", - "K09": "Wireless Keyboard - No Green LED/No Power", - "K10": "Built-In Keyboard - No/Dim Backlight", - "K11": "Built-In Keyboard - Not Recognized", - "K12": "Trackpad Cursor Not Tracking Properly", - "K13": "Trackpad Click Not Recognized", - "K14": "Mouse Clicking Issue", - "K15": "Device Not Recognized", - "K16": "Mechanical/Physical Damage", - "K17": "Key Caps - Wrong/Missing/Fall Off", - "K18": "Touch/Multi-Touch Gesture Issue", - "K19": "Power Button Issue", - "K20": "Power Issue, Not due to Power Button", - "K21": "Cosmetic Issue", - "K22": "Port Functionality Issue", - "K23": "Trackpad Cursor Not Responding", - "K24": "Trackpad Requires High Click Force", - "K25": "Trackpad Click Oversensitive", - "K26": "Mouse Issue", - "K27": "Key(s) Missing/Falling Off", - "K28": "Backlight Uneven Across Keyboard", - "K90": "Liquid Spill/LSI Tripped", - "K99": "Un-Categorized Symptom", - "Z07": "MB Top Case Cracking", - "Z08": "MB Top Case Cracking (Multiple Issues)" - }, - "2": { - "L01": "No Power/Power Light Issue", - "L02": "Incorrect Colors Or Tinting", - "L03": "Has Power/Blank/No Video", - "L04": "Distorted/Blurred/Non-Focus Video", - "L05": "Vertical/Horizontal Lines", - "L06": "Full Screen Flicker/Flash", - "L07": "Can't Control Brightness", - "L09": "No Backlight/Has Video", - "L10": "Can't Change Resolution", - "L11": "Built In Audio Device Problem", - "L14": "Connector/Port/Cable Issue", - "L15": "Sleep Function Not Working", - "L16": "Wireless Function Not Working", - "L17": "Camera Image/Detect Issue", - "L18": "Mechanical/Physical Damages", - "L19": "Cosmetic Defects", - "L20": "Dead Pixels/Foreign Material", - "L21": "Bad Spots (Mura)", - "L22": "Wake Function Issues", - "L23": "Bluetooth Function Not Working", - "L24": "Clamshell Misalignment", - "L25": "Image Sticking/Ghost", - "L26": "Horizontal Lines Or Bands", - "L27": "Vertical Lines Or Bands", - "L90": "Liquid Spill/LSI Tripped", - "L99": "Un-Categorized Symptom", - "Z09": "MBAir Hinge Cracking", - "Z10": "MBAir Hinge Cracking (Multiple Issues)", - "Z35": "LCD Contamination" - }, - "6": { - "P01": "No Power/Dead Unit", - "P02": "PSupply Causes Unexpected Reset/Shutdown", - "P03": "No LED/LED Indicated Errors", - "P04": "Noise/Hum/Vibration", - "P05": "Audio Alarm/Prefailure Notice", - "P06": "Power Supply - Fan Not Working/Noisy", - "P07": "Wrong Voltage Selector", - "P08": "Burnt Smell/Odor", - "P09": "Battery Runtime Too Short, Fails Diag", - "P10": "Battery Won't Charge At All", - "P11": "Battery - Not Recognized", - "P12": "Battery Recognized-Won't Run Unit", - "P13": "Battery - Leakage/Swollen", - "P14": "Adapter - Won't Run on AC alone", - "P15": "Adapter Pins Stuck/Broken/Burnt", - "P16": "Mechanical - Connector/Cable/Duckhead Damaged", - "P17": "Unusually Hot - Overheat", - "P18": "Out-of-Warranty Battery Replacement", - "P19": "Battery Diagnostic Reported Failure", - "P21": "Cosmetic Issue", - "P22": "Battery Runtime Too Short, Passes Diag", - "P23": "Adapter No Power/Not Damaged", - "P90": "Liquid Spill/LSI Tripped", - "P99": "Un-Categorized Symptom", - "Z25": "Battery single part repair", - "Z26": "Battery multi-part repair" - }, - "1": { - "X01": "Memory Caused Kernel Panic", - "X02": "Memory Caused No Boot", - "X03": "Cables - Defective", - "X04": "Remote - Inoperable", - "X05": "Remote - Battery Life Too Short", - "X06": "Memory Module (RAM) - Issues", - "X08": "Internal Speaker - No Audio", - "X09": "Internal Speaker - Distorted Audio/Sound", - "X10": "Thermal Module Defective", - "X12": "Enclosure - Defective Latch/Hinge", - "X13": "Enclosure - Mechanical/Cosmetic Damaged", - "X14": "Enclosure - Reset/Power Button Stuck", - "X15": "Enclosure - Wobble/Uneven", - "X17": "Remote - Specific Button Not Working", - "X19": "Microphone - Defective", - "X20": "Camera - Video/Image Distortion", - "X21": "Camera - No Video", - "X22": "Fan Dead", - "X23": "Fan Sound Abnormal (tick, whine, grind)", - "X24": "Interface Card/Cage Issue", - "X26": "Damaged Smart Cable", - "X27": "Thunderbolt Firmware Update", - "X90": "Liquid Spill/LSI Tripped", - "X99": "Un-Categorized Symptom", - "Z21": "Bottom Case Delamination", - "Z22": "Bottom Case Delamination multiple issues" - } -} diff --git a/gsxws/comptia.py b/gsxws/comptia.py index 7851b17..b457320 100644 --- a/gsxws/comptia.py +++ b/gsxws/comptia.py @@ -1,5 +1,3 @@ -import os -import json import logging from core import GsxObject, GsxError, GsxCache @@ -42,8 +40,6 @@ class CompTIA(GsxObject): """ self._comptia = {} self._cache = GsxCache("comptia") - df = open(os.path.join(os.path.dirname(__file__), 'comptia.json')) - self._comptia = json.load(df) def fetch(self): """ -- cgit v1.2.3 From 3f6447a3af20e732f49f9e58e67752794535863a Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Sun, 2 Jun 2013 22:43:30 +0300 Subject: Clean up imports --- gsxws/comptia.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gsxws') diff --git a/gsxws/comptia.py b/gsxws/comptia.py index b457320..532f2f4 100644 --- a/gsxws/comptia.py +++ b/gsxws/comptia.py @@ -1,6 +1,5 @@ import logging - -from core import GsxObject, GsxError, GsxCache +from core import GsxObject, GsxCache MODIFIERS = ( ("A", "Not Applicable"), -- cgit v1.2.3