repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
chrispitzer/toucan-sam
toucansam/core/models.py
1
5910
import re from urlparse import urlparse, parse_qs from datetime import timedelta from django.core.urlresolvers import reverse from django.core.validators import MinValueValidator, MaxValueValidator from django.db import models from django.utils.safestring import mark_safe from durationfield.db.models.fields.duration import DurationField class ActiveSongsManager(models.Manager): def get_query_set(self): qs = super(ActiveSongsManager, self).get_query_set() qs = qs.filter(active=True) return qs class Song(models.Model): title = models.CharField(max_length=255, blank=True) short_title = models.CharField(max_length=30, blank=True) artist = models.CharField(max_length=255, blank=True) key = models.CharField(max_length=25, blank=True) singers = models.CharField(max_length=255, blank=True) cheat_sheet = models.CharField(max_length=255, blank=True) lyrics_with_chords = models.TextField(blank=True) video_link = models.URLField(max_length=255, blank=True) run_time = DurationField(default=2*60*1000000) # default: two minutes difficulty = models.IntegerField(default=3, choices=( (1, 'Real Easy'), (2, 'Easy'), (3, 'Normal'), (4, 'Hard'), (5, 'Real Hard'), ), validators=[ MinValueValidator(1), MaxValueValidator(5), ]) proposed = models.BooleanField(default=True) active = models.BooleanField(default=True) objects = models.Manager() active_objects = ActiveSongsManager() def save(self, *args, **kwargs): if not self.short_title and self.title: self.short_title = self.title[-30:] super(Song, self).save(*args, **kwargs) @property def milliseconds(self): return self.run_time.total_seconds() * 1000 @property def column_width(self): return reduce(lambda a, b: max(a, len(b)), re.split("[\r\n]+", self.lyrics_with_chords), 0) @property def lyrics_formatted(self): """ Assumes that lyrics with chords interleaves lines with chords and lines with lyrics """ def tokenize(s): return re.split(r'(\w+)', s) def chordify(chord, cssclass="chord"): return '<span class="{}">{}</span>'.format(cssclass, chord) def lineify(line): return u"<p>{}</p>".format(line) output = [] chord_line = None chord_regex = re.compile(r"^(\W*[ABCDEFG]b?(m|min|maj|maj)?\d*\W*)+$", flags=re.IGNORECASE) for line in re.split("[\r\n]+", self.lyrics_with_chords): line = line.rstrip() if chord_regex.match(line): if chord_line: formatted_line = "" for chord in tokenize(chord_line): if re.match("\W", chord): formatted_line += chord else: formatted_line += chordify(chord, cssclass="chord inline") output.append(lineify(formatted_line)) chord_line = line continue if chord_line: formatted_line = "" #make sure line is as long as chords line = line.ljust(len(chord_line)) #replace spaces at the beginning & end of the line with &nbsp; -- but not the middle! frontspaces, line, endspaces = re.split(r"(\S[\s\S]*\S|\S)", line) space = '&nbsp;&nbsp;' line = [space]*len(frontspaces) + list(line) + [space]*len(endspaces) chords = tokenize(chord_line) for chord in chords: l = len(chord) if not (chord+" ").isspace(): formatted_line += chordify(chord) formatted_line += "".join(line[:l]) line = line[l:] line = formatted_line + "".join(line) chord_line = None output.append(lineify(line)) return mark_safe(u"\n".join(output)) # todo: sanitize input def has_no_lyrics(self): return len(self.lyrics_with_chords) < 50 def youtube_video_id(self): try: parsed = urlparse(self.video_link) if parsed.netloc.endswith('youtube.com'): query = parse_qs(parsed.query) return query.get('v', [None])[0] except: return None def __unicode__(self): return self.title def get_absolute_url(self): return reverse('song', args=[self.id]) class Meta: ordering = ["title"] class Gig(models.Model): name = models.CharField(max_length=255) date = models.DateTimeField(null=True) def __unicode__(self): return self.name or "undefined" class SetItem(models.Model): song = models.ForeignKey(Song, related_name='setitems') set_list = models.ForeignKey("SetList", related_name='setitems') order = models.IntegerField() class SetList(models.Model): gig = models.ForeignKey(Gig) songs = models.ManyToManyField(Song, related_name="set_lists", through=SetItem) show_proposed = models.BooleanField(default=False) @property def name(self): return self.gig.name @property def ordered_songs(self): return self.songs.order_by('setitems__order') @property def run_time(self): microseconds = int(self.songs.aggregate(s=models.Sum('run_time'))['s']) return timedelta(microseconds=microseconds) def __unicode__(self): return self.name or "undefined"
gpl-2.0
8,150,954,551,318,501,000
34.39521
101
0.558545
false
yangqian/plugin.video.pandatv
addon.py
1
4342
# -*- coding: utf-8 -*- # Module: default # Author: Yangqian # Created on: 25.12.2015 # License: GPL v.3 https://www.gnu.org/copyleft/gpl.html # Largely following the example at # https://github.com/romanvm/plugin.video.example/blob/master/main.py import xbmc,xbmcgui,urllib2,re,xbmcplugin from BeautifulSoup import BeautifulSoup from urlparse import parse_qsl import sys import json # Get the plugin url in plugin:// notation. _url=sys.argv[0] # Get the plugin handle as an integer number. _handle=int(sys.argv[1]) def list_categories(): f=urllib2.urlopen('http://www.panda.tv/cate') rr=BeautifulSoup(f.read()) catel=rr.findAll('li',{'class':'category-list-item'}) rrr=[(x.a['class'], x.a['title']) for x in catel] listing=[] for classname,text in rrr: img=rr.find('img',{'alt':text})['src'] list_item=xbmcgui.ListItem(label=text,thumbnailImage=img) list_item.setProperty('fanart_image',img) url='{0}?action=listing&category={1}'.format(_url,classname) is_folder=True listing.append((url,list_item,is_folder)) xbmcplugin.addDirectoryItems(_handle,listing,len(listing)) #xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE) # Finish creating a virtual folder. xbmcplugin.endOfDirectory(_handle) def list_videos(category): f=urllib2.urlopen('http://www.panda.tv/cate/'+category) rr=BeautifulSoup(f.read()) videol=rr.findAll('a',{'class':'video-list-item-inner'}) rrr=[(x['href'][1:],x.img,x.findNextSibling('div',{'class':'live-info'})) for x in videol] listing=[] for roomid,image,liveinfo in rrr: img=image['src'] roomname=image['alt'] nickname=liveinfo.find('span',{'class':'nick-name'}).text peoplenumber=liveinfo.find('span',{'class':'people-number'}).text combinedname=u'{0}:{1}:{2}'.format(nickname,roomname,peoplenumber) list_item=xbmcgui.ListItem(label=combinedname,thumbnailImage=img) list_item.setProperty('fanart_image',img) url='{0}?action=play&video={1}'.format(_url,roomid) is_folder=False listing.append((url,list_item,is_folder)) xbmcplugin.addDirectoryItems(_handle,listing,len(listing)) #xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE) # Finish creating a virtual folder. xbmcplugin.endOfDirectory(_handle) def play_video(roomid): """ Play a video by the provided path. :param path: str :return: None """ f=urllib2.urlopen('http://www.panda.tv/api_room?roomid='+roomid) r=f.read() ss=json.loads(r) hostname=ss['data']['hostinfo']['name'] roomname=ss['data']['roominfo']['name'] #s=re.search('''"room_key":"(.*?)"''',r).group(1) s=ss['data']['videoinfo']['room_key'] img=ss['data']['hostinfo']['avatar'] combinedname=u'{0}:{1}'.format(hostname,roomname) # Create a playable item with a path to play. path='http://pl3.live.panda.tv/live_panda/{0}.flv'.format(s) play_item = xbmcgui.ListItem(path=path,thumbnailImage=img) play_item.setInfo(type="Video",infoLabels={"Title":combinedname}) # Pass the item to the Kodi player. xbmcplugin.setResolvedUrl(_handle, True, listitem=play_item) # directly play the item. xbmc.Player().play(path, play_item) def router(paramstring): """ Router function that calls other functions depending on the provided paramstring :param paramstring: :return: """ # Parse a URL-encoded paramstring to the dictionary of # {<parameter>: <value>} elements params = dict(parse_qsl(paramstring)) # Check the parameters passed to the plugin if params: if params['action'] == 'listing': # Display the list of videos in a provided category. list_videos(params['category']) elif params['action'] == 'play': # Play a video from a provided URL. play_video(params['video']) else: # If the plugin is called from Kodi UI without any parameters, # display the list of video categories list_categories() if __name__ == '__main__': # Call the router function and pass the plugin call parameters to it. # We use string slicing to trim the leading '?' from the plugin call paramstring router(sys.argv[2][1:])
lgpl-3.0
-501,227,777,246,295,700
37.070175
94
0.659908
false
tensorflow/tensor2tensor
tensor2tensor/utils/rouge_test.py
1
4407
# coding=utf-8 # Copyright 2021 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Tests for Rouge metric.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensor2tensor.utils import rouge import tensorflow.compat.v1 as tf class TestRouge2Metric(tf.test.TestCase): """Tests the rouge-2 metric.""" def testRouge2Identical(self): hypotheses = np.array([[1, 2, 3, 4, 5, 1, 6, 7, 0], [1, 2, 3, 4, 5, 1, 6, 8, 7]]) references = np.array([[1, 2, 3, 4, 5, 1, 6, 7, 0], [1, 2, 3, 4, 5, 1, 6, 8, 7]]) self.assertAllClose(rouge.rouge_n(hypotheses, references), 1.0, atol=1e-03) def testRouge2Disjoint(self): hypotheses = np.array([[1, 2, 3, 4, 5, 1, 6, 7, 0], [1, 2, 3, 4, 5, 1, 6, 8, 7]]) references = np.array([[8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [9, 10, 11, 12, 13, 14, 15, 16, 17, 0]]) self.assertEqual(rouge.rouge_n(hypotheses, references), 0.0) def testRouge2PartialOverlap(self): hypotheses = np.array([[1, 2, 3, 4, 5, 1, 6, 7, 0], [1, 2, 3, 4, 5, 1, 6, 8, 7]]) references = np.array([[1, 9, 2, 3, 4, 5, 1, 10, 6, 7], [1, 9, 2, 3, 4, 5, 1, 10, 6, 7]]) self.assertAllClose(rouge.rouge_n(hypotheses, references), 0.53, atol=1e-03) class TestRougeLMetric(tf.test.TestCase): """Tests the rouge-l metric.""" def testRougeLIdentical(self): hypotheses = np.array([[1, 2, 3, 4, 5, 1, 6, 7, 0], [1, 2, 3, 4, 5, 1, 6, 8, 7]]) references = np.array([[1, 2, 3, 4, 5, 1, 6, 7, 0], [1, 2, 3, 4, 5, 1, 6, 8, 7]]) self.assertAllClose( rouge.rouge_l_sentence_level(hypotheses, references), 1.0, atol=1e-03) def testRougeLDisjoint(self): hypotheses = np.array([[1, 2, 3, 4, 5, 1, 6, 7, 0], [1, 2, 3, 4, 5, 1, 6, 8, 7]]) references = np.array([[8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [9, 10, 11, 12, 13, 14, 15, 16, 17, 0]]) self.assertEqual(rouge.rouge_l_sentence_level(hypotheses, references), 0.0) def testRougeLPartialOverlap(self): hypotheses = np.array([[1, 2, 3, 4, 5, 1, 6, 7, 0], [1, 2, 3, 4, 5, 1, 6, 8, 7]]) references = np.array([[1, 9, 2, 3, 4, 5, 1, 10, 6, 7], [1, 9, 2, 3, 4, 5, 1, 10, 6, 7]]) self.assertAllClose( rouge.rouge_l_sentence_level(hypotheses, references), 0.837, atol=1e-03) class TestRougeMetricsE2E(tf.test.TestCase): """Tests the rouge metrics end-to-end.""" def testRouge2MetricE2E(self): vocab_size = 4 batch_size = 12 seq_length = 12 predictions = tf.one_hot( np.random.randint(vocab_size, size=(batch_size, seq_length, 1, 1)), depth=4, dtype=tf.float32) targets = np.random.randint(4, size=(12, 12, 1, 1)) with self.test_session() as session: scores, _ = rouge.rouge_2_fscore(predictions, tf.constant(targets, dtype=tf.int32)) a = tf.reduce_mean(scores) session.run(tf.global_variables_initializer()) session.run(a) def testRougeLMetricE2E(self): vocab_size = 4 batch_size = 12 seq_length = 12 predictions = tf.one_hot( np.random.randint(vocab_size, size=(batch_size, seq_length, 1, 1)), depth=4, dtype=tf.float32) targets = np.random.randint(4, size=(12, 12, 1, 1)) with self.test_session() as session: scores, _ = rouge.rouge_l_fscore( predictions, tf.constant(targets, dtype=tf.int32)) a = tf.reduce_mean(scores) session.run(tf.global_variables_initializer()) session.run(a) if __name__ == "__main__": tf.test.main()
apache-2.0
-804,987,988,696,853,200
36.666667
80
0.570002
false
tangentlabs/django-fancypages
fancypages/compat.py
1
1314
# -*- coding: utf-8 -*- from django.conf import settings from django.core.exceptions import ImproperlyConfigured _user_model = None try: from django.utils.module_loading import import_string except ImportError: from django.utils.module_loading import import_by_path as import_string # noqa def get_user_model(): """ Get the Django user model class in a backwards compatible way to previous Django version that don't provide this functionality. The result is cached after the first call. Returns the user model class. """ global _user_model if not _user_model: # we have to import the user model here because we can't be sure # that the app providing the user model is fully loaded. try: from django.contrib.auth import get_user_model except ImportError: from django.contrib.auth.models import User else: User = get_user_model() _user_model = User return _user_model AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') try: AUTH_USER_MODEL_NAME = AUTH_USER_MODEL.split('.')[1] except IndexError: raise ImproperlyConfigured( "invalid user model '{}' specified has to be in the format " "'app_label.model_name'.".format(AUTH_USER_MODEL))
bsd-3-clause
9,087,575,871,766,392,000
28.863636
83
0.672755
false
fullcontact/hesiod53
hesiod53/sync.py
1
11846
#!/usr/bin/env python from boto.route53.record import ResourceRecordSets from boto.route53.status import Status import boto.route53 as r53 from collections import namedtuple import argparse import time import yaml # a DNS record for hesiod # fqdn should include the trailing . # value should contain the value without quotes DNSRecord = namedtuple("DNSRecord", "fqdn value") # A UNIX group class Group(object): def __init__(self, name, gid): if not name: raise Exception("Group name must be provided.") if not gid: raise Exception("Group ID must be provided.") self.name = str(name) self.gid = int(gid) if len(self.passwd_line([]).split(":")) != 4: raise Exception("Invalid group, contains colons: %s" % self) def users(self, users): r = [] for user in users: if self in user.groups: r.append(user) return r def dns_records(self, hesiod_domain, users): records = [] passwd_line = self.passwd_line(users) # group record fqdn = "%s.group.%s" % (self.name, hesiod_domain) records.append(DNSRecord(fqdn.lower(), passwd_line)) # gid record fqdn = "%s.gid.%s" % (self.gid, hesiod_domain) records.append(DNSRecord(fqdn.lower(), passwd_line)) return records @classmethod # returns group, usernames list # usernames will be empty if only a partial line def parse_passwd_line(cls, line): parts = line.split(":") if len(parts) != 3 and len(parts) != 4: raise Exception("Invalid group passwd line: %s" % line) name = parts[0] gid = parts[2] usernames = [] if len(parts) == 4: usernames = parts[3].split(",") return Group(name, gid), usernames def passwd_line(self, users): usernames = ",".join(sorted(map(lambda u: u.username, self.users(users)))) return "%s:x:%d:%s" % (self.name, self.gid, usernames) def __eq__(self, other): return self.name == other.name and self.gid == other.gid def __ne__(self, other): return not self == other def __repr__(self): return "Group(name=%s, gid=%s)" % (self.name, self.gid) # A UNIX user class User(object): def __init__(self, name, username, uid, groups, ssh_keys, homedir=None, shell="/bin/bash"): self.name = str(name) self.username = str(username) self.uid = int(uid) self.groups = groups self.ssh_keys = list(ssh_keys) if not homedir: homedir = "/home/%s" % self.username self.homedir = str(homedir) self.shell = str(shell) if len(self.passwd_line().split(":")) != 7: raise Exception("Invalid user, contains colons: %s" % self) @classmethod # returns user, primary group id def parse_passwd_line(cls, line): line = line.replace('"', '') parts = line.split(":") if len(parts) != 7: raise Exception("Invalid user passwd line: %s" % line) username, x, uid, group, gecos, homedir, shell = parts name = gecos.split(",")[0] group = int(group) return User(name, username, uid, [], [], homedir, shell), group def dns_records(self, hesiod_domain): records = [] # user record fqdn = "%s.passwd.%s" % (self.username, hesiod_domain) records.append(DNSRecord(fqdn.lower(), self.passwd_line())) # uid record fqdn = "%s.uid.%s" % (self.uid, hesiod_domain) records.append(DNSRecord(fqdn.lower(), self.passwd_line())) # group list record gl = [] for group in sorted(self.groups, key=lambda g: g.gid): gl.append("%s:%s" % (group.name, group.gid)) fqdn = "%s.grplist.%s" % (self.username, hesiod_domain) records.append(DNSRecord(fqdn.lower(), ":".join(gl))) # ssh records if self.ssh_keys: ssh_keys_count_fqdn = "%s.count.ssh.%s" % (self.username, hesiod_domain) records.append(DNSRecord(ssh_keys_count_fqdn.lower(), str(len(self.ssh_keys)))) # Need to keep this around for backwards compatibility when only one ssh key worked legacy_ssh_key_fqdn = "%s.ssh.%s" % (self.username, hesiod_domain) records.append(DNSRecord(legacy_ssh_key_fqdn.lower(), self.ssh_keys[0])) for _id, ssh_key in enumerate(self.ssh_keys): ssh_key_fqdn = "%s.%s.ssh.%s" % (self.username, _id, hesiod_domain) records.append(DNSRecord(ssh_key_fqdn.lower(), ssh_key)) return records def passwd_line(self): gid = "" if self.groups: gid = str(self.groups[0].gid) return "%s:x:%d:%s:%s:%s:%s" % \ (self.username, self.uid, gid, self.gecos(), self.homedir, self.shell) def gecos(self): return "%s,,,," % self.name def __eq__(self, other): return self.passwd_line() == other.passwd_line() def __ne__(self, other): return not self == other def __repr__(self): return ("User(name=%s, username=%s, uid=%s, groups=%s, ssh_keys=%s, " + "homedir=%s, shell=%s)") % \ (self.name, self.username, self.uid, self.groups, self.ssh_keys, self.homedir, self.shell) # syncs users and groups to route53 # users is a list of users # groups is a list of groups # route53_zone - the hosted zone in Route53 to modify, e.g. example.com # hesiod_domain - the zone with hesiod information, e.g. hesiod.example.com def sync(users, groups, route53_zone, hesiod_domain, dry_run): conn = r53.connect_to_region('us-east-1') record_type = "TXT" ttl = "60" # suffix of . on zone if not supplied if route53_zone[-1:] != '.': route53_zone += "." if hesiod_domain[-1:] != '.': hesiod_domain += "." # get existing hosted zones zones = {} results = conn.get_all_hosted_zones() for r53zone in results['ListHostedZonesResponse']['HostedZones']: zone_id = r53zone['Id'].replace('/hostedzone/', '') zones[r53zone['Name']] = zone_id # ensure requested zone is hosted by route53 if not route53_zone in zones: raise Exception("Zone %s does not exist in Route53" % route53_zone) sets = conn.get_all_rrsets(zones[route53_zone]) # existing records existing_records = set() for rset in sets: if rset.type == record_type: if rset.name.endswith("group." + hesiod_domain) or \ rset.name.endswith("gid." + hesiod_domain) or \ rset.name.endswith("passwd." + hesiod_domain) or \ rset.name.endswith("uid." + hesiod_domain) or \ rset.name.endswith("grplist." + hesiod_domain) or \ rset.name.endswith("ssh." + hesiod_domain): value = "".join(rset.resource_records).replace('"', '') existing_records.add(DNSRecord(str(rset.name), str(value))) # new records new_records = set() for group in groups: for record in group.dns_records(hesiod_domain, users): new_records.add(record) for user in users: for record in user.dns_records(hesiod_domain): new_records.add(record) to_remove = existing_records - new_records to_add = new_records - existing_records if to_remove: print "Deleting:" for r in sorted(to_remove): print r print else: print "Nothing to delete." if to_add: print "Adding:" for r in sorted(to_add): print r print else: print "Nothing to add." if dry_run: print "Dry run mode. Stopping." return # stop if nothing to do if not to_remove and not to_add: return changes = ResourceRecordSets(conn, zones[route53_zone]) for record in to_remove: removal = changes.add_change("DELETE", record.fqdn, record_type, ttl) removal.add_value(txt_value(record.value)) for record in to_add: addition = changes.add_change("CREATE", record.fqdn, record_type, ttl) addition.add_value(txt_value(record.value)) try: result = changes.commit() status = Status(conn, result["ChangeResourceRecordSetsResponse"]["ChangeInfo"]) except r53.exception.DNSServerError, e: raise Exception("Could not update DNS records.", e) while status.status == "PENDING": print "Waiting for Route53 to propagate changes." time.sleep(10) print status.update() # DNS text values are limited to chunks of 255, but multiple chunks are concatenated # Amazon handles this by requiring you to add quotation marks around each chunk def txt_value(value): first = value[:255] rest = value[255:] if rest: rest_value = txt_value(rest) else: rest_value = "" return '"%s"%s' % (first, rest_value) def load_data(filename): with open(filename, "r") as f: contents = yaml.load(f, Loader=yaml.FullLoader) route53_zone = contents["route53_zone"] hesiod_domain = contents["hesiod_domain"] # all groups and users groups_idx = {} users_idx = {} groups = [] users = [] for g in contents["groups"]: group = Group(**g) if group.name in groups_idx: raise Exception("Group name is not unique: %s" % group.name) if group.gid in groups_idx: raise Exception("Group ID is not unique: %s" % group.gid) groups_idx[group.name] = group groups_idx[group.gid] = group groups.append(group) for u in contents["users"]: groups_this = [] if u["groups"]: for g in u["groups"]: group = groups_idx[g] if not group: raise Exception("No such group: %s" % g) groups_this.append(group) u["groups"] = groups_this user = User(**u) if len(user.groups) == 0: raise Exception("At least one group required for user %s" % \ user.username) if user.username in users_idx: raise Exception("Username is not unique: %s" % user.username) if user.uid in users_idx: raise Exception("User ID is not unique: %s" % user.uid) users_idx[user.username] = user users_idx[user.uid] = user users.append(user) return users, groups, route53_zone, hesiod_domain def main(): parser = argparse.ArgumentParser( description="Synchronize a user database with Route53 for Hesiod.", epilog = "AWS credentials follow the Boto standard. See " + "http://docs.pythonboto.org/en/latest/boto_config_tut.html. " + "For example, you can populate AWS_ACCESS_KEY_ID and " + "AWS_SECRET_ACCESS_KEY with your credentials, or use IAM " + "role-based authentication (in which case you need not do " + "anything).") parser.add_argument("user_file", metavar="USER_FILE", help="The user yaml file. See example_users.yml for an example.") parser.add_argument("--dry-run", action='store_true', dest="dry_run", help="Dry run mode. Do not commit any changes.", default=False) args = parser.parse_args() users, groups, route53_zone, hesiod_domain = load_data(args.user_file) sync(users, groups, route53_zone, hesiod_domain, args.dry_run) print "Done!" if __name__ == "__main__": main()
mit
-4,982,819,906,042,673,000
33.236994
95
0.573611
false
trmznt/rhombus
rhombus/views/gallery.py
1
2066
from rhombus.views import * @roles( PUBLIC ) def index(request): """ input tags gallery """ static = False html = div( div(h3('Input Gallery'))) eform = form( name='rhombus/gallery', method=POST, action='') eform.add( fieldset( input_hidden(name='rhombus-gallery_id', value='00'), input_text('rhombus-gallery_text', 'Text Field', value='Text field value'), input_text('rhombus-gallery_static', 'Static Text Field', value='Text field static', static=True), input_textarea('rhombus-gallery_textarea', 'Text Area', value='A text in text area'), input_select('rhombus-gallery_select', 'Select', value=2, options = [ (1, 'Opt1'), (2, 'Opt2'), (3, 'Opt3') ]), input_select('rhombus-gallery_select-multi', 'Select (Multiple)', value=[2,3], options = [ (1, 'Opt1'), (2, 'Opt2'), (3, 'Opt3') ], multiple=True), input_select('rhombus-gallery_select2', 'Select2 (Multiple)', value=[2,4], options = [ (1, 'Opt1'), (2, 'Opt2'), (3, 'Opt3'), (4, 'Opt4'), (5, 'Opt5') ], multiple=True), input_select('rhombus-gallery_select2-ajax', 'Select2 (AJAX)'), checkboxes('rhombus-gallery_checkboxes', 'Check Boxes', boxes = [ ('1', 'Box 1', True), ('2', 'Box 2', False), ('3', 'Box 3', True)]), submit_bar(), ) ) html.add( div(eform) ) code = ''' $('#rhombus-gallery_select2').select2(); $('#rhombus-gallery_select2-ajax').select2({ placeholder: 'Select from AJAX', minimumInputLength: 3, ajax: { url: "%s", dataType: 'json', data: function(params) { return { q: params.term, g: "@ROLES" }; }, processResults: function(data, params) { return { results: data }; } }, }); ''' % request.route_url('rhombus.ek-lookup') return render_to_response('rhombus:templates/generics/page.mako', { 'content': str(html), 'code': code }, request = request )
lgpl-3.0
7,048,302,373,551,598,000
38.75
107
0.545983
false
cadencewatches/frappe
frappe/website/doctype/blog_post/test_blog_post.py
1
5111
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt """Use blog post test to test permission restriction logic""" import frappe import frappe.defaults import unittest from frappe.core.page.user_properties.user_properties import add, remove, get_properties, clear_restrictions test_records = frappe.get_test_records('Blog Post') test_dependencies = ["User"] class TestBlogPost(unittest.TestCase): def setUp(self): frappe.db.sql("""update tabDocPerm set `restricted`=0 where parent='Blog Post' and ifnull(permlevel,0)=0""") frappe.db.sql("""update `tabBlog Post` set owner='[email protected]' where name='_test-blog-post'""") frappe.clear_cache(doctype="Blog Post") user = frappe.get_doc("User", "[email protected]") user.add_roles("Website Manager") user = frappe.get_doc("User", "[email protected]") user.add_roles("Blogger") frappe.set_user("[email protected]") def tearDown(self): frappe.set_user("Administrator") clear_restrictions("Blog Category") clear_restrictions("Blog Post") def test_basic_permission(self): post = frappe.get_doc("Blog Post", "_test-blog-post") self.assertTrue(post.has_permission("read")) def test_restriction_in_doc(self): frappe.defaults.add_default("Blog Category", "_Test Blog Category 1", "[email protected]", "Restriction") post = frappe.get_doc("Blog Post", "_test-blog-post") self.assertFalse(post.has_permission("read")) post1 = frappe.get_doc("Blog Post", "_test-blog-post-1") self.assertTrue(post1.has_permission("read")) def test_restriction_in_report(self): frappe.defaults.add_default("Blog Category", "_Test Blog Category 1", "[email protected]", "Restriction") names = [d.name for d in frappe.get_list("Blog Post", fields=["name", "blog_category"])] self.assertTrue("_test-blog-post-1" in names) self.assertFalse("_test-blog-post" in names) def test_default_values(self): frappe.defaults.add_default("Blog Category", "_Test Blog Category 1", "[email protected]", "Restriction") doc = frappe.new_doc("Blog Post") self.assertEquals(doc.get("blog_category"), "_Test Blog Category 1") def add_restricted_on_blogger(self): frappe.db.sql("""update tabDocPerm set `restricted`=1 where parent='Blog Post' and role='Blogger' and ifnull(permlevel,0)=0""") frappe.clear_cache(doctype="Blog Post") def test_owner_match_doc(self): self.add_restricted_on_blogger() frappe.set_user("[email protected]") post = frappe.get_doc("Blog Post", "_test-blog-post") self.assertTrue(post.has_permission("read")) post1 = frappe.get_doc("Blog Post", "_test-blog-post-1") self.assertFalse(post1.has_permission("read")) def test_owner_match_report(self): frappe.db.sql("""update tabDocPerm set `restricted`=1 where parent='Blog Post' and ifnull(permlevel,0)=0""") frappe.clear_cache(doctype="Blog Post") frappe.set_user("[email protected]") names = [d.name for d in frappe.get_list("Blog Post", fields=["name", "owner"])] self.assertTrue("_test-blog-post" in names) self.assertFalse("_test-blog-post-1" in names) def add_restriction_to_user2(self): frappe.set_user("[email protected]") add("[email protected]", "Blog Post", "_test-blog-post") def test_add_restriction(self): # restrictor can add restriction self.add_restriction_to_user2() def test_not_allowed_to_restrict(self): frappe.set_user("[email protected]") # this user can't add restriction self.assertRaises(frappe.PermissionError, add, "[email protected]", "Blog Post", "_test-blog-post") def test_not_allowed_on_restrict(self): self.add_restriction_to_user2() frappe.set_user("[email protected]") # user can only access restricted blog post doc = frappe.get_doc("Blog Post", "_test-blog-post") self.assertTrue(doc.has_permission("read")) # and not this one doc = frappe.get_doc("Blog Post", "_test-blog-post-1") self.assertFalse(doc.has_permission("read")) def test_not_allowed_to_remove_self(self): self.add_restriction_to_user2() defname = get_properties("[email protected]", "Blog Post", "_test-blog-post")[0].name frappe.set_user("[email protected]") # user cannot remove their own restriction self.assertRaises(frappe.PermissionError, remove, "[email protected]", defname, "Blog Post", "_test-blog-post") def test_allow_in_restriction(self): self.add_restricted_on_blogger() frappe.set_user("[email protected]") doc = frappe.get_doc("Blog Post", "_test-blog-post-1") self.assertFalse(doc.has_permission("read")) frappe.set_user("[email protected]") add("[email protected]", "Blog Post", "_test-blog-post-1") frappe.set_user("[email protected]") doc = frappe.get_doc("Blog Post", "_test-blog-post-1") self.assertTrue(doc.has_permission("read")) def test_set_only_once(self): blog_post = frappe.get_meta("Blog Post") blog_post.get_field("title").set_only_once = 1 doc = frappe.get_doc("Blog Post", "_test-blog-post-1") doc.title = "New" self.assertRaises(frappe.CannotChangeConstantError, doc.save) blog_post.get_field("title").set_only_once = 0
mit
-6,822,289,126,534,374,000
32.625
108
0.708081
false
xiaotianyi/INTELLI-City
docs/refer_project/wx_with_web/wenpl/divide.py
1
10289
# encoding=utf-8 ''' 程序入口showreply ''' import jieba.posseg as pseg import jieba import sys import urllib2 import json import re import copy import datetime import time import calendar from parsedate import parseDate from getdata import* from showAll import* #增加用户词汇库,此处的绝对定位,以后要修改 jieba.load_userdict('wendata/dict/dict1.txt') jieba.load_userdict('wendata/dict/dict_manual.txt') jieba.load_userdict('wendata/dict/dict_date.txt') jieba.load_userdict('wendata/dict/dict2.txt') # jieba.load_userdict('/root/wechat/wx/wendata/dict/dict2.txt') reload(sys) sys.setdefaultencoding('utf-8') def mergePositions(l): ''' 把device\town\city\station 都标记为position ''' positions = {} for x in l: for y in x: positions[y] = 'position' return positions def divide(str): ''' 输入语句分词,分别得到独立词汇和词性 ''' words = pseg.cut(str) li = [] for w in words: li.append([w.word.encode('utf-8'), w.flag.encode('utf-8')]) return li def filt(li, type): '''词性筛选,暂时没用到 # get the specific words depending on the type you want ''' rli = [] for w in li: if w[1] == type: rli.append(w[0]) return rli def paraFilter(store): ''' #查看 # check parameters in store ''' dictionary = {} for x in store.keys(): dictionary[x] = [] for y in x.split(" "): j = [] j = re.findall(r'\w+', y) if j != []: dictionary[x].append(j) return dictionary def getQueryTypeSet(li, dictionary, para, pro, paraCategory): ''' 输入语句分完词后,判断是不是有pro中的关键词,没的话,就反回0,表示这句话不在查询范围,调用外部资源回答,同时获取参数词:people,position # calculate the types of the query words ''' qType = [] Nkey = 0 hasPosition = 0 hasName = 0 paradic = {} # print pro for w in li: word = w[0] if word in dictionary.keys(): qType.append(dictionary[word]) if word in pro: Nkey += 1 if word in paraCategory.keys(): paradic[paraCategory[word]] = word for x in paradic.values(): para.append(x) if Nkey == 0: return 0 return qType def pointquery(li,points,devices,stations,para): ''' #"获取某个监测点的数据" ''' point="" device="" station="" for w in li: word=w[0] # print 1 if points.has_key(word): point=word elif devices.has_key(word): device=word elif stations.has_key(word): station=word if point!="" and station!="" and device!="": url ="/data/point_info_with_real_time?station_name="+station+"&device_name="+device+"&point_name="+point return getResult(url) else: return 0 def getPrefixHit(qType, store): ''' 获命中数量 # calculate the hit times of each prefix sentences in store ''' count = {} setType = set(qType) for i in range(len(store.keys())): setStore = set(store.keys()[i].split(' ')) count[store.keys()[i]] = len(setStore & setType) return count def ranking(count, qType): ''' 计算命中率 # calculate the probability ''' setType = set(qType) N = len(setType) p = {} for x in count.keys(): p[x] = float(count[x] / float(N)) p = sort(p) return p def sort(p): ''' #对命中率进行排序 ''' dicts = sorted(p.iteritems(), key=lambda d: d[1], reverse=True) return dicts # print dicts def revranking(count): ''' 计算效率recall # showDict(count) ''' p = {} for x in count.keys(): p[x] = float(count[x] / float(len(x.split(" ")))) # showDict(p) p = sort(p) # print p return p def excuteREST(p, rp, st, para, paraDict, qType,remember): ''' #执行查询,这里按照参数优先顺序,以后可以优化调整 # p:正排序后的store匹配度列表 # rp:反排序后的store匹配度列表 # st:store字典 # para:输入语句中的参数列表 # paraDict: store中参数列表 # print showList() # p[[[],[]],[]] # st{:} ''' p = resort(p, rp) # 命中率相同的情况下,按效率来决定先后顺序 # print p url="" if len(para) == 0: for x in p: if len(paraDict[x[0]]) == 0: url = st[x[0]] remember.append(x) break elif len(para) == 1: for x in p: if len(paraDict[x[0]]) == 1: # print paraDict[x[0]][0][0] if qType.count(paraDict[x[0]][0][0]) == 1: url = st[x[0]] + para[0] remember.append(x) break if url=="": return 0 elif len(para) == 2: for x in p: if len(paraDict[x[0]]) == 2: url = st[x[0]][0] + para[0] + st[x[0]][1] + para[1][0]+st[x[0]][2]+para[1][1] remember.append(x) break if url=="": return 0 return getResult(url) def getResult(url): ''' #与服务器建立连接,获取json数据并返回.turl也是需要改成相对路径 ''' turl = '/root/INTELLI-City/docs/refer_project/wx/wendata/token' fin1 = open(turl, 'r+') token = fin1.read() url = 'http://www.intellense.com:3080' + url print url fin1.close() req = urllib2.Request(url) req.add_header('authorization', token) try: response = urllib2.urlopen(req) except Exception as e: return 0 # print response.read() return response.read() def resort(l1, l2): ''' # 反向检查匹配度 ''' l1 = copy.deepcopy(l1) l2 = copy.deepcopy(l2) nl = [] g = -1 group = -1 gdict = {} newlist = [] for x in l1: if g != x[1]: group += 1 g = x[1] nl.append([]) nl[group].append(x) else: nl[group].append(x) for g in nl: for x in g: for y in range(len(l2)): if x[0] == l1[y][0]: gdict[x] = y break sublist = sort(gdict) for x in sublist: newlist.append(x[0]) return newlist def connectTuring(a): ''' #在没有匹配的时候调用外部问答 ''' kurl = '/root/INTELLI-City/docs/refer_project/wx/wendata/turkey' fin = open(kurl, 'r+') key = fin.read() url = r'http://www.tuling123.com/openapi/api?key=' + key + '&info=' + a reson = urllib2.urlopen(url) reson = json.loads(reson.read()) fin.close() # print reson['text'],'\n' return reson['text'] def toUTF8(origin): # change unicode type dict to UTF-8 result = {} for x in origin.keys(): val = origin[x].encode('utf-8') x = x.encode('utf-8') result[x] = val return result def showDict(l): for x in l.keys(): print x + ' ' + str(l[x]) def showList(l): for x in l: print x def test(sentence): sentence = sentence.replace(' ', '') people = getPeople() cities = getPosition('cities') towns = getPosition('towns') stations = getPosition('stations') devices = getPosition('devices') positions = mergePositions([cities, towns, stations, devices]) points=getPoints() pro = getPros() general = getGenerals() paraCategory = dict(positions, **people) dict1 = dict(general, **pro) dict2 = dict(dict1, **paraCategory) st = getStore() # store dict para = [] keyphrase = pro.keys() paraDict = paraFilter(st) date = parseDate(sentence) ftype=0 remember=[] divideResult = divide(sentence) # list sentenceResult = getQueryTypeSet( divideResult, dict2, para, pro, paraCategory) # set pointResult=pointquery(divideResult,points,devices,stations,para) if pointResult!=0: # print "-----------------------------这是结果哦--------------------------------" # print get_point_info_with_real_time(json.loads(pointResult)) return get_point_info_with_real_time(json.loads(pointResult)) elif sentenceResult == 0: # print "-----------------------------这是结果哦--------------------------------" # print connectTuring(sentence) return connectTuring(sentence) else: if date!=0: sentenceResult.append('time') hitResult = getPrefixHit(sentenceResult, st) # dict rankResult = ranking(hitResult, sentenceResult) # dict rerankingResult = revranking(hitResult) if date!=0: para.append(date) excuteResult = excuteREST( rankResult, rerankingResult, st, para, paraDict, sentenceResult,remember) if excuteResult==0: # print "-----------------------------这是结果哦--------------------------------" # print connectTuring(sentence) return connectTuring(sentence) # b=filt(a,'v') else: reinfo=showResult(json.loads(excuteResult),remember[0]) if reinfo=="": # print "-----------------------------这是结果哦--------------------------------" # print '没有相关数据信息' return '没有相关数据信息' else: # print "-----------------------------这是结果哦--------------------------------" # print reinfo return reinfo # test() def showReply(sentence): '''程序入口''' sentence=str(sentence) try: return test(sentence) except Exception as e: # print "-----------------------------这是结果哦--------------------------------" # print '我好像不太明白·_·' return '我好像不太明白·_·' # print showReply("查询工单")
mit
-8,308,332,650,456,147,000
23.286076
112
0.51621
false
schleichdi2/OPENNFR-6.3-CORE
opennfr-openembedded-core/meta/lib/oeqa/utils/decorators.py
1
10411
# # Copyright (C) 2013 Intel Corporation # # SPDX-License-Identifier: MIT # # Some custom decorators that can be used by unittests # Most useful is skipUnlessPassed which can be used for # creating dependecies between two test methods. import os import logging import sys import unittest import threading import signal from functools import wraps #get the "result" object from one of the upper frames provided that one of these upper frames is a unittest.case frame class getResults(object): def __init__(self): #dynamically determine the unittest.case frame and use it to get the name of the test method ident = threading.current_thread().ident upperf = sys._current_frames()[ident] while (upperf.f_globals['__name__'] != 'unittest.case'): upperf = upperf.f_back def handleList(items): ret = [] # items is a list of tuples, (test, failure) or (_ErrorHandler(), Exception()) for i in items: s = i[0].id() #Handle the _ErrorHolder objects from skipModule failures if "setUpModule (" in s: ret.append(s.replace("setUpModule (", "").replace(")","")) else: ret.append(s) # Append also the test without the full path testname = s.split('.')[-1] if testname: ret.append(testname) return ret self.faillist = handleList(upperf.f_locals['result'].failures) self.errorlist = handleList(upperf.f_locals['result'].errors) self.skiplist = handleList(upperf.f_locals['result'].skipped) def getFailList(self): return self.faillist def getErrorList(self): return self.errorlist def getSkipList(self): return self.skiplist class skipIfFailure(object): def __init__(self,testcase): self.testcase = testcase def __call__(self,f): @wraps(f) def wrapped_f(*args, **kwargs): res = getResults() if self.testcase in (res.getFailList() or res.getErrorList()): raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase) return f(*args, **kwargs) wrapped_f.__name__ = f.__name__ return wrapped_f class skipIfSkipped(object): def __init__(self,testcase): self.testcase = testcase def __call__(self,f): @wraps(f) def wrapped_f(*args, **kwargs): res = getResults() if self.testcase in res.getSkipList(): raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase) return f(*args, **kwargs) wrapped_f.__name__ = f.__name__ return wrapped_f class skipUnlessPassed(object): def __init__(self,testcase): self.testcase = testcase def __call__(self,f): @wraps(f) def wrapped_f(*args, **kwargs): res = getResults() if self.testcase in res.getSkipList() or \ self.testcase in res.getFailList() or \ self.testcase in res.getErrorList(): raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase) return f(*args, **kwargs) wrapped_f.__name__ = f.__name__ wrapped_f._depends_on = self.testcase return wrapped_f class testcase(object): def __init__(self, test_case): self.test_case = test_case def __call__(self, func): @wraps(func) def wrapped_f(*args, **kwargs): return func(*args, **kwargs) wrapped_f.test_case = self.test_case wrapped_f.__name__ = func.__name__ return wrapped_f class NoParsingFilter(logging.Filter): def filter(self, record): return record.levelno == 100 import inspect def LogResults(original_class): orig_method = original_class.run from time import strftime, gmtime caller = os.path.basename(sys.argv[0]) timestamp = strftime('%Y%m%d%H%M%S',gmtime()) logfile = os.path.join(os.getcwd(),'results-'+caller+'.'+timestamp+'.log') linkfile = os.path.join(os.getcwd(),'results-'+caller+'.log') def get_class_that_defined_method(meth): if inspect.ismethod(meth): for cls in inspect.getmro(meth.__self__.__class__): if cls.__dict__.get(meth.__name__) is meth: return cls meth = meth.__func__ # fallback to __qualname__ parsing if inspect.isfunction(meth): cls = getattr(inspect.getmodule(meth), meth.__qualname__.split('.<locals>', 1)[0].rsplit('.', 1)[0]) if isinstance(cls, type): return cls return None #rewrite the run method of unittest.TestCase to add testcase logging def run(self, result, *args, **kws): orig_method(self, result, *args, **kws) passed = True testMethod = getattr(self, self._testMethodName) #if test case is decorated then use it's number, else use it's name try: test_case = testMethod.test_case except AttributeError: test_case = self._testMethodName class_name = str(get_class_that_defined_method(testMethod)).split("'")[1] #create custom logging level for filtering. custom_log_level = 100 logging.addLevelName(custom_log_level, 'RESULTS') def results(self, message, *args, **kws): if self.isEnabledFor(custom_log_level): self.log(custom_log_level, message, *args, **kws) logging.Logger.results = results logging.basicConfig(filename=logfile, filemode='w', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', datefmt='%H:%M:%S', level=custom_log_level) for handler in logging.root.handlers: handler.addFilter(NoParsingFilter()) local_log = logging.getLogger(caller) #check status of tests and record it tcid = self.id() for (name, msg) in result.errors: if tcid == name.id(): local_log.results("Testcase "+str(test_case)+": ERROR") local_log.results("Testcase "+str(test_case)+":\n"+msg) passed = False for (name, msg) in result.failures: if tcid == name.id(): local_log.results("Testcase "+str(test_case)+": FAILED") local_log.results("Testcase "+str(test_case)+":\n"+msg) passed = False for (name, msg) in result.skipped: if tcid == name.id(): local_log.results("Testcase "+str(test_case)+": SKIPPED") passed = False if passed: local_log.results("Testcase "+str(test_case)+": PASSED") # XXX: In order to avoid race condition when test if exists the linkfile # use bb.utils.lock, the best solution is to create a unique name for the # link file. try: import bb has_bb = True lockfilename = linkfile + '.lock' except ImportError: has_bb = False if has_bb: lf = bb.utils.lockfile(lockfilename, block=True) # Create symlink to the current log if os.path.lexists(linkfile): os.remove(linkfile) os.symlink(logfile, linkfile) if has_bb: bb.utils.unlockfile(lf) original_class.run = run return original_class class TimeOut(BaseException): pass def timeout(seconds): def decorator(fn): if hasattr(signal, 'alarm'): @wraps(fn) def wrapped_f(*args, **kw): current_frame = sys._getframe() def raiseTimeOut(signal, frame): if frame is not current_frame: raise TimeOut('%s seconds' % seconds) prev_handler = signal.signal(signal.SIGALRM, raiseTimeOut) try: signal.alarm(seconds) return fn(*args, **kw) finally: signal.alarm(0) signal.signal(signal.SIGALRM, prev_handler) return wrapped_f else: return fn return decorator __tag_prefix = "tag__" def tag(*args, **kwargs): """Decorator that adds attributes to classes or functions for use with the Attribute (-a) plugin. """ def wrap_ob(ob): for name in args: setattr(ob, __tag_prefix + name, True) for name, value in kwargs.items(): setattr(ob, __tag_prefix + name, value) return ob return wrap_ob def gettag(obj, key, default=None): key = __tag_prefix + key if not isinstance(obj, unittest.TestCase): return getattr(obj, key, default) tc_method = getattr(obj, obj._testMethodName) ret = getattr(tc_method, key, getattr(obj, key, default)) return ret def getAllTags(obj): def __gettags(o): r = {k[len(__tag_prefix):]:getattr(o,k) for k in dir(o) if k.startswith(__tag_prefix)} return r if not isinstance(obj, unittest.TestCase): return __gettags(obj) tc_method = getattr(obj, obj._testMethodName) ret = __gettags(obj) ret.update(__gettags(tc_method)) return ret def timeout_handler(seconds): def decorator(fn): if hasattr(signal, 'alarm'): @wraps(fn) def wrapped_f(self, *args, **kw): current_frame = sys._getframe() def raiseTimeOut(signal, frame): if frame is not current_frame: try: self.target.restart() raise TimeOut('%s seconds' % seconds) except: raise TimeOut('%s seconds' % seconds) prev_handler = signal.signal(signal.SIGALRM, raiseTimeOut) try: signal.alarm(seconds) return fn(self, *args, **kw) finally: signal.alarm(0) signal.signal(signal.SIGALRM, prev_handler) return wrapped_f else: return fn return decorator
gpl-2.0
-7,854,347,878,974,030,000
34.053872
118
0.556046
false
sharescience/ardupilot
Tools/autotest/apmrover2.py
1
21420
#!/usr/bin/env python # Drive APMrover2 in SITL from __future__ import print_function import os import pexpect import shutil import time from common import AutoTest from pysim import util from pymavlink import mavutil # get location of scripts testdir = os.path.dirname(os.path.realpath(__file__)) # HOME = mavutil.location(-35.362938, 149.165085, 584, 270) HOME = mavutil.location(40.071374969556928, -105.22978898137808, 1583.702759, 246) class AutoTestRover(AutoTest): def __init__(self, binary, valgrind=False, gdb=False, speedup=10, frame=None, params=None, gdbserver=False, **kwargs): super(AutoTestRover, self).__init__(**kwargs) self.binary = binary self.valgrind = valgrind self.gdb = gdb self.frame = frame self.params = params self.gdbserver = gdbserver self.home = "%f,%f,%u,%u" % (HOME.lat, HOME.lng, HOME.alt, HOME.heading) self.homeloc = None self.speedup = speedup self.speedup_default = 10 self.sitl = None self.hasInit = False self.log_name = "APMrover2" def init(self): if self.frame is None: self.frame = 'rover' self.apply_parameters_using_sitl() self.sitl = util.start_SITL(self.binary, model=self.frame, home=self.home, speedup=self.speedup, valgrind=self.valgrind, gdb=self.gdb, gdbserver=self.gdbserver) self.mavproxy = util.start_MAVProxy_SITL( 'APMrover2', options=self.mavproxy_options()) self.mavproxy.expect('Telemetry log: (\S+)\r\n') logfile = self.mavproxy.match.group(1) self.progress("LOGFILE %s" % logfile) buildlog = self.buildlogs_path("APMrover2-test.tlog") self.progress("buildlog=%s" % buildlog) if os.path.exists(buildlog): os.unlink(buildlog) try: os.link(logfile, buildlog) except Exception: pass self.mavproxy.expect('Received [0-9]+ parameters') util.expect_setup_callback(self.mavproxy, self.expect_callback) self.expect_list_clear() self.expect_list_extend([self.sitl, self.mavproxy]) self.progress("Started simulator") # get a mavlink connection going connection_string = '127.0.0.1:19550' try: self.mav = mavutil.mavlink_connection(connection_string, robust_parsing=True) except Exception as msg: self.progress("Failed to start mavlink connection on %s" % connection_string) raise self.mav.message_hooks.append(self.message_hook) self.mav.idle_hooks.append(self.idle_hook) self.hasInit = True self.progress("Ready to start testing!") # def reset_and_arm(self): # """Reset RC, set to MANUAL and arm.""" # self.mav.wait_heartbeat() # # ensure all sticks in the middle # self.set_rc_default() # self.mavproxy.send('switch 1\n') # self.mav.wait_heartbeat() # self.disarm_vehicle() # self.mav.wait_heartbeat() # self.arm_vehicle() # # # TEST ARM RADIO # def test_arm_motors_radio(self): # """Test Arming motors with radio.""" # self.progress("Test arming motors with radio") # self.mavproxy.send('switch 6\n') # stabilize/manual mode # self.wait_mode('MANUAL') # self.mavproxy.send('rc 3 1500\n') # throttle at zero # self.mavproxy.send('rc 1 2000\n') # steer full right # self.mavproxy.expect('APM: Throttle armed') # self.mavproxy.send('rc 1 1500\n') # # self.mav.motors_armed_wait() # self.progress("MOTORS ARMED OK") # return True # # # TEST DISARM RADIO # def test_disarm_motors_radio(self): # """Test Disarm motors with radio.""" # self.progress("Test disarming motors with radio") # self.mavproxy.send('switch 6\n') # stabilize/manual mode # self.wait_mode('MANUAL') # self.mavproxy.send('rc 3 1500\n') # throttle at zero # self.mavproxy.send('rc 1 1000\n') # steer full right # tstart = self.get_sim_time() # self.mav.wait_heartbeat() # timeout = 15 # while self.get_sim_time() < tstart + timeout: # self.mav.wait_heartbeat() # if not self.mav.motors_armed(): # disarm_delay = self.get_sim_time() - tstart # self.progress("MOTORS DISARMED OK WITH RADIO") # self.mavproxy.send('rc 1 1500\n') # steer full right # self.mavproxy.send('rc 4 1500\n') # yaw full right # self.progress("Disarm in %ss" % disarm_delay) # return True # self.progress("FAILED TO DISARM WITH RADIO") # return False # # # TEST AUTO DISARM # def test_autodisarm_motors(self): # """Test Autodisarm motors.""" # self.progress("Test Autodisarming motors") # self.mavproxy.send('switch 6\n') # stabilize/manual mode # # NOT IMPLEMENTED ON ROVER # self.progress("MOTORS AUTODISARMED OK") # return True # # # TEST RC OVERRIDE # # TEST RC OVERRIDE TIMEOUT # def test_rtl(self, home, distance_min=5, timeout=250): # """Return, land.""" # super(AutotestRover, self).test_rtl(home, distance_min, timeout) # # def test_mission(self, filename): # """Test a mission from a file.""" # self.progress("Test mission %s" % filename) # num_wp = self.load_mission_from_file(filename) # self.mavproxy.send('wp set 1\n') # self.mav.wait_heartbeat() # self.mavproxy.send('switch 4\n') # auto mode # self.wait_mode('AUTO') # ret = self.wait_waypoint(0, num_wp-1, max_dist=5, timeout=500) # # if ret: # self.mavproxy.expect("Mission Complete") # self.mav.wait_heartbeat() # self.wait_mode('HOLD') # self.progress("test: MISSION COMPLETE: passed=%s" % ret) # return ret ########################################################## # TESTS DRIVE ########################################################## # Drive a square in manual mode def drive_square(self, side=50): """Drive a square, Driving N then E .""" self.progress("TEST SQUARE") success = True # use LEARNING Mode self.mavproxy.send('switch 5\n') self.wait_mode('MANUAL') # first aim north self.progress("\nTurn right towards north") if not self.reach_heading_manual(10): success = False # save bottom left corner of box as waypoint self.progress("Save WP 1 & 2") self.save_wp() # pitch forward to fly north self.progress("\nGoing north %u meters" % side) if not self.reach_distance_manual(side): success = False # save top left corner of square as waypoint self.progress("Save WP 3") self.save_wp() # roll right to fly east self.progress("\nGoing east %u meters" % side) if not self.reach_heading_manual(100): success = False if not self.reach_distance_manual(side): success = False # save top right corner of square as waypoint self.progress("Save WP 4") self.save_wp() # pitch back to fly south self.progress("\nGoing south %u meters" % side) if not self.reach_heading_manual(190): success = False if not self.reach_distance_manual(side): success = False # save bottom right corner of square as waypoint self.progress("Save WP 5") self.save_wp() # roll left to fly west self.progress("\nGoing west %u meters" % side) if not self.reach_heading_manual(280): success = False if not self.reach_distance_manual(side): success = False # save bottom left corner of square (should be near home) as waypoint self.progress("Save WP 6") self.save_wp() return success def drive_left_circuit(self): """Drive a left circuit, 50m on a side.""" self.mavproxy.send('switch 6\n') self.wait_mode('MANUAL') self.set_rc(3, 2000) self.progress("Driving left circuit") # do 4 turns for i in range(0, 4): # hard left self.progress("Starting turn %u" % i) self.set_rc(1, 1000) if not self.wait_heading(270 - (90*i), accuracy=10): return False self.set_rc(1, 1500) self.progress("Starting leg %u" % i) if not self.wait_distance(50, accuracy=7): return False self.set_rc(3, 1500) self.progress("Circuit complete") return True # def test_throttle_failsafe(self, home, distance_min=10, side=60, # timeout=300): # """Fly east, Failsafe, return, land.""" # # self.mavproxy.send('switch 6\n') # manual mode # self.wait_mode('MANUAL') # self.mavproxy.send("param set FS_ACTION 1\n") # # # first aim east # self.progress("turn east") # if not self.reach_heading_manual(135): # return False # # # fly east 60 meters # self.progress("# Going forward %u meters" % side) # if not self.reach_distance_manual(side): # return False # # # pull throttle low # self.progress("# Enter Failsafe") # self.mavproxy.send('rc 3 900\n') # # tstart = self.get_sim_time() # success = False # while self.get_sim_time() < tstart + timeout and not success: # m = self.mav.recv_match(type='VFR_HUD', blocking=True) # pos = self.mav.location() # home_distance = self.get_distance(home, pos) # self.progress("Alt: %u HomeDistance: %.0f" % # (m.alt, home_distance)) # # check if we've reached home # if home_distance <= distance_min: # self.progress("RTL Complete") # success = True # # # reduce throttle # self.mavproxy.send('rc 3 1500\n') # self.mavproxy.expect('APM: Failsafe ended') # self.mavproxy.send('switch 2\n') # manual mode # self.mav.wait_heartbeat() # self.wait_mode('MANUAL') # # if success: # self.progress("Reached failsafe home OK") # return True # else: # self.progress("Failed to reach Home on failsafe RTL - " # "timed out after %u seconds" % timeout) # return False ################################################# # AUTOTEST ALL ################################################# def drive_mission(self, filename): """Drive a mission from a file.""" self.progress("Driving mission %s" % filename) self.mavproxy.send('wp load %s\n' % filename) self.mavproxy.expect('Flight plan received') self.mavproxy.send('wp list\n') self.mavproxy.expect('Requesting [0-9]+ waypoints') self.mavproxy.send('switch 4\n') # auto mode self.set_rc(3, 1500) self.wait_mode('AUTO') if not self.wait_waypoint(1, 4, max_dist=5): return False self.wait_mode('HOLD') self.progress("Mission OK") return True def do_get_banner(self): self.mavproxy.send("long DO_SEND_BANNER 1\n") start = time.time() while True: m = self.mav.recv_match(type='STATUSTEXT', blocking=True, timeout=1) if m is not None and "ArduRover" in m.text: self.progress("banner received: %s" % m.text) return True if time.time() - start > 10: break self.progress("banner not received") return False def drive_brake_get_stopping_distance(self, speed): # measure our stopping distance: old_cruise_speed = self.get_parameter('CRUISE_SPEED') old_accel_max = self.get_parameter('ATC_ACCEL_MAX') # controller tends not to meet cruise speed (max of ~14 when 15 # set), thus *1.2 self.set_parameter('CRUISE_SPEED', speed*1.2) # at time of writing, the vehicle is only capable of 10m/s/s accel self.set_parameter('ATC_ACCEL_MAX', 15) self.mavproxy.send("mode STEERING\n") self.wait_mode('STEERING') self.set_rc(3, 2000) self.wait_groundspeed(15, 100) initial = self.mav.location() initial_time = time.time() while time.time() - initial_time < 2: # wait for a position update from the autopilot start = self.mav.location() if start != initial: break self.set_rc(3, 1500) self.wait_groundspeed(0, 0.2) # why do we not stop?! initial = self.mav.location() initial_time = time.time() while time.time() - initial_time < 2: # wait for a position update from the autopilot stop = self.mav.location() if stop != initial: break delta = self.get_distance(start, stop) self.set_parameter('CRUISE_SPEED', old_cruise_speed) self.set_parameter('ATC_ACCEL_MAX', old_accel_max) return delta def drive_brake(self): old_using_brake = self.get_parameter('ATC_BRAKE') old_cruise_speed = self.get_parameter('CRUISE_SPEED') self.set_parameter('CRUISE_SPEED', 15) self.set_parameter('ATC_BRAKE', 0) distance_without_brakes = self.drive_brake_get_stopping_distance(15) # brakes on: self.set_parameter('ATC_BRAKE', 1) distance_with_brakes = self.drive_brake_get_stopping_distance(15) # revert state: self.set_parameter('ATC_BRAKE', old_using_brake) self.set_parameter('CRUISE_SPEED', old_cruise_speed) delta = distance_without_brakes - distance_with_brakes if delta < distance_without_brakes * 0.05: # 5% isn't asking for much self.progress("Brakes have negligible effect" "(with=%0.2fm without=%0.2fm delta=%0.2fm)" % (distance_with_brakes, distance_without_brakes, delta)) return False else: self.progress( "Brakes work (with=%0.2fm without=%0.2fm delta=%0.2fm)" % (distance_with_brakes, distance_without_brakes, delta)) return True def drive_rtl_mission(self): mission_filepath = os.path.join(testdir, "ArduRover-Missions", "rtl.txt") self.mavproxy.send('wp load %s\n' % mission_filepath) self.mavproxy.expect('Flight plan received') self.mavproxy.send('switch 4\n') # auto mode self.set_rc(3, 1500) self.wait_mode('AUTO') self.mavproxy.expect('Executing RTL') m = self.mav.recv_match(type='NAV_CONTROLLER_OUTPUT', blocking=True, timeout=0.1) if m is None: self.progress("Did not receive NAV_CONTROLLER_OUTPUT message") return False wp_dist_min = 5 if m.wp_dist < wp_dist_min: self.progress("Did not start at least 5 metres from destination") return False self.progress("NAV_CONTROLLER_OUTPUT.wp_dist looks good (%u >= %u)" % (m.wp_dist, wp_dist_min,)) self.wait_mode('HOLD') pos = self.mav.location() home_distance = self.get_distance(HOME, pos) home_distance_max = 5 if home_distance > home_distance_max: self.progress("Did not get home (%u metres distant > %u)" % (home_distance, home_distance_max)) return False self.mavproxy.send('switch 6\n') self.wait_mode('MANUAL') self.progress("RTL Mission OK") return True def test_servorelayevents(self): self.mavproxy.send("relay set 0 0\n") off = self.get_parameter("SIM_PIN_MASK") self.mavproxy.send("relay set 0 1\n") on = self.get_parameter("SIM_PIN_MASK") if on == off: self.progress("Pin mask unchanged after relay command") return False self.progress("Pin mask changed after relay command") return True def autotest(self): """Autotest APMrover2 in SITL.""" if not self.hasInit: self.init() self.progress("Started simulator") failed = False e = 'None' try: self.progress("Waiting for a heartbeat with mavlink protocol %s" % self.mav.WIRE_PROTOCOL_VERSION) self.mav.wait_heartbeat() self.progress("Setting up RC parameters") self.set_rc_default() self.set_rc(8, 1800) self.progress("Waiting for GPS fix") self.mav.wait_gps_fix() self.homeloc = self.mav.location() self.progress("Home location: %s" % self.homeloc) self.mavproxy.send('switch 6\n') # Manual mode self.wait_mode('MANUAL') self.progress("Waiting reading for arm") self.wait_ready_to_arm() if not self.arm_vehicle(): self.progress("Failed to ARM") failed = True self.progress("#") self.progress("########## Drive an RTL mission ##########") self.progress("#") # Drive a square in learning mode # self.reset_and_arm() if not self.drive_rtl_mission(): self.progress("Failed RTL mission") failed = True self.progress("#") self.progress("########## Drive a square and save WPs with CH7" "switch ##########") self.progress("#") # Drive a square in learning mode # self.reset_and_arm() if not self.drive_square(): self.progress("Failed drive square") failed = True if not self.drive_mission(os.path.join(testdir, "rover1.txt")): self.progress("Failed mission") failed = True if not self.drive_brake(): self.progress("Failed brake") failed = True if not self.disarm_vehicle(): self.progress("Failed to DISARM") failed = True # do not move this to be the first test. MAVProxy's dedupe # function may bite you. self.progress("Getting banner") if not self.do_get_banner(): self.progress("FAILED: get banner") failed = True self.progress("Getting autopilot capabilities") if not self.do_get_autopilot_capabilities(): self.progress("FAILED: get capabilities") failed = True self.progress("Setting mode via MAV_COMMAND_DO_SET_MODE") if not self.do_set_mode_via_command_long(): failed = True # test ServoRelayEvents: self.progress("########## Test ServoRelayEvents ##########") if not self.test_servorelayevents(): self.progress("Failed servo relay events") failed = True # Throttle Failsafe self.progress("#") self.progress("########## Test Failsafe ##########") self.progress("#") # self.reset_and_arm() # if not self.test_throttle_failsafe(HOME, distance_min=4): # self.progress("Throttle failsafe failed") # sucess = False if not self.log_download(self.buildlogs_path("APMrover2-log.bin")): self.progress("Failed log download") failed = True # if not drive_left_circuit(self): # self.progress("Failed left circuit") # failed = True # if not drive_RTL(self): # self.progress("Failed RTL") # failed = True except pexpect.TIMEOUT as e: self.progress("Failed with timeout") failed = True self.close() if failed: self.progress("FAILED: %s" % e) return False return True
gpl-3.0
-279,899,592,296,780,030
35.243655
79
0.530159
false
PinguinoIDE/pinguino-ide
pinguino/qtgui/ide/tools/paths.py
1
5277
#!/usr/bin/env python #-*- coding: utf-8 -*- #import os from PySide2 import QtCore ## Python3 compatibility #if os.getenv("PINGUINO_PYTHON") is "3": ##Python3 #from configparser import RawConfigParser #else: ##Python2 #from ConfigParser import RawConfigParser from ..methods.dialogs import Dialogs ######################################################################## class Paths(object): def __init__(self): """""" self.load_paths() self.connect(self.main.lineEdit_path_sdcc_bin, QtCore.SIGNAL("editingFinished()"), self.save_paths) self.connect(self.main.lineEdit_path_gcc_bin, QtCore.SIGNAL("editingFinished()"), self.save_paths) self.connect(self.main.lineEdit_path_xc8_bin, QtCore.SIGNAL("editingFinished()"), self.save_paths) self.connect(self.main.lineEdit_path_8_libs, QtCore.SIGNAL("editingFinished()"), self.save_paths) self.connect(self.main.lineEdit_path_32_libs, QtCore.SIGNAL("editingFinished()"), self.save_paths) self.connect(self.main.pushButton_dir_sdcc, QtCore.SIGNAL("clicked()"), lambda :self.open_path_for(self.main.lineEdit_path_sdcc_bin)) self.connect(self.main.pushButton_dir_gcc, QtCore.SIGNAL("clicked()"), lambda :self.open_path_for(self.main.lineEdit_path_gcc_bin)) self.connect(self.main.pushButton_dir_xc8, QtCore.SIGNAL("clicked()"), lambda :self.open_path_for(self.main.lineEdit_path_xc8_bin)) self.connect(self.main.pushButton_dir_8bit, QtCore.SIGNAL("clicked()"), lambda :self.open_path_for(self.main.lineEdit_path_8_libs)) self.connect(self.main.pushButton_dir_32bit, QtCore.SIGNAL("clicked()"), lambda :self.open_path_for(self.main.lineEdit_path_32_libs)) self.connect(self.main.pushButton_dir_libs, QtCore.SIGNAL("clicked()"), lambda :self.open_path_for(self.main.lineEdit_path_custom_libs)) self.connect(self.main.pushButton_dir_mplab, QtCore.SIGNAL("clicked()"), lambda :self.open_path_for(self.main.lineEdit_path_mplab)) self.connect(self.main.checkBox_paths_default, QtCore.SIGNAL("toggled(bool)"), self.set_default_values) #---------------------------------------------------------------------- def open_path_for(self, lineedit): """""" dir_path = Dialogs.set_open_dir(self) if dir_path: lineedit.setText(dir_path) self.save_paths() #---------------------------------------------------------------------- def save_paths(self): """""" sdcc_bin = self.main.lineEdit_path_sdcc_bin.text() gcc_bin = self.main.lineEdit_path_gcc_bin.text() xc8_bin = self.main.lineEdit_path_xc8_bin.text() p8libs = self.main.lineEdit_path_8_libs.text() p32libs = self.main.lineEdit_path_32_libs.text() #self.configIDE.set("Paths", "sdcc_bin", sdcc_bin) #self.configIDE.set("Paths", "gcc_bin", gcc_bin) #self.configIDE.set("Paths", "xc8_bin", xc8_bin) #self.configIDE.set("Paths", "pinguino_8_libs", p8libs) #self.configIDE.set("Paths", "pinguino_32_libs", p32libs) self.configIDE.set("PathsCustom", "sdcc_bin", sdcc_bin) self.configIDE.set("PathsCustom", "gcc_bin", gcc_bin) self.configIDE.set("PathsCustom", "xc8_bin", xc8_bin) self.configIDE.set("PathsCustom", "pinguino_8_libs", p8libs) self.configIDE.set("PathsCustom", "pinguino_32_libs", p32libs) self.configIDE.save_config() #---------------------------------------------------------------------- def load_paths(self, section=None): """""" self.configIDE.load_config() if section is None: section = self.configIDE.config("Features", "pathstouse", "Paths") self.main.checkBox_paths_default.setChecked(section=="Paths") def short(section, option): if section == "Paths": return self.configIDE.get(section, option) elif section == "PathsCustom": return self.configIDE.config(section, option, self.configIDE.get("Paths", option)) sdcc_bin = short(section, "sdcc_bin") gcc_bin = short(section, "gcc_bin") xc8_bin = short(section, "xc8_bin") p8libs = short(section, "pinguino_8_libs") p32libs = short(section, "pinguino_32_libs") self.main.lineEdit_path_sdcc_bin.setText(sdcc_bin) self.main.lineEdit_path_gcc_bin.setText(gcc_bin) self.main.lineEdit_path_xc8_bin.setText(xc8_bin) self.main.lineEdit_path_8_libs.setText(p8libs) self.main.lineEdit_path_32_libs.setText(p32libs) #---------------------------------------------------------------------- def set_default_values(self, default): """""" self.configIDE.load_config() if default: self.load_paths(section="Paths") self.configIDE.set("Features", "pathstouse", "Paths") else: self.load_paths(section="PathsCustom") self.configIDE.set("Features", "pathstouse", "PathsCustom") self.main.groupBox_compilers.setEnabled(not default) self.main.groupBox_libraries.setEnabled(not default) self.main.groupBox_icsp.setEnabled(not default) self.configIDE.save_config()
gpl-2.0
-3,444,204,326,737,466,000
39.592308
144
0.602615
false
alexanderfefelov/nav
python/nav/smidumps/itw_mibv3.py
1
895755
# python version 1.0 DO NOT EDIT # # Generated by smidump version 0.4.8: # # smidump -f python IT-WATCHDOGS-MIB-V3 FILENAME = "./itw_mibv3.mib" MIB = { "moduleName" : "IT-WATCHDOGS-MIB-V3", "IT-WATCHDOGS-MIB-V3" : { "nodetype" : "module", "language" : "SMIv2", "organization" : """I.T. Watchdogs""", "contact" : """[email protected]""", "description" : """The MIB for I.T. Watchdogs Products""", "revisions" : ( { "date" : "2010-10-12 00:00", "description" : """[Revision added by libsmi due to a LAST-UPDATED clause.]""", }, ), "identity node" : "itwatchdogs", }, "imports" : ( {"module" : "SNMPv2-TC", "name" : "DisplayString"}, {"module" : "SNMPv2-SMI", "name" : "MODULE-IDENTITY"}, {"module" : "SNMPv2-SMI", "name" : "OBJECT-TYPE"}, {"module" : "SNMPv2-SMI", "name" : "enterprises"}, {"module" : "SNMPv2-SMI", "name" : "Gauge32"}, {"module" : "SNMPv2-SMI", "name" : "NOTIFICATION-TYPE"}, ), "nodes" : { "itwatchdogs" : { "nodetype" : "node", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373", "status" : "current", }, # node "owl" : { "nodetype" : "node", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3", }, # node "deviceInfo" : { "nodetype" : "node", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1", }, # node "productTitle" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.1", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Product name""", }, # scalar "productVersion" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Product version""", }, # scalar "productFriendlyName" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """User-assigned name""", }, # scalar "productMacAddress" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Product's unique MAC address""", }, # scalar "productUrl" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Product's main URL access point""", }, # scalar "alarmTripType" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.6", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "9" }, ], "range" : { "min" : "0", "max" : "9" }, }, }, "access" : "readonly", "description" : """Type of alarm trip. 0 = None, 1 = Low, 2 = High, 3 = Unplugged""", }, # scalar "productHardware" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.7", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Product's hardware type""", }, # scalar "sensorCountsBase" : { "nodetype" : "node", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8", }, # node "sensorCounts" : { "nodetype" : "node", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1", }, # node "climateCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.2", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of climate monitors currently plugged in""", }, # scalar "powerMonitorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.3", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of power monitors currently plugged in""", }, # scalar "tempSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.4", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of temperature sensors currently plugged in""", }, # scalar "airflowSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of airflow sensors currently plugged in""", }, # scalar "powerOnlyCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.6", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of power only monitors currently plugged in""", }, # scalar "doorSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.7", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of door sensors currently plugged in""", }, # scalar "waterSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.8", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of water sensors currently plugged in""", }, # scalar "currentSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.9", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of current sensors currently plugged in""", }, # scalar "millivoltSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.10", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of millivolt sensors currently plugged in""", }, # scalar "power3ChSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.11", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of 3 channel power monitors currently plugged in""", }, # scalar "outletCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.12", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of outlets currently plugged in""", }, # scalar "vsfcCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.13", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of fan controller monitors currently plugged in""", }, # scalar "ctrl3ChCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.14", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of 3 channel controllers currently plugged in""", }, # scalar "ctrlGrpAmpsCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.15", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of amperage controllers currently plugged in""", }, # scalar "ctrlOutputCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.16", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of output controllers currently plugged in""", }, # scalar "dewpointSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.17", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of dewpoint sensors currently plugged in""", }, # scalar "digitalSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.18", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of digital sensors currently plugged in""", }, # scalar "dstsSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.19", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of DSTS controllers currently plugged in""", }, # scalar "cpmSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.20", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of city power sensors currently plugged in""", }, # scalar "smokeAlarmSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.21", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of smoke alarm sensors currently plugged in""", }, # scalar "neg48VdcSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.22", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of -48Vdc sensors currently plugged in""", }, # scalar "pos30VdcSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.23", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of 30Vdc sensors currently plugged in""", }, # scalar "analogSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.24", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of remote analog inputs currently plugged in""", }, # scalar "ctrl3ChIECCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.25", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of IEC 3 channel controllers currently plugged in""", }, # scalar "climateRelayCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.26", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of climate relay monitors currently plugged in""", }, # scalar "ctrlRelayCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.27", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of relay controllers currently plugged in""", }, # scalar "airSpeedSwitchSensorCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.28", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of air speed switch sensors currently plugged in""", }, # scalar "powerDMCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.29", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of DM48 current sensors currently plugged in""", }, # scalar "ioExpanderCount" : { "nodetype" : "scalar", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.1.8.1.30", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of IO expander devices currently plugged in""", }, # scalar "climateTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2", "status" : "current", "description" : """Climate sensors (internal sensors for climate units)""", }, # table "climateEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1", "status" : "current", "linkage" : [ "climateIndex", ], "description" : """Entry in the climate table: each entry contains an index (climateIndex) and other details""", }, # row "climateIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "1" }, ], "range" : { "min" : "1", "max" : "1" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "climateSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "climateName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "climateAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "climateTempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-50", "max" : "100" }, ], "range" : { "min" : "-50", "max" : "100" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current reading for Temperature (C)""", }, # column "climateTempF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.6", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-58", "max" : "212" }, ], "range" : { "min" : "-58", "max" : "212" }, }, }, "access" : "readonly", "units" : "Degress Fahrenheit", "description" : """Current reading for Temperature (F)""", }, # column "climateHumidity" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.7", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Humidity""", }, # column "climateLight" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.8", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Ambient Light""", }, # column "climateAirflow" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.9", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Airflow""", }, # column "climateSound" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.10", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Sound""", }, # column "climateIO1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.11", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 1""", }, # column "climateIO2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.12", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 2""", }, # column "climateIO3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.13", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 3""", }, # column "climateDewPointC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.14", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-50", "max" : "100" }, ], "range" : { "min" : "-50", "max" : "100" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current reading for Dew Point (C)""", }, # column "climateDewPointF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.2.1.15", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-58", "max" : "212" }, ], "range" : { "min" : "-58", "max" : "212" }, }, }, "access" : "readonly", "units" : "Degress Fahrenheit", "description" : """Current reading for Dew Point (F)""", }, # column "powMonTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3", "status" : "current", "description" : """A table of Power Monitors""", }, # table "powMonEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1", "status" : "current", "linkage" : [ "powMonIndex", ], "description" : """Entry in the power monitor table: each entry contains an index (powMonIndex) and other power monitoring details""", }, # row "powMonIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "powMonSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "powMonName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "powMonAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "powMonKWattHrs" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "KWh", "description" : """Current reading for KWatt-Hours""", }, # column "powMonVolts" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.6", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts""", }, # column "powMonVoltMax" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.7", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Max)""", }, # column "powMonVoltMin" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.8", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Min)""", }, # column "powMonVoltPeak" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.9", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Peak)""", }, # column "powMonDeciAmps" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.10", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for DeciAmps""", }, # column "powMonRealPower" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.11", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Real Power""", }, # column "powMonApparentPower" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.12", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volt-Amps", "description" : """Current reading for Apparent Power""", }, # column "powMonPowerFactor" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.13", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Power Factor""", }, # column "powMonOutlet1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.14", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "Outlet 1", "description" : """Outlet 1 Trap""", }, # column "powMonOutlet2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.3.1.15", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "Outlet 2", "description" : """Outlet 2 Trap""", }, # column "tempSensorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.4", "status" : "current", "description" : """A table of temperature sensors""", }, # table "tempSensorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.4.1", "status" : "current", "linkage" : [ "tempSensorIndex", ], "description" : """Entry in the temperature sensor table: each entry contains an index (tempIndex) and other sensor details""", }, # row "tempSensorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.4.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "tempSensorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.4.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "tempSensorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.4.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "tempSensorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.4.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "tempSensorTempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.4.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-50", "max" : "100" }, ], "range" : { "min" : "-50", "max" : "100" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Temperature in Celsius""", }, # column "tempSensorTempF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.4.1.6", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-58", "max" : "212" }, ], "range" : { "min" : "-58", "max" : "212" }, }, }, "access" : "readonly", "units" : "Degrees Fahrenheit", "description" : """Temperature in Fahrenheit""", }, # column "airFlowSensorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5", "status" : "current", "description" : """A table of airflow sensors""", }, # table "airFlowSensorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5.1", "status" : "current", "linkage" : [ "airFlowSensorIndex", ], "description" : """Entry in the air flow sensor table: each entry contains an index (airFlowSensorIndex) and other sensor details""", }, # row "airFlowSensorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "airFlowSensorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "airFlowSensorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "airFlowSensorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "airFlowSensorTempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-50", "max" : "100" }, ], "range" : { "min" : "-50", "max" : "100" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Temperature reading in C""", }, # column "airFlowSensorTempF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5.1.6", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-58", "max" : "212" }, ], "range" : { "min" : "-58", "max" : "212" }, }, }, "access" : "readonly", "units" : "Degrees Fahrenheit", "description" : """Temperature reading in F""", }, # column "airFlowSensorFlow" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5.1.7", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Air flow reading""", }, # column "airFlowSensorHumidity" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5.1.8", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Humidity reading""", }, # column "airFlowSensorDewPointC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5.1.9", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-50", "max" : "100" }, ], "range" : { "min" : "-50", "max" : "100" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current reading for Dew Point (C)""", }, # column "airFlowSensorDewPointF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.5.1.10", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-58", "max" : "212" }, ], "range" : { "min" : "-58", "max" : "212" }, }, }, "access" : "readonly", "units" : "Degress Fahrenheit", "description" : """Current reading for Dew Point (F)""", }, # column "powerTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.6", "status" : "current", "description" : """A table of Power-Only devices""", }, # table "powerEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.6.1", "status" : "current", "linkage" : [ "powerIndex", ], "description" : """Entry in the power-only device table: each entry contains an index (powerIndex) and other power details""", }, # row "powerIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.6.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "powerSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.6.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "powerName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.6.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "powerAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.6.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "powerVolts" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.6.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts""", }, # column "powerDeciAmps" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.6.1.6", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for DeciAmps""", }, # column "powerRealPower" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.6.1.7", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Real Power""", }, # column "powerApparentPower" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.6.1.8", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volt-Amps", "description" : """Current reading for Apparent Power""", }, # column "powerPowerFactor" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.6.1.9", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Power Factor""", }, # column "doorSensorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.7", "status" : "current", "description" : """A table of door sensors""", }, # table "doorSensorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.7.1", "status" : "current", "linkage" : [ "doorSensorIndex", ], "description" : """Entry in the door sensor table: each entry contains an index (doorSensorIndex) and other sensor details""", }, # row "doorSensorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.7.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "doorSensorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.7.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "doorSensorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.7.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "doorSensorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.7.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "doorSensorStatus" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.7.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Door sensor status""", }, # column "waterSensorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.8", "status" : "current", "description" : """A table of water sensors""", }, # table "waterSensorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.8.1", "status" : "current", "linkage" : [ "waterSensorIndex", ], "description" : """Entry in the water sensor table: each entry contains an index (waterSensorIndex) and other sensor details""", }, # row "waterSensorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.8.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "waterSensorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.8.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "waterSensorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.8.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "waterSensorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.8.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "waterSensorDampness" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.8.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Dampness of the water sensor""", }, # column "currentMonitorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.9", "status" : "current", "description" : """A table of current monitors""", }, # table "currentMonitorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.9.1", "status" : "current", "linkage" : [ "currentMonitorIndex", ], "description" : """Entry in the current monitor table: each entry contains an index (currentMonitorIndex) and other sensor details""", }, # row "currentMonitorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.9.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "currentMonitorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.9.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "currentMonitorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.9.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "currentMonitorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.9.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "currentMonitorDeciAmps" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.9.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "30" }, ], "range" : { "min" : "0", "max" : "30" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "millivoltMonitorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.10", "status" : "current", "description" : """A table of millivolt monitors""", }, # table "millivoltMonitorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.10.1", "status" : "current", "linkage" : [ "millivoltMonitorIndex", ], "description" : """Entry in the millivolt monitor table: each entry contains an index (millivoltMonitorIndex) and other sensor details""", }, # row "millivoltMonitorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.10.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "millivoltMonitorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.10.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "millivoltMonitorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.10.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "millivoltMonitorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.10.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "millivoltMonitorMV" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.10.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "5000" }, ], "range" : { "min" : "0", "max" : "5000" }, }, }, "access" : "readonly", "units" : "millivolts", "description" : """millivolts""", }, # column "pow3ChTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11", "status" : "current", "description" : """A table of Power Monitor 3 Channel""", }, # table "pow3ChEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1", "status" : "current", "linkage" : [ "pow3ChIndex", ], "description" : """Entry in the power monitor 3 channel table: each entry contains an index (pow3ChIndex) and other power monitoring details""", }, # row "pow3ChIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "pow3ChSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "pow3ChName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "pow3ChAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "pow3ChKWattHrsA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "KWh", "description" : """Current reading for KWatt-Hours (Phase A)""", }, # column "pow3ChVoltsA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.6", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Phase A)""", }, # column "pow3ChVoltMaxA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.7", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Max-Volts (Phase A)""", }, # column "pow3ChVoltMinA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.8", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Min-Volts (Phase A)""", }, # column "pow3ChVoltPeakA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.9", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts", "description" : """Current reading for Peak-Volts (Phase A)""", }, # column "pow3ChDeciAmpsA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.10", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for DeciAmps (Phase A)""", }, # column "pow3ChRealPowerA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.11", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Real Power (Phase A)""", }, # column "pow3ChApparentPowerA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.12", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volt-Amps", "description" : """Current reading for Apparent Power (Phase A)""", }, # column "pow3ChPowerFactorA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.13", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Power Factor (Phase A)""", }, # column "pow3ChKWattHrsB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.14", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "KWh", "description" : """Current reading for KWatt-Hours (Phase B)""", }, # column "pow3ChVoltsB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.15", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Phase B)""", }, # column "pow3ChVoltMaxB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.16", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Max-Volts (Phase B)""", }, # column "pow3ChVoltMinB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.17", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Min-Volts (Phase B)""", }, # column "pow3ChVoltPeakB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.18", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts", "description" : """Current reading for Peak-Volts (Phase B)""", }, # column "pow3ChDeciAmpsB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.19", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for DeciAmps (Phase B)""", }, # column "pow3ChRealPowerB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.20", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Real Power (Phase B)""", }, # column "pow3ChApparentPowerB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.21", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volt-Amps", "description" : """Current reading for Apparent Power (Phase B)""", }, # column "pow3ChPowerFactorB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.22", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Power Factor (Phase B)""", }, # column "pow3ChKWattHrsC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.23", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "KWh", "description" : """Current reading for KWatt-Hours (Phase C)""", }, # column "pow3ChVoltsC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.24", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Phase C)""", }, # column "pow3ChVoltMaxC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.25", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Max-Volts (Phase C)""", }, # column "pow3ChVoltMinC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.26", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Min-Volts (Phase C)""", }, # column "pow3ChVoltPeakC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.27", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts", "description" : """Current reading for Peak-Volts (Phase C)""", }, # column "pow3ChDeciAmpsC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.28", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for DeciAmps (Phase C)""", }, # column "pow3ChRealPowerC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.29", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Real Power (Phase C)""", }, # column "pow3ChApparentPowerC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.30", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volt-Amps", "description" : """Current reading for Apparent Power (Phase C)""", }, # column "pow3ChPowerFactorC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.11.1.31", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Power Factor (Phase C)""", }, # column "outletTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.12", "status" : "current", "description" : """A table of outlets""", }, # table "outletEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.12.1", "status" : "current", "linkage" : [ "outletIndex", ], "description" : """Entry in the outlet table: each entry contains an index (outletIndex) and other sensor details""", }, # row "outletIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.12.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "outletSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.12.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "outletName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.12.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "outletAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.12.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "outlet1Status" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.12.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Outlet 1 status""", }, # column "outlet2Status" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.12.1.6", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Outlet 2 status""", }, # column "vsfcTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13", "status" : "current", "description" : """VSFC sensors (internal sensors for VSFC units)""", }, # table "vsfcEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1", "status" : "current", "linkage" : [ "vsfcIndex", ], "description" : """Entry in the vsfc table: each entry contains an index (vsfcIndex) and other details""", }, # row "vsfcIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "1" }, ], "range" : { "min" : "1", "max" : "1" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "vsfcSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "vsfcName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "vsfcAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "vsfcSetPointC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "18", "max" : "38" }, ], "range" : { "min" : "18", "max" : "38" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current temperature set point in C""", }, # column "vsfcSetPointF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.6", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "65", "max" : "100" }, ], "range" : { "min" : "65", "max" : "100" }, }, }, "access" : "readonly", "units" : "Degrees Fahrenheit", "description" : """Current temperature set point in F""", }, # column "vsfcFanSpeed" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.7", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Fan Speed""", }, # column "vsfcIntTempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.8", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-20", "max" : "50" }, ], "range" : { "min" : "-20", "max" : "50" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current internal temperature reading in C""", }, # column "vsfcIntTempF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.9", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-4", "max" : "122" }, ], "range" : { "min" : "-4", "max" : "122" }, }, }, "access" : "readonly", "units" : "Degrees Fahrenheit", "description" : """Current internal temperature reading in F""", }, # column "vsfcExt1TempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.10", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-20", "max" : "50" }, ], "range" : { "min" : "-20", "max" : "50" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current reading for external temp 1 in C""", }, # column "vsfcExt1TempF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.11", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-20", "max" : "122" }, ], "range" : { "min" : "-20", "max" : "122" }, }, }, "access" : "readonly", "units" : "Degrees Fahrenheit", "description" : """Current reading for external temp 1 in F""", }, # column "vsfcExt2TempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.12", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-20", "max" : "50" }, ], "range" : { "min" : "-20", "max" : "50" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current reading for external temp 2 in C""", }, # column "vsfcExt2TempF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.13", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-20", "max" : "122" }, ], "range" : { "min" : "-20", "max" : "122" }, }, }, "access" : "readonly", "units" : "Degrees Fahrenheit", "description" : """Current reading for external temp 1 in F""", }, # column "vsfcExt3TempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.14", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-20", "max" : "50" }, ], "range" : { "min" : "-20", "max" : "50" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current reading for external temp 3 in C""", }, # column "vsfcExt3TempF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.15", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-20", "max" : "122" }, ], "range" : { "min" : "-20", "max" : "122" }, }, }, "access" : "readonly", "units" : "Degrees Fahrenheit", "description" : """Current reading for external temp 1 in F""", }, # column "vsfcExt4TempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.16", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-20", "max" : "50" }, ], "range" : { "min" : "-20", "max" : "50" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current reading for external temp 4 in C""", }, # column "vsfcExt4TempF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.13.1.17", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-20", "max" : "122" }, ], "range" : { "min" : "-20", "max" : "122" }, }, }, "access" : "readonly", "units" : "Degrees Fahrenheit", "description" : """Current reading for external temp 1 in F""", }, # column "ctrl3ChTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14", "status" : "current", "description" : """A table of a 3 phase outlet control""", }, # table "ctrl3ChEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1", "status" : "current", "linkage" : [ "ctrl3ChIndex", ], "description" : """Entry in the 3 phase outlet control table: each entry contains an index (ctrl3ChIndex) and other outlet control monitoring details""", }, # row "ctrl3ChIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "1" }, ], "range" : { "min" : "1", "max" : "1" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "ctrl3ChSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "ctrl3ChName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "ctrl3ChAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "ctrl3ChVoltsA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Phase A)""", }, # column "ctrl3ChVoltPeakA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.6", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Peak-Volts (Phase A)""", }, # column "ctrl3ChDeciAmpsA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.7", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for DeciAmps (Phase A)""", }, # column "ctrl3ChDeciAmpsPeakA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.8", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for Peak-DeciAmps (Phase A)""", }, # column "ctrl3ChRealPowerA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.9", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Real Power (Phase A)""", }, # column "ctrl3ChApparentPowerA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.10", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volt-Amps", "description" : """Current reading for Apparent Power (Phase A)""", }, # column "ctrl3ChPowerFactorA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.11", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Power Factor (Phase A)""", }, # column "ctrl3ChVoltsB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.12", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Phase B)""", }, # column "ctrl3ChVoltPeakB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.13", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Peak-Volts (Phase B)""", }, # column "ctrl3ChDeciAmpsB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.14", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for DeciAmps (Phase B)""", }, # column "ctrl3ChDeciAmpsPeakB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.15", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for Peak-DeciAmps (Phase B)""", }, # column "ctrl3ChRealPowerB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.16", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Real Power (Phase B)""", }, # column "ctrl3ChApparentPowerB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.17", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volt-Amps", "description" : """Current reading for Apparent Power (Phase B)""", }, # column "ctrl3ChPowerFactorB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.18", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Power Factor (Phase B)""", }, # column "ctrl3ChVoltsC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.19", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Phase C)""", }, # column "ctrl3ChVoltPeakC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.20", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Peak-Volts (Phase C)""", }, # column "ctrl3ChDeciAmpsC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.21", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for DeciAmps (Phase C)""", }, # column "ctrl3ChDeciAmpsPeakC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.22", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for Peak-DeciAmps (Phase C)""", }, # column "ctrl3ChRealPowerC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.23", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Real Power (Phase C)""", }, # column "ctrl3ChApparentPowerC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.24", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volt-Amps", "description" : """Current reading for Apparent Power (Phase C)""", }, # column "ctrl3ChPowerFactorC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.14.1.25", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Power Factor (Phase C)""", }, # column "ctrlGrpAmpsTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15", "status" : "current", "description" : """A table of Control Group Amp readings""", }, # table "ctrlGrpAmpsEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1", "status" : "current", "linkage" : [ "ctrlGrpAmpsIndex", ], "description" : """Entry in the Control Group Amps table: each entry contains an index (ctrlGrpAmpsIndex) and other sensor details""", }, # row "ctrlGrpAmpsIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "1" }, ], "range" : { "min" : "1", "max" : "1" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "ctrlGrpAmpsSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "ctrlGrpAmpsName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "ctrlGrpAmpsAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "ctrlGrpAmpsA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """DeciAmps Group A""", }, # column "ctrlGrpAmpsB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.6", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """DeciAmps Group B""", }, # column "ctrlGrpAmpsC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.7", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """DeciAmps Group C""", }, # column "ctrlGrpAmpsD" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.8", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """DeciAmps Group D""", }, # column "ctrlGrpAmpsE" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.9", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """DeciAmps Group E""", }, # column "ctrlGrpAmpsF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.10", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """DeciAmps Group F""", }, # column "ctrlGrpAmpsG" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.11", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """DeciAmps Group G""", }, # column "ctrlGrpAmpsH" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.12", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """DeciAmps Group H""", }, # column "ctrlGrpAmpsAVolts" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.13", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Volts Group A""", }, # column "ctrlGrpAmpsBVolts" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.14", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Volts Group B""", }, # column "ctrlGrpAmpsCVolts" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.15", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Volts Group C""", }, # column "ctrlGrpAmpsDVolts" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.16", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Volts Group D""", }, # column "ctrlGrpAmpsEVolts" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.17", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Volts Group E""", }, # column "ctrlGrpAmpsFVolts" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.18", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Volts Group F""", }, # column "ctrlGrpAmpsGVolts" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.19", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Volts Group G""", }, # column "ctrlGrpAmpsHVolts" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.15.1.20", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Volts Group H""", }, # column "ctrlOutletTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16", "status" : "current", "description" : """A table of outlet information""", }, # table "ctrlOutletEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1", "status" : "current", "linkage" : [ "ctrlOutletIndex", ], "description" : """Entry in the control outlet table: each entry contains an index (ctrlOutletIndex) and other sensor details""", }, # row "ctrlOutletIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Outlet Number""", }, # column "ctrlOutletName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readwrite", "description" : """Outlet Friendly Name""", }, # column "ctrlOutletStatus" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Current Outlet Status: 0 = Off, 1 = On | Outlet Action Write: 1 = On, 2 = On Delayed, 3 = Off Immediate, 4 = Off Delayed, 5 = Reboot""", }, # column "ctrlOutletFeedback" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Outlet Feedback Value, should be equal to status""", }, # column "ctrlOutletPending" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Outlet Status Read to change to: 0 = Off, 1 = On | Outlet Action Write: 1 = On, 2 = On Delayed, 3 = Off Immediate, 4 = Off Delayed, 5 = Reboot""", }, # column "ctrlOutletDeciAmps" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.6", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Outlet DeciAmps reading""", }, # column "ctrlOutletGroup" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.7", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Outlet Group (A to G)""", }, # column "ctrlOutletUpDelay" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.8", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "units" : "seconds", "description" : """Outlet Power Up Delay""", }, # column "ctrlOutletDwnDelay" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.9", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "units" : "seconds", "description" : """Outlet Power Down Delay""", }, # column "ctrlOutletRbtDelay" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.10", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "units" : "seconds", "description" : """Outlet Reboot Delay""", }, # column "ctrlOutletURL" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.11", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readwrite", "description" : """Outlet URL""", }, # column "ctrlOutletPOAAction" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.12", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """POA Action: 1 = Off, 2 = On, 3 = Last, 0 = POA not supported on this unit type""", }, # column "ctrlOutletPOADelay" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.13", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "units" : "seconds", "description" : """POA Delay""", }, # column "ctrlOutletKWattHrs" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.14", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "KWh", "description" : """Current Reading for KWatt-Hours""", }, # column "ctrlOutletPower" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.16.1.15", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Power""", }, # column "dewPointSensorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.17", "status" : "current", "description" : """A table of dew point sensors""", }, # table "dewPointSensorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.17.1", "status" : "current", "linkage" : [ "dewPointSensorIndex", ], "description" : """Entry in the dew point sensor table: each entry contains an index (dewPointSensorIndex) and other sensor details""", }, # row "dewPointSensorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.17.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "dewPointSensorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.17.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "dewPointSensorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.17.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "dewPointSensorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.17.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "dewPointSensorTempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.17.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-50", "max" : "100" }, ], "range" : { "min" : "-50", "max" : "100" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Temperature reading in C""", }, # column "dewPointSensorTempF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.17.1.6", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-58", "max" : "212" }, ], "range" : { "min" : "-58", "max" : "212" }, }, }, "access" : "readonly", "units" : "Degrees Fahrenheit", "description" : """Temperature reading in F""", }, # column "dewPointSensorHumidity" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.17.1.7", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Humidity reading""", }, # column "dewPointSensorDewPointC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.17.1.8", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-50", "max" : "100" }, ], "range" : { "min" : "-50", "max" : "100" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Dew point reading in C""", }, # column "dewPointSensorDewPointF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.17.1.9", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-58", "max" : "212" }, ], "range" : { "min" : "-58", "max" : "212" }, }, }, "access" : "readonly", "units" : "Degrees Fahrenheit", "description" : """Dew point reading in F""", }, # column "digitalSensorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.18", "status" : "current", "description" : """A table of digital sensors""", }, # table "digitalSensorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.18.1", "status" : "current", "linkage" : [ "digitalSensorIndex", ], "description" : """Entry in the digital sensor table: each entry contains an index (digitalSensorIndex) and other sensor details""", }, # row "digitalSensorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.18.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "digitalSensorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.18.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "digitalSensorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.18.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "digitalSensorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.18.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "digitalSensorDigital" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.18.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Digital sensor status""", }, # column "dstsTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19", "status" : "current", "description" : """Digital Static Transfer Switch status""", }, # table "dstsEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1", "status" : "current", "linkage" : [ "dstsIndex", ], "description" : """Entry in the DSTS table: each entry contains an index (dstsIndex) and other details""", }, # row "dstsIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "1" }, ], "range" : { "min" : "1", "max" : "1" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "dstsSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "dstsName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "dstsAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "dstsVoltsA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """RMS Voltage of Side A""", }, # column "dstsDeciAmpsA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.6", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """RMS Current of Side A in deciamps""", }, # column "dstsVoltsB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.7", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """RMS Voltage of Side B""", }, # column "dstsDeciAmpsB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.8", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """RMS Current of Side B in deciamps""", }, # column "dstsSourceAActive" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.9", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """If 99, source A active""", }, # column "dstsSourceBActive" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.10", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """If 99, source B active""", }, # column "dstsPowerStatusA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.11", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Power Quality of source A""", }, # column "dstsPowerStatusB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.12", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Power Quality of Source B""", }, # column "dstsSourceATempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.13", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-20", "max" : "50" }, ], "range" : { "min" : "-20", "max" : "50" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current reading for Source A temp in C""", }, # column "dstsSourceBTempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.19.1.14", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-20", "max" : "50" }, ], "range" : { "min" : "-20", "max" : "50" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current reading for Source B temp in C""", }, # column "cpmSensorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.20", "status" : "current", "description" : """A table of city power sensors""", }, # table "cpmSensorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.20.1", "status" : "current", "linkage" : [ "cpmSensorIndex", ], "description" : """Entry in the city power sensor table: each entry contains an index (cpmSensorIndex) and other sensor details""", }, # row "cpmSensorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.20.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "cpmSensorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.20.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "cpmSensorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.20.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "cpmSensorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.20.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "cpmSensorStatus" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.20.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """City Power sensor status""", }, # column "smokeAlarmTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.21", "status" : "current", "description" : """A table of smoke alarm sensors""", }, # table "smokeAlarmEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.21.1", "status" : "current", "linkage" : [ "smokeAlarmIndex", ], "description" : """Entry in the smoke alarm sensor table: each entry contains an index (smokeAlarmIndex) and other sensor details""", }, # row "smokeAlarmIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.21.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "smokeAlarmSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.21.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "smokeAlarmName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.21.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "smokeAlarmAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.21.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "smokeAlarmStatus" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.21.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Smoke alarm status""", }, # column "neg48VdcSensorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.22", "status" : "current", "description" : """A table of -48Vdc sensors""", }, # table "neg48VdcSensorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.22.1", "status" : "current", "linkage" : [ "neg48VdcSensorIndex", ], "description" : """Entry in the -48Vdc sensor table: each entry contains an index (neg48VdcSensorIndex) and other sensor details""", }, # row "neg48VdcSensorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.22.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "neg48VdcSensorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.22.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "neg48VdcSensorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.22.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "neg48VdcSensorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.22.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "neg48VdcSensorVoltage" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.22.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-100", "max" : "10" }, ], "range" : { "min" : "-100", "max" : "10" }, }, }, "access" : "readonly", "units" : "Volts", "description" : """-48Vdc Sensor value""", }, # column "pos30VdcSensorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.23", "status" : "current", "description" : """A table of 30Vdc sensors""", }, # table "pos30VdcSensorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.23.1", "status" : "current", "linkage" : [ "pos30VdcSensorIndex", ], "description" : """Entry in the 30Vdc sensor table: each entry contains an index (pos30VdcSensorIndex) and other sensor details""", }, # row "pos30VdcSensorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.23.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "pos30VdcSensorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.23.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "pos30VdcSensorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.23.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "pos30VdcSensorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.23.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "pos30VdcSensorVoltage" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.23.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-10", "max" : "100" }, ], "range" : { "min" : "-10", "max" : "100" }, }, }, "access" : "readonly", "units" : "Volts", "description" : """30Vdc Sensor value""", }, # column "analogSensorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.24", "status" : "current", "description" : """A table of analog sensors""", }, # table "analogSensorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.24.1", "status" : "current", "linkage" : [ "analogSensorIndex", ], "description" : """Entry in the analog input table: each entry contains an index (analogSensorIndex) and other sensor details""", }, # row "analogSensorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.24.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "analogSensorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.24.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "analogSensorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.24.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "analogSensorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.24.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "analogSensorAnalog" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.24.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Analog Sensor Value""", }, # column "ctrl3ChIECTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25", "status" : "current", "description" : """A table of a 3 phase outlet control (IEC)""", }, # table "ctrl3ChIECEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1", "status" : "current", "linkage" : [ "ctrl3ChIECIndex", ], "description" : """Entry in the 3 phase outlet control table: each entry contains an index (ctrl3ChIECIndex) and other outlet control monitoring details""", }, # row "ctrl3ChIECIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "ctrl3ChIECSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "ctrl3ChIECName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "ctrl3ChIECAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "ctrl3ChIECKWattHrsA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "KWh", "description" : """Current Reading for KWatt-Hours (Phase A)""", }, # column "ctrl3ChIECVoltsA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.6", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Phase A)""", }, # column "ctrl3ChIECVoltPeakA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.7", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Peak-Volts (Phase A)""", }, # column "ctrl3ChIECDeciAmpsA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.8", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for DeciAmps (Phase A)""", }, # column "ctrl3ChIECDeciAmpsPeakA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.9", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for Peak-DeciAmps (Phase A)""", }, # column "ctrl3ChIECRealPowerA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.10", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Real Power (Phase A)""", }, # column "ctrl3ChIECApparentPowerA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.11", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volt-Amps", "description" : """Current reading for Apparent Power (Phase A)""", }, # column "ctrl3ChIECPowerFactorA" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.12", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Power Factor (Phase A)""", }, # column "ctrl3ChIECKWattHrsB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.13", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "KWh", "description" : """Current Reading for KWatt-Hours (Phase B)""", }, # column "ctrl3ChIECVoltsB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.14", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Phase B)""", }, # column "ctrl3ChIECVoltPeakB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.15", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Peak-Volts (Phase B)""", }, # column "ctrl3ChIECDeciAmpsB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.16", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for DeciAmps (Phase B)""", }, # column "ctrl3ChIECDeciAmpsPeakB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.17", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for Peak-DeciAmps (Phase B)""", }, # column "ctrl3ChIECRealPowerB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.18", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Real Power (Phase B)""", }, # column "ctrl3ChIECApparentPowerB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.19", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volt-Amps", "description" : """Current reading for Apparent Power (Phase B)""", }, # column "ctrl3ChIECPowerFactorB" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.20", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Power Factor (Phase B)""", }, # column "ctrl3ChIECKWattHrsC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.21", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "KWh", "description" : """Current Reading for KWatt-Hours (Phase C)""", }, # column "ctrl3ChIECVoltsC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.22", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Volts (Phase C)""", }, # column "ctrl3ChIECVoltPeakC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.23", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volts (rms)", "description" : """Current reading for Peak-Volts (Phase C)""", }, # column "ctrl3ChIECDeciAmpsC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.24", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for DeciAmps (Phase C)""", }, # column "ctrl3ChIECDeciAmpsPeakC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.25", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "0.1 Amps (rms)", "description" : """Current reading for Peak-DeciAmps (Phase C)""", }, # column "ctrl3ChIECRealPowerC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.26", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Watts", "description" : """Current reading for Real Power (Phase C)""", }, # column "ctrl3ChIECApparentPowerC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.27", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "units" : "Volt-Amps", "description" : """Current reading for Apparent Power (Phase C)""", }, # column "ctrl3ChIECPowerFactorC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.25.1.28", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "units" : "%", "description" : """Current reading for Power Factor (Phase C)""", }, # column "climateRelayTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26", "status" : "current", "description" : """Climate Relay sensors (internal sensors for climate relay units)""", }, # table "climateRelayEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1", "status" : "current", "linkage" : [ "climateRelayIndex", ], "description" : """Entry in the climate table: each entry contains an index (climateRelayIndex) and other details""", }, # row "climateRelayIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "1" }, ], "range" : { "min" : "1", "max" : "1" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "climateRelaySerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "climateRelayName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "climateRelayAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "climateRelayTempC" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-50", "max" : "100" }, ], "range" : { "min" : "-50", "max" : "100" }, }, }, "access" : "readonly", "units" : "Degrees Celsius", "description" : """Current reading for Temperature (C)""", }, # column "climateRelayTempF" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.6", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "-58", "max" : "212" }, ], "range" : { "min" : "-58", "max" : "212" }, }, }, "access" : "readonly", "units" : "Degress Fahrenheit", "description" : """Current reading for Temperature (F)""", }, # column "climateRelayIO1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.7", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 1""", }, # column "climateRelayIO2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.8", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 2""", }, # column "climateRelayIO3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.9", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 3""", }, # column "climateRelayIO4" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.10", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 4""", }, # column "climateRelayIO5" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.11", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 5""", }, # column "climateRelayIO6" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.26.1.12", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 6""", }, # column "ctrlRelayTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.27", "status" : "current", "description" : """A table of relay information""", }, # table "ctrlRelayEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.27.1", "status" : "current", "linkage" : [ "ctrlRelayIndex", ], "description" : """Entry in the control relay table: each entry contains an index (ctrlRelayIndex) and other sensor details""", }, # row "ctrlRelayIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.27.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Relay Number""", }, # column "ctrlRelayName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.27.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readwrite", "description" : """Relay Friendly Name""", }, # column "ctrlRelayState" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.27.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Current Relay Status: 0 = Off, 1 = On""", }, # column "ctrlRelayLatchingMode" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.27.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Relay latching mode: 0 = Non-latching, 1 = Latching""", }, # column "ctrlRelayOverride" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.27.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Relay Override Mode: 0 - None, 1 - On, 2 - Off""", }, # column "ctrlRelayAcknowledge" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.27.1.6", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Acknowledge write a 1, always reads back 0""", }, # column "airSpeedSwitchSensorTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.28", "status" : "current", "description" : """A table of air speed switch sensors""", }, # table "airSpeedSwitchSensorEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.28.1", "status" : "current", "linkage" : [ "airSpeedSwitchSensorIndex", ], "description" : """Entry in the air speed switch sensor table: each entry contains an index (airSpeedSwitchIndex) and other sensor details""", }, # row "airSpeedSwitchSensorIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.28.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "airSpeedSwitchSensorSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.28.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "airSpeedSwitchSensorName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.28.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "airSpeedSwitchSensorAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.28.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "airSpeedSwitchSensorAirSpeed" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.28.1.5", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Air Speed Switch Status""", }, # column "powerDMTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29", "status" : "current", "description" : """A table of DM48 current monitors""", }, # table "powerDMEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1", "status" : "current", "linkage" : [ "powerDMIndex", ], "description" : """Entry in the DM48 current monitor table: each entry contains an index (powerDMIndex) and other sensor details""", }, # row "powerDMIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "100" }, ], "range" : { "min" : "1", "max" : "100" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "powerDMSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "powerDMName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "powerDMAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "powerDMUnitInfoTitle" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Type of Unit""", }, # column "powerDMUnitInfoVersion" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.6", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Unit Version Number""", }, # column "powerDMUnitInfoMainCount" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.7", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "16" }, ], "range" : { "min" : "0", "max" : "16" }, }, }, "access" : "readonly", "description" : """Number of Main (Total Amps) Channels on the Unit""", }, # column "powerDMUnitInfoAuxCount" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.8", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "48" }, ], "range" : { "min" : "0", "max" : "48" }, }, }, "access" : "readonly", "description" : """Number of Auxiliary (Outlet) Channels on the Unit""", }, # column "powerDMChannelName1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.9", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 1 Factory Name""", }, # column "powerDMChannelName2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.10", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 2 Factory Name""", }, # column "powerDMChannelName3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.11", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 3 Factory Name""", }, # column "powerDMChannelName4" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.12", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 4 Factory Name""", }, # column "powerDMChannelName5" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.13", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 5 Factory Name""", }, # column "powerDMChannelName6" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.14", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 6 Factory Name""", }, # column "powerDMChannelName7" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.15", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 7 Factory Name""", }, # column "powerDMChannelName8" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.16", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 8 Factory Name""", }, # column "powerDMChannelName9" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.17", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 9 Factory Name""", }, # column "powerDMChannelName10" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.18", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 10 Factory Name""", }, # column "powerDMChannelName11" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.19", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 11 Factory Name""", }, # column "powerDMChannelName12" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.20", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 12 Factory Name""", }, # column "powerDMChannelName13" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.21", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 13 Factory Name""", }, # column "powerDMChannelName14" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.22", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 14 Factory Name""", }, # column "powerDMChannelName15" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.23", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 15 Factory Name""", }, # column "powerDMChannelName16" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.24", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 16 Factory Name""", }, # column "powerDMChannelName17" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.25", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 17 Factory Name""", }, # column "powerDMChannelName18" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.26", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 18 Factory Name""", }, # column "powerDMChannelName19" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.27", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 19 Factory Name""", }, # column "powerDMChannelName20" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.28", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 20 Factory Name""", }, # column "powerDMChannelName21" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.29", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 21 Factory Name""", }, # column "powerDMChannelName22" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.30", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 22 Factory Name""", }, # column "powerDMChannelName23" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.31", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 23 Factory Name""", }, # column "powerDMChannelName24" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.32", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 24 Factory Name""", }, # column "powerDMChannelName25" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.33", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 25 Factory Name""", }, # column "powerDMChannelName26" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.34", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 26 Factory Name""", }, # column "powerDMChannelName27" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.35", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 27 Factory Name""", }, # column "powerDMChannelName28" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.36", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 28 Factory Name""", }, # column "powerDMChannelName29" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.37", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 29 Factory Name""", }, # column "powerDMChannelName30" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.38", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 30 Factory Name""", }, # column "powerDMChannelName31" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.39", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 31 Factory Name""", }, # column "powerDMChannelName32" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.40", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 32 Factory Name""", }, # column "powerDMChannelName33" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.41", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 33 Factory Name""", }, # column "powerDMChannelName34" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.42", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 34 Factory Name""", }, # column "powerDMChannelName35" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.43", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 35 Factory Name""", }, # column "powerDMChannelName36" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.44", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 36 Factory Name""", }, # column "powerDMChannelName37" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.45", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 37 Factory Name""", }, # column "powerDMChannelName38" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.46", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 38 Factory Name""", }, # column "powerDMChannelName39" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.47", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 39 Factory Name""", }, # column "powerDMChannelName40" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.48", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 40 Factory Name""", }, # column "powerDMChannelName41" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.49", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 41 Factory Name""", }, # column "powerDMChannelName42" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.50", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 42 Factory Name""", }, # column "powerDMChannelName43" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.51", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 43 Factory Name""", }, # column "powerDMChannelName44" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.52", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 44 Factory Name""", }, # column "powerDMChannelName45" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.53", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 45 Factory Name""", }, # column "powerDMChannelName46" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.54", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 46 Factory Name""", }, # column "powerDMChannelName47" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.55", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 47 Factory Name""", }, # column "powerDMChannelName48" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.56", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 48 Factory Name""", }, # column "powerDMChannelFriendly1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.57", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 1 Friendly Name""", }, # column "powerDMChannelFriendly2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.58", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 2 Friendly Name""", }, # column "powerDMChannelFriendly3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.59", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 3 Friendly Name""", }, # column "powerDMChannelFriendly4" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.60", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 4 Friendly Name""", }, # column "powerDMChannelFriendly5" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.61", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 5 Friendly Name""", }, # column "powerDMChannelFriendly6" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.62", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 6 Friendly Name""", }, # column "powerDMChannelFriendly7" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.63", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 7 Friendly Name""", }, # column "powerDMChannelFriendly8" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.64", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 8 Friendly Name""", }, # column "powerDMChannelFriendly9" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.65", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 9 Friendly Name""", }, # column "powerDMChannelFriendly10" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.66", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 10 Friendly Name""", }, # column "powerDMChannelFriendly11" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.67", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 11 Friendly Name""", }, # column "powerDMChannelFriendly12" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.68", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 12 Friendly Name""", }, # column "powerDMChannelFriendly13" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.69", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 13 Friendly Name""", }, # column "powerDMChannelFriendly14" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.70", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 14 Friendly Name""", }, # column "powerDMChannelFriendly15" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.71", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 15 Friendly Name""", }, # column "powerDMChannelFriendly16" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.72", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 16 Friendly Name""", }, # column "powerDMChannelFriendly17" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.73", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 17 Friendly Name""", }, # column "powerDMChannelFriendly18" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.74", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 18 Friendly Name""", }, # column "powerDMChannelFriendly19" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.75", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 19 Friendly Name""", }, # column "powerDMChannelFriendly20" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.76", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 20 Friendly Name""", }, # column "powerDMChannelFriendly21" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.77", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 21 Friendly Name""", }, # column "powerDMChannelFriendly22" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.78", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 22 Friendly Name""", }, # column "powerDMChannelFriendly23" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.79", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 23 Friendly Name""", }, # column "powerDMChannelFriendly24" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.80", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 24 Friendly Name""", }, # column "powerDMChannelFriendly25" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.81", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 25 Friendly Name""", }, # column "powerDMChannelFriendly26" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.82", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 26 Friendly Name""", }, # column "powerDMChannelFriendly27" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.83", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 27 Friendly Name""", }, # column "powerDMChannelFriendly28" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.84", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 28 Friendly Name""", }, # column "powerDMChannelFriendly29" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.85", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 29 Friendly Name""", }, # column "powerDMChannelFriendly30" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.86", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 30 Friendly Name""", }, # column "powerDMChannelFriendly31" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.87", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 31 Friendly Name""", }, # column "powerDMChannelFriendly32" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.88", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 32 Friendly Name""", }, # column "powerDMChannelFriendly33" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.89", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 33 Friendly Name""", }, # column "powerDMChannelFriendly34" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.90", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 34 Friendly Name""", }, # column "powerDMChannelFriendly35" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.91", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 35 Friendly Name""", }, # column "powerDMChannelFriendly36" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.92", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 36 Friendly Name""", }, # column "powerDMChannelFriendly37" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.93", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 37 Friendly Name""", }, # column "powerDMChannelFriendly38" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.94", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 38 Friendly Name""", }, # column "powerDMChannelFriendly39" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.95", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 39 Friendly Name""", }, # column "powerDMChannelFriendly40" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.96", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 40 Friendly Name""", }, # column "powerDMChannelFriendly41" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.97", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 41 Friendly Name""", }, # column "powerDMChannelFriendly42" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.98", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 42 Friendly Name""", }, # column "powerDMChannelFriendly43" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.99", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 43 Friendly Name""", }, # column "powerDMChannelFriendly44" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.100", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 44 Friendly Name""", }, # column "powerDMChannelFriendly45" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.101", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 45 Friendly Name""", }, # column "powerDMChannelFriendly46" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.102", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 46 Friendly Name""", }, # column "powerDMChannelFriendly47" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.103", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 47 Friendly Name""", }, # column "powerDMChannelFriendly48" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.104", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 48 Friendly Name""", }, # column "powerDMChannelGroup1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.105", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 1 Group""", }, # column "powerDMChannelGroup2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.106", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 2 Group""", }, # column "powerDMChannelGroup3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.107", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 3 Group""", }, # column "powerDMChannelGroup4" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.108", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 4 Group""", }, # column "powerDMChannelGroup5" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.109", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 5 Group""", }, # column "powerDMChannelGroup6" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.110", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 6 Group""", }, # column "powerDMChannelGroup7" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.111", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 7 Group""", }, # column "powerDMChannelGroup8" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.112", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 8 Group""", }, # column "powerDMChannelGroup9" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.113", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 9 Group""", }, # column "powerDMChannelGroup10" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.114", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 10 Group""", }, # column "powerDMChannelGroup11" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.115", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 11 Group""", }, # column "powerDMChannelGroup12" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.116", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 12 Group""", }, # column "powerDMChannelGroup13" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.117", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 13 Group""", }, # column "powerDMChannelGroup14" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.118", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 14 Group""", }, # column "powerDMChannelGroup15" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.119", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 15 Group""", }, # column "powerDMChannelGroup16" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.120", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 16 Group""", }, # column "powerDMChannelGroup17" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.121", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 17 Group""", }, # column "powerDMChannelGroup18" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.122", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 18 Group""", }, # column "powerDMChannelGroup19" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.123", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 19 Group""", }, # column "powerDMChannelGroup20" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.124", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 20 Group""", }, # column "powerDMChannelGroup21" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.125", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 21 Group""", }, # column "powerDMChannelGroup22" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.126", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 22 Group""", }, # column "powerDMChannelGroup23" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.127", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 23 Group""", }, # column "powerDMChannelGroup24" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.128", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 24 Group""", }, # column "powerDMChannelGroup25" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.129", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 25 Group""", }, # column "powerDMChannelGroup26" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.130", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 26 Group""", }, # column "powerDMChannelGroup27" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.131", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 27 Group""", }, # column "powerDMChannelGroup28" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.132", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 28 Group""", }, # column "powerDMChannelGroup29" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.133", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 29 Group""", }, # column "powerDMChannelGroup30" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.134", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 30 Group""", }, # column "powerDMChannelGroup31" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.135", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 31 Group""", }, # column "powerDMChannelGroup32" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.136", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 32 Group""", }, # column "powerDMChannelGroup33" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.137", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 33 Group""", }, # column "powerDMChannelGroup34" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.138", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 34 Group""", }, # column "powerDMChannelGroup35" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.139", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 35 Group""", }, # column "powerDMChannelGroup36" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.140", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 36 Group""", }, # column "powerDMChannelGroup37" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.141", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 37 Group""", }, # column "powerDMChannelGroup38" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.142", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 38 Group""", }, # column "powerDMChannelGroup39" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.143", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 39 Group""", }, # column "powerDMChannelGroup40" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.144", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 40 Group""", }, # column "powerDMChannelGroup41" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.145", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 41 Group""", }, # column "powerDMChannelGroup42" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.146", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 42 Group""", }, # column "powerDMChannelGroup43" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.147", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 43 Group""", }, # column "powerDMChannelGroup44" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.148", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 44 Group""", }, # column "powerDMChannelGroup45" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.149", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 45 Group""", }, # column "powerDMChannelGroup46" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.150", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 46 Group""", }, # column "powerDMChannelGroup47" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.151", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 47 Group""", }, # column "powerDMChannelGroup48" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.152", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Channel 48 Group""", }, # column "powerDMDeciAmps1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.153", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.154", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.155", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps4" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.156", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps5" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.157", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps6" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.158", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps7" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.159", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps8" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.160", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps9" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.161", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps10" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.162", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps11" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.163", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps12" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.164", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps13" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.165", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps14" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.166", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps15" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.167", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps16" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.168", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps17" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.169", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps18" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.170", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps19" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.171", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps20" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.172", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps21" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.173", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps22" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.174", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps23" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.175", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps24" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.176", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps25" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.177", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps26" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.178", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps27" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.179", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps28" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.180", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps29" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.181", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps30" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.182", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps31" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.183", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps32" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.184", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps33" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.185", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps34" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.186", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps35" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.187", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps36" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.188", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps37" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.189", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps38" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.190", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps39" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.191", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps40" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.192", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps41" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.193", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps42" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.194", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps43" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.195", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps44" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.196", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps45" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.197", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps46" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.198", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps47" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.199", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "powerDMDeciAmps48" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.29.1.200", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "1209" }, ], "range" : { "min" : "0", "max" : "1209" }, }, }, "access" : "readonly", "units" : "0.1 Amps", "description" : """Current in deciamps""", }, # column "ioExpanderTable" : { "nodetype" : "table", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30", "status" : "current", "description" : """IO Expander device with relay capability""", }, # table "ioExpanderEntry" : { "nodetype" : "row", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1", "status" : "current", "linkage" : [ "ioExpanderIndex", ], "description" : """Entry in the IO Expander table: each entry contains an index (ioExpanderIndex) and other details""", }, # row "ioExpanderIndex" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.1", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "1", "max" : "1" }, ], "range" : { "min" : "1", "max" : "1" }, }, }, "access" : "noaccess", "description" : """Table entry index value""", }, # column "ioExpanderSerial" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.2", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Serial Number""", }, # column "ioExpanderName" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.3", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """Friendly Name""", }, # column "ioExpanderAvail" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.4", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Is device currently plugged in?""", }, # column "ioExpanderFriendlyName1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.5", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 1 Friendly Name""", }, # column "ioExpanderFriendlyName2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.6", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 2 Friendly Name""", }, # column "ioExpanderFriendlyName3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.7", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 3 Friendly Name""", }, # column "ioExpanderFriendlyName4" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.8", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 4 Friendly Name""", }, # column "ioExpanderFriendlyName5" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.9", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 5 Friendly Name""", }, # column "ioExpanderFriendlyName6" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.10", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 6 Friendly Name""", }, # column "ioExpanderFriendlyName7" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.11", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 7 Friendly Name""", }, # column "ioExpanderFriendlyName8" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.12", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 8 Friendly Name""", }, # column "ioExpanderFriendlyName9" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.13", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 9 Friendly Name""", }, # column "ioExpanderFriendlyName10" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.14", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 10 Friendly Name""", }, # column "ioExpanderFriendlyName11" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.15", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 11 Friendly Name""", }, # column "ioExpanderFriendlyName12" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.16", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 12 Friendly Name""", }, # column "ioExpanderFriendlyName13" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.17", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 13 Friendly Name""", }, # column "ioExpanderFriendlyName14" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.18", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 14 Friendly Name""", }, # column "ioExpanderFriendlyName15" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.19", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 15 Friendly Name""", }, # column "ioExpanderFriendlyName16" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.20", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 16 Friendly Name""", }, # column "ioExpanderFriendlyName17" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.21", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 17 Friendly Name""", }, # column "ioExpanderFriendlyName18" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.22", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 18 Friendly Name""", }, # column "ioExpanderFriendlyName19" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.23", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 19 Friendly Name""", }, # column "ioExpanderFriendlyName20" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.24", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 20 Friendly Name""", }, # column "ioExpanderFriendlyName21" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.25", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 21 Friendly Name""", }, # column "ioExpanderFriendlyName22" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.26", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 22 Friendly Name""", }, # column "ioExpanderFriendlyName23" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.27", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 23 Friendly Name""", }, # column "ioExpanderFriendlyName24" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.28", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 24 Friendly Name""", }, # column "ioExpanderFriendlyName25" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.29", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 25 Friendly Name""", }, # column "ioExpanderFriendlyName26" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.30", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 26 Friendly Name""", }, # column "ioExpanderFriendlyName27" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.31", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 27 Friendly Name""", }, # column "ioExpanderFriendlyName28" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.32", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 28 Friendly Name""", }, # column "ioExpanderFriendlyName29" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.33", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 29 Friendly Name""", }, # column "ioExpanderFriendlyName30" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.34", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 30 Friendly Name""", }, # column "ioExpanderFriendlyName31" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.35", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 31 Friendly Name""", }, # column "ioExpanderFriendlyName32" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.36", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readonly", "description" : """IO 32 Friendly Name""", }, # column "ioExpanderIO1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.37", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 1""", }, # column "ioExpanderIO2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.38", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 2""", }, # column "ioExpanderIO3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.39", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 3""", }, # column "ioExpanderIO4" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.40", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 4""", }, # column "ioExpanderIO5" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.41", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 5""", }, # column "ioExpanderIO6" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.42", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 6""", }, # column "ioExpanderIO7" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.43", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 7""", }, # column "ioExpanderIO8" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.44", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 8""", }, # column "ioExpanderIO9" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.45", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 9""", }, # column "ioExpanderIO10" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.46", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 10""", }, # column "ioExpanderIO11" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.47", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 11""", }, # column "ioExpanderIO12" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.48", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 12""", }, # column "ioExpanderIO13" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.49", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 13""", }, # column "ioExpanderIO14" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.50", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 14""", }, # column "ioExpanderIO15" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.51", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 15""", }, # column "ioExpanderIO16" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.52", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 16""", }, # column "ioExpanderIO17" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.53", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 17""", }, # column "ioExpanderIO18" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.54", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 18""", }, # column "ioExpanderIO19" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.55", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 19""", }, # column "ioExpanderIO20" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.56", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 20""", }, # column "ioExpanderIO21" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.57", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 21""", }, # column "ioExpanderIO22" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.58", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 22""", }, # column "ioExpanderIO23" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.59", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 23""", }, # column "ioExpanderIO24" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.60", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 24""", }, # column "ioExpanderIO25" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.61", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 25""", }, # column "ioExpanderIO26" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.62", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 26""", }, # column "ioExpanderIO27" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.63", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 27""", }, # column "ioExpanderIO28" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.64", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 28""", }, # column "ioExpanderIO29" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.65", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 29""", }, # column "ioExpanderIO30" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.66", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 30""", }, # column "ioExpanderIO31" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.67", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 31""", }, # column "ioExpanderIO32" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.68", "status" : "current", "syntax" : { "type" : { "basetype" : "Integer32", "ranges" : [ { "min" : "0", "max" : "100" }, ], "range" : { "min" : "0", "max" : "100" }, }, }, "access" : "readonly", "description" : """Current reading for Analog Input 32""", }, # column "ioExpanderRelayName1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.69", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readwrite", "description" : """Relay1 Friendly Name""", }, # column "ioExpanderRelayState1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.70", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Relay1 Current Status: 0 = Off, 1 = On""", }, # column "ioExpanderRelayLatchingMode1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.71", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Relay1 Latching mode: 0 = Non-latching, 1 = Latching""", }, # column "ioExpanderRelayOverride1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.72", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Relay1 Override Mode: 0 - None, 1 - On, 2 - Off""", }, # column "ioExpanderRelayAcknowledge1" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.73", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Relay1 Acknowledge write a 1, always reads back 0""", }, # column "ioExpanderRelayName2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.74", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readwrite", "description" : """Relay2 Friendly Name""", }, # column "ioExpanderRelayState2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.75", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Relay2 Current Status: 0 = Off, 1 = On""", }, # column "ioExpanderRelayLatchingMode2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.76", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Relay2 Latching mode: 0 = Non-latching, 1 = Latching""", }, # column "ioExpanderRelayOverride2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.77", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Relay2 Override Mode: 0 - None, 1 - On, 2 - Off""", }, # column "ioExpanderRelayAcknowledge2" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.78", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Relay2 Acknowledge write a 1, always reads back 0""", }, # column "ioExpanderRelayName3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.79", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-TC", "name" : "DisplayString"}, }, "access" : "readwrite", "description" : """Relay3 Friendly Name""", }, # column "ioExpanderRelayState3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.80", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readonly", "description" : """Relay3 Current Status: 0 = Off, 1 = On""", }, # column "ioExpanderRelayLatchingMode3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.81", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Relay3 Latching mode: 0 = Non-latching, 1 = Latching""", }, # column "ioExpanderRelayOverride3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.82", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Relay3 Override Mode: 0 - None, 1 - On, 2 - Off""", }, # column "ioExpanderRelayAcknowledge3" : { "nodetype" : "column", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.30.1.83", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv2-SMI", "name" : "Gauge32"}, }, "access" : "readwrite", "description" : """Relay3 Acknowledge write a 1, always reads back 0""", }, # column "cmTrap" : { "nodetype" : "node", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767", }, # node "cmTrapPrefix" : { "nodetype" : "node", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0", }, # node }, # nodes "notifications" : { "cmTestNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10101", "status" : "current", "objects" : { }, "description" : """Test SNMP Trap""", }, # notification "cmClimateTempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10205", "status" : "current", "objects" : { "climateTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Temperature Sensor Trap""", }, # notification "cmClimateTempFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10206", "status" : "current", "objects" : { "climateTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Temperature Sensor Trap""", }, # notification "cmClimateHumidityNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10207", "status" : "current", "objects" : { "climateHumidity" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Humidity Sensor Trap""", }, # notification "cmClimateLightNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10208", "status" : "current", "objects" : { "climateLight" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Light Sensor Trap""", }, # notification "cmClimateAirflowNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10209", "status" : "current", "objects" : { "climateAirflow" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Air Flow Sensor Trap""", }, # notification "cmClimateSoundNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10210", "status" : "current", "objects" : { "climateSound" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Sound Sensor Trap""", }, # notification "cmClimateIO1NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10211", "status" : "current", "objects" : { "climateIO1" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate IO1 Sensor Trap""", }, # notification "cmClimateIO2NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10212", "status" : "current", "objects" : { "climateIO2" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate IO2 Sensor Trap""", }, # notification "cmClimateIO3NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10213", "status" : "current", "objects" : { "climateIO3" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate IO3 Sensor Trap""", }, # notification "cmClimateDewPointCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10214", "status" : "current", "objects" : { "climateDewPointC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Dew Point Sensor Trap""", }, # notification "cmClimateDewPointFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10215", "status" : "current", "objects" : { "climateDewPointF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Dew Point Sensor Trap""", }, # notification "cmPowMonKWattHrsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10305", "status" : "current", "objects" : { "powMonKWattHrs" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours Trap""", }, # notification "cmPowMonVoltsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10306", "status" : "current", "objects" : { "powMonVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Trap""", }, # notification "cmPowMonVoltMaxNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10307", "status" : "current", "objects" : { "powMonVoltMax" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Max Trap""", }, # notification "cmPowMonVoltMinNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10308", "status" : "current", "objects" : { "powMonVoltMin" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Min Trap""", }, # notification "cmPowMonVoltPeakNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10309", "status" : "current", "objects" : { "powMonVoltPeak" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volt Peak Trap""", }, # notification "cmPowMonDeciAmpsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10310", "status" : "current", "objects" : { "powMonDeciAmps" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DeciAmps Trap""", }, # notification "cmPowMonRealPowerNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10311", "status" : "current", "objects" : { "powMonRealPower" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power Trap""", }, # notification "cmPowMonApparentPowerNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10312", "status" : "current", "objects" : { "powMonApparentPower" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power Trap""", }, # notification "cmPowMonPowerFactorNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10313", "status" : "current", "objects" : { "powMonPowerFactor" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor Trap""", }, # notification "cmPowMonOutlet1NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10314", "status" : "current", "objects" : { "powMonOutlet1" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Outlet 1 Clear Trap""", }, # notification "cmPowMonOutlet2NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10315", "status" : "current", "objects" : { "powMonOutlet2" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Outlet 2 Clear Trap""", }, # notification "cmTempSensorTempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10405", "status" : "current", "objects" : { "tempSensorTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "tempSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Temp Sensor - Temperature Trap""", }, # notification "cmTempSensorTempFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10406", "status" : "current", "objects" : { "tempSensorTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "tempSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Temp Sensor - Temperature Trap""", }, # notification "cmAirFlowSensorTempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10505", "status" : "current", "objects" : { "airFlowSensorTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Temperature Trap""", }, # notification "cmAirFlowSensorTempFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10506", "status" : "current", "objects" : { "airFlowSensorTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Temperature Trap""", }, # notification "cmAirFlowSensorFlowNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10507", "status" : "current", "objects" : { "airFlowSensorFlow" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Air Flow Trap""", }, # notification "cmAirFlowSensorHumidityNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10508", "status" : "current", "objects" : { "airFlowSensorHumidity" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Humidity""", }, # notification "cmAirFlowSensorDewPointCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10509", "status" : "current", "objects" : { "airFlowSensorDewPointC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Dew Point Trap""", }, # notification "cmAirFlowSensorDewPointFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10510", "status" : "current", "objects" : { "airFlowSensorDewPointF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Dew Point Trap""", }, # notification "cmPowerVoltsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10605", "status" : "current", "objects" : { "powerVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power-Only Volts Trap""", }, # notification "cmPowerDeciAmpsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10606", "status" : "current", "objects" : { "powerDeciAmps" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power-Only Amps Trap""", }, # notification "cmPowerRealPowerNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10607", "status" : "current", "objects" : { "powerRealPower" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power-Only Watts Trap""", }, # notification "cmPowerApparentPowerNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10608", "status" : "current", "objects" : { "powerApparentPower" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power-Only Volt Amps Trap""", }, # notification "cmPowerPowerFactorNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10609", "status" : "current", "objects" : { "powerPowerFactor" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power-Only Power Factor Trap""", }, # notification "cmDoorSensorStatusNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10705", "status" : "current", "objects" : { "doorSensorStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "doorSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Door sensor Trap""", }, # notification "cmWaterSensorDampnessNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10805", "status" : "current", "objects" : { "waterSensorDampness" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "waterSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Water sensor Trap""", }, # notification "cmCurrentMonitorDeciAmpsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.10905", "status" : "current", "objects" : { "currentMonitorDeciAmps" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "currentMonitorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Current Monitor Amps Trap""", }, # notification "cmMillivoltMonitorMVNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11005", "status" : "current", "objects" : { "millivoltMonitorMV" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "millivoltMonitorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Millivolt Monitor Trap""", }, # notification "cmPow3ChKWattHrsANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11105", "status" : "current", "objects" : { "pow3ChKWattHrsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours A Trap""", }, # notification "cmPow3ChVoltsANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11106", "status" : "current", "objects" : { "pow3ChVoltsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts A Trap""", }, # notification "cmPow3ChVoltMaxANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11107", "status" : "current", "objects" : { "pow3ChVoltMaxA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Max A Trap""", }, # notification "cmPow3ChVoltMinANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11108", "status" : "current", "objects" : { "pow3ChVoltMinA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Min A Trap""", }, # notification "cmPow3ChVoltPeakANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11109", "status" : "current", "objects" : { "pow3ChVoltPeakA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volt Peak A Trap""", }, # notification "cmPow3ChDeciAmpsANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11110", "status" : "current", "objects" : { "pow3ChDeciAmpsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps A Trap""", }, # notification "cmPow3ChRealPowerANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11111", "status" : "current", "objects" : { "pow3ChRealPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power A Trap""", }, # notification "cmPow3ChApparentPowerANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11112", "status" : "current", "objects" : { "pow3ChApparentPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power A Trap""", }, # notification "cmPow3ChPowerFactorANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11113", "status" : "current", "objects" : { "pow3ChPowerFactorA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor A Trap""", }, # notification "cmPow3ChKWattHrsBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11114", "status" : "current", "objects" : { "pow3ChKWattHrsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours B Trap""", }, # notification "cmPow3ChVoltsBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11115", "status" : "current", "objects" : { "pow3ChVoltsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts B Trap""", }, # notification "cmPow3ChVoltMaxBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11116", "status" : "current", "objects" : { "pow3ChVoltMaxB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Max B Trap""", }, # notification "cmPow3ChVoltMinBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11117", "status" : "current", "objects" : { "pow3ChVoltMinB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Min B Trap""", }, # notification "cmPow3ChVoltPeakBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11118", "status" : "current", "objects" : { "pow3ChVoltPeakB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volt Peak B Trap""", }, # notification "cmPow3ChDeciAmpsBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11119", "status" : "current", "objects" : { "pow3ChDeciAmpsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps B Trap""", }, # notification "cmPow3ChRealPowerBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11120", "status" : "current", "objects" : { "pow3ChRealPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power B Trap""", }, # notification "cmPow3ChApparentPowerBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11121", "status" : "current", "objects" : { "pow3ChApparentPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power B Trap""", }, # notification "cmPow3ChPowerFactorBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11122", "status" : "current", "objects" : { "pow3ChPowerFactorB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor B Trap""", }, # notification "cmPow3ChKWattHrsCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11123", "status" : "current", "objects" : { "pow3ChKWattHrsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours C Trap""", }, # notification "cmPow3ChVoltsCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11124", "status" : "current", "objects" : { "pow3ChVoltsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts C Trap""", }, # notification "cmPow3ChVoltMaxCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11125", "status" : "current", "objects" : { "pow3ChVoltMaxC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Max C Trap""", }, # notification "cmPow3ChVoltMinCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11126", "status" : "current", "objects" : { "pow3ChVoltMinC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Min C Trap""", }, # notification "cmPow3ChVoltPeakCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11127", "status" : "current", "objects" : { "pow3ChVoltPeakC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volt Peak C Trap""", }, # notification "cmPow3ChDeciAmpsCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11128", "status" : "current", "objects" : { "pow3ChDeciAmpsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps C Trap""", }, # notification "cmPow3ChRealPowerCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11129", "status" : "current", "objects" : { "pow3ChRealPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power C Trap""", }, # notification "cmPow3ChApparentPowerCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11130", "status" : "current", "objects" : { "pow3ChApparentPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power C Trap""", }, # notification "cmPow3ChPowerFactorCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11131", "status" : "current", "objects" : { "pow3ChPowerFactorC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor C Trap""", }, # notification "cmOutlet1StatusNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11205", "status" : "current", "objects" : { "outlet1Status" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "outletName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Outlet 1 Status Trap""", }, # notification "cmOutlet2StatusNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11206", "status" : "current", "objects" : { "outlet2Status" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "outletName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Outlet 2 Status Trap""", }, # notification "cmVsfcSetPointCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11305", "status" : "current", "objects" : { "vsfcSetPointC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc Temp Set Point Sensor Trap""", }, # notification "cmVsfcSetPointFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11306", "status" : "current", "objects" : { "vsfcSetPointF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc Temp Set Point Sensor Trap""", }, # notification "cmVsfcFanSpeedNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11307", "status" : "current", "objects" : { "vsfcFanSpeed" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc Fan Speed Sensor Trap""", }, # notification "cmVsfcIntTempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11308", "status" : "current", "objects" : { "vsfcIntTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc Internal Temp Sensor Trap""", }, # notification "cmVsfcIntTempFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11309", "status" : "current", "objects" : { "vsfcIntTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc Internal Temp Sensor Trap""", }, # notification "cmVsfcExt1TempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11310", "status" : "current", "objects" : { "vsfcExt1TempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 1 Sensor Trap""", }, # notification "cmVsfcExt1TempFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11311", "status" : "current", "objects" : { "vsfcExt1TempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 1 Sensor Trap""", }, # notification "cmVsfcExt2TempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11312", "status" : "current", "objects" : { "vsfcExt2TempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 2 Sensor Trap""", }, # notification "cmVsfcExt2TempFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11313", "status" : "current", "objects" : { "vsfcExt2TempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 1 Sensor Trap""", }, # notification "cmVsfcExt3TempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11314", "status" : "current", "objects" : { "vsfcExt3TempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 3 Sensor Trap""", }, # notification "cmVsfcExt3TempFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11315", "status" : "current", "objects" : { "vsfcExt3TempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 1 Sensor Trap""", }, # notification "cmVsfcExt4TempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11316", "status" : "current", "objects" : { "vsfcExt4TempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 4 Sensor Trap""", }, # notification "cmVsfcExt4TempFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11317", "status" : "current", "objects" : { "vsfcExt4TempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 1 Sensor Trap""", }, # notification "cmCtrl3ChVoltsANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11405", "status" : "current", "objects" : { "ctrl3ChVoltsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts A Trap""", }, # notification "cmCtrl3ChVoltPeakANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11406", "status" : "current", "objects" : { "ctrl3ChVoltPeakA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak A Trap""", }, # notification "cmCtrl3ChDeciAmpsANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11407", "status" : "current", "objects" : { "ctrl3ChDeciAmpsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps A Trap""", }, # notification "cmCtrl3ChDeciAmpsPeakANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11408", "status" : "current", "objects" : { "ctrl3ChDeciAmpsPeakA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak A Trap""", }, # notification "cmCtrl3ChRealPowerANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11409", "status" : "current", "objects" : { "ctrl3ChRealPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power A Trap""", }, # notification "cmCtrl3ChApparentPowerANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11410", "status" : "current", "objects" : { "ctrl3ChApparentPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power A Trap""", }, # notification "cmCtrl3ChPowerFactorANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11411", "status" : "current", "objects" : { "ctrl3ChPowerFactorA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor A Trap""", }, # notification "cmCtrl3ChVoltsBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11412", "status" : "current", "objects" : { "ctrl3ChVoltsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts B Trap""", }, # notification "cmCtrl3ChVoltPeakBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11413", "status" : "current", "objects" : { "ctrl3ChVoltPeakB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak B Trap""", }, # notification "cmCtrl3ChDeciAmpsBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11414", "status" : "current", "objects" : { "ctrl3ChDeciAmpsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps B Trap""", }, # notification "cmCtrl3ChDeciAmpsPeakBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11415", "status" : "current", "objects" : { "ctrl3ChDeciAmpsPeakB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak B Trap""", }, # notification "cmCtrl3ChRealPowerBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11416", "status" : "current", "objects" : { "ctrl3ChRealPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power B Trap""", }, # notification "cmCtrl3ChApparentPowerBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11417", "status" : "current", "objects" : { "ctrl3ChApparentPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power B Trap""", }, # notification "cmCtrl3ChPowerFactorBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11418", "status" : "current", "objects" : { "ctrl3ChPowerFactorB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor B Trap""", }, # notification "cmCtrl3ChVoltsCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11419", "status" : "current", "objects" : { "ctrl3ChVoltsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts C Trap""", }, # notification "cmCtrl3ChVoltPeakCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11420", "status" : "current", "objects" : { "ctrl3ChVoltPeakC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak C Trap""", }, # notification "cmCtrl3ChDeciAmpsCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11421", "status" : "current", "objects" : { "ctrl3ChDeciAmpsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps C Trap""", }, # notification "cmCtrl3ChDeciAmpsPeakCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11422", "status" : "current", "objects" : { "ctrl3ChDeciAmpsPeakC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak C Trap""", }, # notification "cmCtrl3ChRealPowerCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11423", "status" : "current", "objects" : { "ctrl3ChRealPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power C Trap""", }, # notification "cmCtrl3ChApparentPowerCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11424", "status" : "current", "objects" : { "ctrl3ChApparentPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power C Trap""", }, # notification "cmCtrl3ChPowerFactorCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11425", "status" : "current", "objects" : { "ctrl3ChPowerFactorC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor C Trap""", }, # notification "cmCtrlGrpAmpsANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11505", "status" : "current", "objects" : { "ctrlGrpAmpsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group A DeciAmps Trap""", }, # notification "cmCtrlGrpAmpsBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11506", "status" : "current", "objects" : { "ctrlGrpAmpsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group B DeciAmps Trap""", }, # notification "cmCtrlGrpAmpsCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11507", "status" : "current", "objects" : { "ctrlGrpAmpsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group C DeciAmps Trap""", }, # notification "cmCtrlGrpAmpsDNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11508", "status" : "current", "objects" : { "ctrlGrpAmpsD" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group D DeciAmps Trap""", }, # notification "cmCtrlGrpAmpsENOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11509", "status" : "current", "objects" : { "ctrlGrpAmpsE" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group E DeciAmps Trap""", }, # notification "cmCtrlGrpAmpsFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11510", "status" : "current", "objects" : { "ctrlGrpAmpsF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group F DeciAmps Trap""", }, # notification "cmCtrlGrpAmpsGNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11511", "status" : "current", "objects" : { "ctrlGrpAmpsG" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group G DeciAmps Trap""", }, # notification "cmCtrlGrpAmpsHNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11512", "status" : "current", "objects" : { "ctrlGrpAmpsH" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group H DeciAmps Trap""", }, # notification "cmCtrlGrpAmpsAVoltsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11513", "status" : "current", "objects" : { "ctrlGrpAmpsAVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """AVolts Trip Trap""", }, # notification "cmCtrlGrpAmpsBVoltsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11514", "status" : "current", "objects" : { "ctrlGrpAmpsBVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """BVolts Trip Trap""", }, # notification "cmCtrlGrpAmpsCVoltsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11515", "status" : "current", "objects" : { "ctrlGrpAmpsCVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """CVolts Trip Trap""", }, # notification "cmCtrlGrpAmpsDVoltsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11516", "status" : "current", "objects" : { "ctrlGrpAmpsDVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DVolts Trip Trap""", }, # notification "cmCtrlGrpAmpsEVoltsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11517", "status" : "current", "objects" : { "ctrlGrpAmpsEVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """EVolts Trip Trap""", }, # notification "cmCtrlGrpAmpsFVoltsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11518", "status" : "current", "objects" : { "ctrlGrpAmpsFVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """FVolts Trip Trap""", }, # notification "cmCtrlGrpAmpsGVoltsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11519", "status" : "current", "objects" : { "ctrlGrpAmpsGVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """GVolts Trip Trap""", }, # notification "cmCtrlGrpAmpsHVoltsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11520", "status" : "current", "objects" : { "ctrlGrpAmpsHVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """HVolts Trip Trap""", }, # notification "cmCtrlOutletPendingNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11605", "status" : "current", "objects" : { "ctrlOutletPending" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Pending Trip Trap""", }, # notification "cmCtrlOutletDeciAmpsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11606", "status" : "current", "objects" : { "ctrlOutletDeciAmps" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Outlet DeciAmps Trap""", }, # notification "cmCtrlOutletGroupNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11607", "status" : "current", "objects" : { "ctrlOutletGroup" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group Trip Trap""", }, # notification "cmCtrlOutletUpDelayNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11608", "status" : "current", "objects" : { "ctrlOutletUpDelay" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """UpDelay Trip Trap""", }, # notification "cmCtrlOutletDwnDelayNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11609", "status" : "current", "objects" : { "ctrlOutletDwnDelay" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DwnDelay Trip Trap""", }, # notification "cmCtrlOutletRbtDelayNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11610", "status" : "current", "objects" : { "ctrlOutletRbtDelay" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """RbtDelay Trip Trap""", }, # notification "cmCtrlOutletURLNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11611", "status" : "current", "objects" : { "ctrlOutletURL" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """URL Trip Trap""", }, # notification "cmCtrlOutletPOAActionNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11612", "status" : "current", "objects" : { "ctrlOutletPOAAction" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """POAAction Trip Trap""", }, # notification "cmCtrlOutletPOADelayNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11613", "status" : "current", "objects" : { "ctrlOutletPOADelay" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """POADelay Trip Trap""", }, # notification "cmCtrlOutletKWattHrsNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11614", "status" : "current", "objects" : { "ctrlOutletKWattHrs" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """KWattHrs Trip Trap""", }, # notification "cmCtrlOutletPowerNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11615", "status" : "current", "objects" : { "ctrlOutletPower" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Trip Trap""", }, # notification "cmDewPointSensorTempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11705", "status" : "current", "objects" : { "dewPointSensorTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dewPointSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Dew Point Sensor - Temperature Trap""", }, # notification "cmDewPointSensorTempFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11706", "status" : "current", "objects" : { "dewPointSensorTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dewPointSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Dew Point Sensor - Temperature Trap""", }, # notification "cmDewPointSensorHumidityNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11707", "status" : "current", "objects" : { "dewPointSensorHumidity" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dewPointSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Dew Point Sensor - Humidity""", }, # notification "cmDewPointSensorDewPointCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11708", "status" : "current", "objects" : { "dewPointSensorDewPointC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dewPointSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Dew Point Sensor - Dew Point Trap""", }, # notification "cmDewPointSensorDewPointFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11709", "status" : "current", "objects" : { "dewPointSensorDewPointF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dewPointSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Dew Point Sensor - Dew Point Trap""", }, # notification "cmDigitalSensorDigitalNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11805", "status" : "current", "objects" : { "digitalSensorDigital" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "digitalSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Digital sensor Trap""", }, # notification "cmDstsVoltsANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11905", "status" : "current", "objects" : { "dstsVoltsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """RMS Voltage of Side A Set Point Sensor Trap""", }, # notification "cmDstsDeciAmpsANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11906", "status" : "current", "objects" : { "dstsDeciAmpsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """RMS Current of Side A Set Point Sensor Trap""", }, # notification "cmDstsVoltsBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11907", "status" : "current", "objects" : { "dstsVoltsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """RMS Voltage of Side B Set Point Sensor Trap""", }, # notification "cmDstsDeciAmpsBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11908", "status" : "current", "objects" : { "dstsDeciAmpsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """RMS Current of Side B Set Point Sensor Trap""", }, # notification "cmDstsSourceAActiveNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11909", "status" : "current", "objects" : { "dstsSourceAActive" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source A Active Set Point Sensor Trap""", }, # notification "cmDstsSourceBActiveNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11910", "status" : "current", "objects" : { "dstsSourceBActive" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source B Active Set Point Sensor Trap""", }, # notification "cmDstsPowerStatusANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11911", "status" : "current", "objects" : { "dstsPowerStatusA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source A Power Qualilty Active Set Point Sensor Trap""", }, # notification "cmDstsPowerStatusBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11912", "status" : "current", "objects" : { "dstsPowerStatusB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source B Power Qualilty Active Set Point Sensor Trap""", }, # notification "cmDstsSourceATempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11913", "status" : "current", "objects" : { "dstsSourceATempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source A Temp Sensor Trap""", }, # notification "cmDstsSourceBTempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.11914", "status" : "current", "objects" : { "dstsSourceBTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source B Temp Sensor Trap""", }, # notification "cmCpmSensorStatusNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12005", "status" : "current", "objects" : { "cpmSensorStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "cpmSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """City Power sensor Trap""", }, # notification "cmSmokeAlarmStatusNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12105", "status" : "current", "objects" : { "smokeAlarmStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "smokeAlarmName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Smoke alarm Trap""", }, # notification "cmNeg48VdcSensorVoltageNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12205", "status" : "current", "objects" : { "neg48VdcSensorVoltage" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "neg48VdcSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """-48Vdc Sensor Trap""", }, # notification "cmPos30VdcSensorVoltageNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12305", "status" : "current", "objects" : { "pos30VdcSensorVoltage" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pos30VdcSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """30Vdc Sensor Trap""", }, # notification "cmAnalogSensorAnalogNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12405", "status" : "current", "objects" : { "analogSensorAnalog" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "analogSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Analog Sensor Trap""", }, # notification "cmCtrl3ChIECKWattHrsANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12505", "status" : "current", "objects" : { "ctrl3ChIECKWattHrsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours A Trap""", }, # notification "cmCtrl3ChIECVoltsANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12506", "status" : "current", "objects" : { "ctrl3ChIECVoltsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts A Trap""", }, # notification "cmCtrl3ChIECVoltPeakANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12507", "status" : "current", "objects" : { "ctrl3ChIECVoltPeakA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak A Trap""", }, # notification "cmCtrl3ChIECDeciAmpsANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12508", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps A Trap""", }, # notification "cmCtrl3ChIECDeciAmpsPeakANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12509", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsPeakA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak A Trap""", }, # notification "cmCtrl3ChIECRealPowerANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12510", "status" : "current", "objects" : { "ctrl3ChIECRealPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power A Trap""", }, # notification "cmCtrl3ChIECApparentPowerANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12511", "status" : "current", "objects" : { "ctrl3ChIECApparentPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power A Trap""", }, # notification "cmCtrl3ChIECPowerFactorANOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12512", "status" : "current", "objects" : { "ctrl3ChIECPowerFactorA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor A Trap""", }, # notification "cmCtrl3ChIECKWattHrsBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12513", "status" : "current", "objects" : { "ctrl3ChIECKWattHrsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours B Trap""", }, # notification "cmCtrl3ChIECVoltsBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12514", "status" : "current", "objects" : { "ctrl3ChIECVoltsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts B Trap""", }, # notification "cmCtrl3ChIECVoltPeakBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12515", "status" : "current", "objects" : { "ctrl3ChIECVoltPeakB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak B Trap""", }, # notification "cmCtrl3ChIECDeciAmpsBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12516", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps B Trap""", }, # notification "cmCtrl3ChIECDeciAmpsPeakBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12517", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsPeakB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak B Trap""", }, # notification "cmCtrl3ChIECRealPowerBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12518", "status" : "current", "objects" : { "ctrl3ChIECRealPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power B Trap""", }, # notification "cmCtrl3ChIECApparentPowerBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12519", "status" : "current", "objects" : { "ctrl3ChIECApparentPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power B Trap""", }, # notification "cmCtrl3ChIECPowerFactorBNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12520", "status" : "current", "objects" : { "ctrl3ChIECPowerFactorB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor B Trap""", }, # notification "cmCtrl3ChIECKWattHrsCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12521", "status" : "current", "objects" : { "ctrl3ChIECKWattHrsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours C Trap""", }, # notification "cmCtrl3ChIECVoltsCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12522", "status" : "current", "objects" : { "ctrl3ChIECVoltsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts C Trap""", }, # notification "cmCtrl3ChIECVoltPeakCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12523", "status" : "current", "objects" : { "ctrl3ChIECVoltPeakC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak C Trap""", }, # notification "cmCtrl3ChIECDeciAmpsCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12524", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps C Trap""", }, # notification "cmCtrl3ChIECDeciAmpsPeakCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12525", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsPeakC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak C Trap""", }, # notification "cmCtrl3ChIECRealPowerCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12526", "status" : "current", "objects" : { "ctrl3ChIECRealPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power C Trap""", }, # notification "cmCtrl3ChIECApparentPowerCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12527", "status" : "current", "objects" : { "ctrl3ChIECApparentPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power C Trap""", }, # notification "cmCtrl3ChIECPowerFactorCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12528", "status" : "current", "objects" : { "ctrl3ChIECPowerFactorC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor C Trap""", }, # notification "cmClimateRelayTempCNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12605", "status" : "current", "objects" : { "climateRelayTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay Temperature Sensor Trap""", }, # notification "cmClimateRelayTempFNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12606", "status" : "current", "objects" : { "climateRelayTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay Temperature Sensor Trap""", }, # notification "cmClimateRelayIO1NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12607", "status" : "current", "objects" : { "climateRelayIO1" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO1 Sensor Trap""", }, # notification "cmClimateRelayIO2NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12608", "status" : "current", "objects" : { "climateRelayIO2" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO2 Sensor Trap""", }, # notification "cmClimateRelayIO3NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12609", "status" : "current", "objects" : { "climateRelayIO3" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO3 Sensor Trap""", }, # notification "cmClimateRelayIO4NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12610", "status" : "current", "objects" : { "climateRelayIO4" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO4 Sensor Trap""", }, # notification "cmClimateRelayIO5NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12611", "status" : "current", "objects" : { "climateRelayIO5" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO5 Sensor Trap""", }, # notification "cmClimateRelayIO6NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12612", "status" : "current", "objects" : { "climateRelayIO6" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO6 Sensor Trap""", }, # notification "cmAirSpeedSwitchSensorAirSpeedNOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.12805", "status" : "current", "objects" : { "airSpeedSwitchSensorAirSpeed" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airSpeedSwitchSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Air Speed Switch Trap""", }, # notification "cmIoExpanderIO1NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13037", "status" : "current", "objects" : { "ioExpanderIO1" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO1 Sensor Trap""", }, # notification "cmIoExpanderIO2NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13038", "status" : "current", "objects" : { "ioExpanderIO2" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO2 Sensor Trap""", }, # notification "cmIoExpanderIO3NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13039", "status" : "current", "objects" : { "ioExpanderIO3" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO3 Sensor Trap""", }, # notification "cmIoExpanderIO4NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13040", "status" : "current", "objects" : { "ioExpanderIO4" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO4 Sensor Trap""", }, # notification "cmIoExpanderIO5NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13041", "status" : "current", "objects" : { "ioExpanderIO5" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO5 Sensor Trap""", }, # notification "cmIoExpanderIO6NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13042", "status" : "current", "objects" : { "ioExpanderIO6" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO6 Sensor Trap""", }, # notification "cmIoExpanderIO7NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13043", "status" : "current", "objects" : { "ioExpanderIO7" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO7 Sensor Trap""", }, # notification "cmIoExpanderIO8NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13044", "status" : "current", "objects" : { "ioExpanderIO8" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO8 Sensor Trap""", }, # notification "cmIoExpanderIO9NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13045", "status" : "current", "objects" : { "ioExpanderIO9" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO9 Sensor Trap""", }, # notification "cmIoExpanderIO10NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13046", "status" : "current", "objects" : { "ioExpanderIO10" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO10 Sensor Trap""", }, # notification "cmIoExpanderIO11NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13047", "status" : "current", "objects" : { "ioExpanderIO11" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO11 Sensor Trap""", }, # notification "cmIoExpanderIO12NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13048", "status" : "current", "objects" : { "ioExpanderIO12" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO12 Sensor Trap""", }, # notification "cmIoExpanderIO13NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13049", "status" : "current", "objects" : { "ioExpanderIO13" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO13 Sensor Trap""", }, # notification "cmIoExpanderIO14NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13050", "status" : "current", "objects" : { "ioExpanderIO14" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO14 Sensor Trap""", }, # notification "cmIoExpanderIO15NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13051", "status" : "current", "objects" : { "ioExpanderIO15" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO15 Sensor Trap""", }, # notification "cmIoExpanderIO16NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13052", "status" : "current", "objects" : { "ioExpanderIO16" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO16 Sensor Trap""", }, # notification "cmIoExpanderIO17NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13053", "status" : "current", "objects" : { "ioExpanderIO17" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO17 Sensor Trap""", }, # notification "cmIoExpanderIO18NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13054", "status" : "current", "objects" : { "ioExpanderIO18" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO18 Sensor Trap""", }, # notification "cmIoExpanderIO19NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13055", "status" : "current", "objects" : { "ioExpanderIO19" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO19 Sensor Trap""", }, # notification "cmIoExpanderIO20NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13056", "status" : "current", "objects" : { "ioExpanderIO20" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO20 Sensor Trap""", }, # notification "cmIoExpanderIO21NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13057", "status" : "current", "objects" : { "ioExpanderIO21" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO21 Sensor Trap""", }, # notification "cmIoExpanderIO22NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13058", "status" : "current", "objects" : { "ioExpanderIO22" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO22 Sensor Trap""", }, # notification "cmIoExpanderIO23NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13059", "status" : "current", "objects" : { "ioExpanderIO23" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO23 Sensor Trap""", }, # notification "cmIoExpanderIO24NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13060", "status" : "current", "objects" : { "ioExpanderIO24" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO24 Sensor Trap""", }, # notification "cmIoExpanderIO25NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13061", "status" : "current", "objects" : { "ioExpanderIO25" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO25 Sensor Trap""", }, # notification "cmIoExpanderIO26NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13062", "status" : "current", "objects" : { "ioExpanderIO26" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO26 Sensor Trap""", }, # notification "cmIoExpanderIO27NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13063", "status" : "current", "objects" : { "ioExpanderIO27" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO27 Sensor Trap""", }, # notification "cmIoExpanderIO28NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13064", "status" : "current", "objects" : { "ioExpanderIO28" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO28 Sensor Trap""", }, # notification "cmIoExpanderIO29NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13065", "status" : "current", "objects" : { "ioExpanderIO29" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO29 Sensor Trap""", }, # notification "cmIoExpanderIO30NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13066", "status" : "current", "objects" : { "ioExpanderIO30" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO30 Sensor Trap""", }, # notification "cmIoExpanderIO31NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13067", "status" : "current", "objects" : { "ioExpanderIO31" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO31 Sensor Trap""", }, # notification "cmIoExpanderIO32NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.13068", "status" : "current", "objects" : { "ioExpanderIO32" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO32 Sensor Trap""", }, # notification "cmClimateTempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20205", "status" : "current", "objects" : { "climateTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Temperature Sensor Clear Trap""", }, # notification "cmClimateTempFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20206", "status" : "current", "objects" : { "climateTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Temperature Sensor Clear Trap""", }, # notification "cmClimateHumidityCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20207", "status" : "current", "objects" : { "climateHumidity" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Humidity Sensor Clear Trap""", }, # notification "cmClimateLightCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20208", "status" : "current", "objects" : { "climateLight" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Light Sensor Clear Trap""", }, # notification "cmClimateAirflowCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20209", "status" : "current", "objects" : { "climateAirflow" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Air Flow Sensor Clear Trap""", }, # notification "cmClimateSoundCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20210", "status" : "current", "objects" : { "climateSound" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Sound Sensor Clear Trap""", }, # notification "cmClimateIO1CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20211", "status" : "current", "objects" : { "climateIO1" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate IO1 Sensor Clear Trap""", }, # notification "cmClimateIO2CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20212", "status" : "current", "objects" : { "climateIO2" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate IO2 Sensor Clear Trap""", }, # notification "cmClimateIO3CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20213", "status" : "current", "objects" : { "climateIO3" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate IO3 Sensor Clear Trap""", }, # notification "cmClimateDewPointCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20214", "status" : "current", "objects" : { "climateDewPointC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Dew Point Sensor Clear Trap""", }, # notification "cmClimateDewPointFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20215", "status" : "current", "objects" : { "climateDewPointF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Dew Point Sensor Clear Trap""", }, # notification "cmPowMonKWattHrsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20305", "status" : "current", "objects" : { "powMonKWattHrs" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours Clear Trap""", }, # notification "cmPowMonVoltsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20306", "status" : "current", "objects" : { "powMonVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Clear Trap""", }, # notification "cmPowMonVoltMaxCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20307", "status" : "current", "objects" : { "powMonVoltMax" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Max Clear Trap""", }, # notification "cmPowMonVoltMinCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20308", "status" : "current", "objects" : { "powMonVoltMin" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Min Clear Trap""", }, # notification "cmPowMonVoltPeakCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20309", "status" : "current", "objects" : { "powMonVoltPeak" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volt Peak Clear Trap""", }, # notification "cmPowMonDeciAmpsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20310", "status" : "current", "objects" : { "powMonDeciAmps" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DeciAmps Clear Trap""", }, # notification "cmPowMonRealPowerCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20311", "status" : "current", "objects" : { "powMonRealPower" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power Clear Trap""", }, # notification "cmPowMonApparentPowerCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20312", "status" : "current", "objects" : { "powMonApparentPower" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power Clear Trap""", }, # notification "cmPowMonPowerFactorCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20313", "status" : "current", "objects" : { "powMonPowerFactor" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor Clear Trap""", }, # notification "cmPowMonOutlet1CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20314", "status" : "current", "objects" : { "powMonOutlet1" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Outlet1 Clear Trap""", }, # notification "cmPowMonOutlet2CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20315", "status" : "current", "objects" : { "powMonOutlet2" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powMonName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Outlet2 Clear Trap""", }, # notification "cmTempSensorTempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20405", "status" : "current", "objects" : { "tempSensorTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "tempSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Temp Sensor - Temperature Clear Trap""", }, # notification "cmTempSensorTempFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20406", "status" : "current", "objects" : { "tempSensorTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "tempSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Temp Sensor - Temperature Clear Trap""", }, # notification "cmAirFlowSensorTempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20505", "status" : "current", "objects" : { "airFlowSensorTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Temperature Clear Trap""", }, # notification "cmAirFlowSensorTempFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20506", "status" : "current", "objects" : { "airFlowSensorTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Temperature Clear Trap""", }, # notification "cmAirFlowSensorFlowCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20507", "status" : "current", "objects" : { "airFlowSensorFlow" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Air Flow Clear Trap""", }, # notification "cmAirFlowSensorHumidityCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20508", "status" : "current", "objects" : { "airFlowSensorHumidity" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Humidity Clear Trap""", }, # notification "cmAirFlowSensorDewPointCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20509", "status" : "current", "objects" : { "airFlowSensorDewPointC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Dew Point Clear Trap""", }, # notification "cmAirFlowSensorDewPointFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20510", "status" : "current", "objects" : { "airFlowSensorDewPointF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airFlowSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Air Flow Sensor - Dew Point Clear Trap""", }, # notification "cmPowerVoltsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20605", "status" : "current", "objects" : { "powerVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power-Only Volts Clear Trap""", }, # notification "cmPowerDeciAmpsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20606", "status" : "current", "objects" : { "powerDeciAmps" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power-Only Amps Clear Trap""", }, # notification "cmPowerRealPowerCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20607", "status" : "current", "objects" : { "powerRealPower" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power-Only Watts Clear Trap""", }, # notification "cmPowerApparentPowerCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20608", "status" : "current", "objects" : { "powerApparentPower" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power-Only Volt Amps Clear Trap""", }, # notification "cmPowerPowerFactorCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20609", "status" : "current", "objects" : { "powerPowerFactor" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power-Only Power Factor Clear Trap""", }, # notification "cmDoorSensorStatusCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20705", "status" : "current", "objects" : { "doorSensorStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "doorSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Door sensor Clear Trap""", }, # notification "cmWaterSensorDampnessCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20805", "status" : "current", "objects" : { "waterSensorDampness" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "waterSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Water sensor Clear Trap""", }, # notification "cmCurrentMonitorDeciAmpsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.20905", "status" : "current", "objects" : { "currentMonitorDeciAmps" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "currentMonitorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Current Monitor Amps Clear Trap""", }, # notification "cmMillivoltMonitorMVCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21005", "status" : "current", "objects" : { "millivoltMonitorMV" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "millivoltMonitorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Millivolt Monitor Clear Trap""", }, # notification "cmPow3ChKWattHrsACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21105", "status" : "current", "objects" : { "pow3ChKWattHrsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours A Clear Trap""", }, # notification "cmPow3ChVoltsACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21106", "status" : "current", "objects" : { "pow3ChVoltsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts A Clear Trap""", }, # notification "cmPow3ChVoltMaxACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21107", "status" : "current", "objects" : { "pow3ChVoltMaxA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Max A Clear Trap""", }, # notification "cmPow3ChVoltMinACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21108", "status" : "current", "objects" : { "pow3ChVoltMinA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Min A Clear Trap""", }, # notification "cmPow3ChVoltPeakACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21109", "status" : "current", "objects" : { "pow3ChVoltPeakA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volt Peak A Clear Trap""", }, # notification "cmPow3ChDeciAmpsACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21110", "status" : "current", "objects" : { "pow3ChDeciAmpsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps A Clear Trap""", }, # notification "cmPow3ChRealPowerACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21111", "status" : "current", "objects" : { "pow3ChRealPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power A Clear Trap""", }, # notification "cmPow3ChApparentPowerACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21112", "status" : "current", "objects" : { "pow3ChApparentPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power A Clear Trap""", }, # notification "cmPow3ChPowerFactorACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21113", "status" : "current", "objects" : { "pow3ChPowerFactorA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor A Clear Trap""", }, # notification "cmPow3ChKWattHrsBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21114", "status" : "current", "objects" : { "pow3ChKWattHrsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours B Clear Trap""", }, # notification "cmPow3ChVoltsBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21115", "status" : "current", "objects" : { "pow3ChVoltsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts B Clear Trap""", }, # notification "cmPow3ChVoltMaxBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21116", "status" : "current", "objects" : { "pow3ChVoltMaxB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Max B Clear Trap""", }, # notification "cmPow3ChVoltMinBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21117", "status" : "current", "objects" : { "pow3ChVoltMinB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Min B Clear Trap""", }, # notification "cmPow3ChVoltPeakBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21118", "status" : "current", "objects" : { "pow3ChVoltPeakB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volt Peak B Clear Trap""", }, # notification "cmPow3ChDeciAmpsBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21119", "status" : "current", "objects" : { "pow3ChDeciAmpsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps B Clear Trap""", }, # notification "cmPow3ChRealPowerBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21120", "status" : "current", "objects" : { "pow3ChRealPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power B Clear Trap""", }, # notification "cmPow3ChApparentPowerBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21121", "status" : "current", "objects" : { "pow3ChApparentPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power B Clear Trap""", }, # notification "cmPow3ChPowerFactorBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21122", "status" : "current", "objects" : { "pow3ChPowerFactorB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor B Clear Trap""", }, # notification "cmPow3ChKWattHrsCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21123", "status" : "current", "objects" : { "pow3ChKWattHrsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours C Clear Trap""", }, # notification "cmPow3ChVoltsCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21124", "status" : "current", "objects" : { "pow3ChVoltsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts C Clear Trap""", }, # notification "cmPow3ChVoltMaxCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21125", "status" : "current", "objects" : { "pow3ChVoltMaxC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Max C Clear Trap""", }, # notification "cmPow3ChVoltMinCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21126", "status" : "current", "objects" : { "pow3ChVoltMinC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Min C Clear Trap""", }, # notification "cmPow3ChVoltPeakCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21127", "status" : "current", "objects" : { "pow3ChVoltPeakC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volt Peak C Clear Trap""", }, # notification "cmPow3ChDeciAmpsCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21128", "status" : "current", "objects" : { "pow3ChDeciAmpsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps C Clear Trap""", }, # notification "cmPow3ChRealPowerCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21129", "status" : "current", "objects" : { "pow3ChRealPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power C Clear Trap""", }, # notification "cmPow3ChApparentPowerCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21130", "status" : "current", "objects" : { "pow3ChApparentPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power C Clear Trap""", }, # notification "cmPow3ChPowerFactorCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21131", "status" : "current", "objects" : { "pow3ChPowerFactorC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pow3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor C Clear Trap""", }, # notification "cmOutlet1StatusCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21205", "status" : "current", "objects" : { "outlet1Status" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "outletName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Outlet 1 Status Clear Trap""", }, # notification "cmOutlet2StatusCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21206", "status" : "current", "objects" : { "outlet2Status" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "outletName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Outlet 2 Status Clear Trap""", }, # notification "cmVsfcSetPointCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21305", "status" : "current", "objects" : { "vsfcSetPointC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc Temp Set Point Sensor Clear""", }, # notification "cmVsfcSetPointFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21306", "status" : "current", "objects" : { "vsfcSetPointF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc Temp Set Point Sensor Clear""", }, # notification "cmVsfcFanSpeedCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21307", "status" : "current", "objects" : { "vsfcFanSpeed" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc Fan Speed Sensor Clear""", }, # notification "cmVsfcIntTempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21308", "status" : "current", "objects" : { "vsfcIntTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc Internal Temp Sensor Clear""", }, # notification "cmVsfcIntTempFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21309", "status" : "current", "objects" : { "vsfcIntTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc Internal Temp Sensor Clear""", }, # notification "cmVsfcExt1TempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21310", "status" : "current", "objects" : { "vsfcExt1TempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 1 Sensor Clear""", }, # notification "cmVsfcExt1TempFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21311", "status" : "current", "objects" : { "vsfcExt1TempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 1 Sensor Clear""", }, # notification "cmVsfcExt2TempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21312", "status" : "current", "objects" : { "vsfcExt2TempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 2 Sensor Clear""", }, # notification "cmVsfcExt2TempFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21313", "status" : "current", "objects" : { "vsfcExt2TempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 1 Sensor Clear""", }, # notification "cmVsfcExt3TempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21314", "status" : "current", "objects" : { "vsfcExt3TempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 3 Sensor Clear""", }, # notification "cmVsfcExt3TempFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21315", "status" : "current", "objects" : { "vsfcExt3TempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 1 Sensor Clear""", }, # notification "cmVsfcExt4TempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21316", "status" : "current", "objects" : { "vsfcExt4TempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 4 Sensor Clear""", }, # notification "cmVsfcExt4TempFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21317", "status" : "current", "objects" : { "vsfcExt4TempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "vsfcName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Vsfc External Temp 1 Sensor Clear""", }, # notification "cmCtrl3ChVoltsACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21405", "status" : "current", "objects" : { "ctrl3ChVoltsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts A Clear Trap""", }, # notification "cmCtrl3ChVoltPeakACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21406", "status" : "current", "objects" : { "ctrl3ChVoltPeakA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak A Clear Trap""", }, # notification "cmCtrl3ChDeciAmpsACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21407", "status" : "current", "objects" : { "ctrl3ChDeciAmpsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps A Clear Trap""", }, # notification "cmCtrl3ChDeciAmpsPeakACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21408", "status" : "current", "objects" : { "ctrl3ChDeciAmpsPeakA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak A Clear Trap""", }, # notification "cmCtrl3ChRealPowerACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21409", "status" : "current", "objects" : { "ctrl3ChRealPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power A Clear Trap""", }, # notification "cmCtrl3ChApparentPowerACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21410", "status" : "current", "objects" : { "ctrl3ChApparentPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power A Clear Trap""", }, # notification "cmCtrl3ChPowerFactorACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21411", "status" : "current", "objects" : { "ctrl3ChPowerFactorA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor A Clear Trap""", }, # notification "cmCtrl3ChVoltsBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21412", "status" : "current", "objects" : { "ctrl3ChVoltsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts B Clear Trap""", }, # notification "cmCtrl3ChVoltPeakBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21413", "status" : "current", "objects" : { "ctrl3ChVoltPeakB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak B Clear Trap""", }, # notification "cmCtrl3ChDeciAmpsBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21414", "status" : "current", "objects" : { "ctrl3ChDeciAmpsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps B Clear Trap""", }, # notification "cmCtrl3ChDeciAmpsPeakBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21415", "status" : "current", "objects" : { "ctrl3ChDeciAmpsPeakB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak B Clear Trap""", }, # notification "cmCtrl3ChRealPowerBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21416", "status" : "current", "objects" : { "ctrl3ChRealPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power B Clear Trap""", }, # notification "cmCtrl3ChApparentPowerBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21417", "status" : "current", "objects" : { "ctrl3ChApparentPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power B Clear Trap""", }, # notification "cmCtrl3ChPowerFactorBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21418", "status" : "current", "objects" : { "ctrl3ChPowerFactorB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor B Clear Trap""", }, # notification "cmCtrl3ChVoltsCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21419", "status" : "current", "objects" : { "ctrl3ChVoltsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts C Clear Trap""", }, # notification "cmCtrl3ChVoltPeakCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21420", "status" : "current", "objects" : { "ctrl3ChVoltPeakC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak C Clear Trap""", }, # notification "cmCtrl3ChDeciAmpsCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21421", "status" : "current", "objects" : { "ctrl3ChDeciAmpsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps C Clear Trap""", }, # notification "cmCtrl3ChDeciAmpsPeakCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21422", "status" : "current", "objects" : { "ctrl3ChDeciAmpsPeakC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak C Clear Trap""", }, # notification "cmCtrl3ChRealPowerCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21423", "status" : "current", "objects" : { "ctrl3ChRealPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power C Clear Trap""", }, # notification "cmCtrl3ChApparentPowerCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21424", "status" : "current", "objects" : { "ctrl3ChApparentPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power C Clear Trap""", }, # notification "cmCtrl3ChPowerFactorCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21425", "status" : "current", "objects" : { "ctrl3ChPowerFactorC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor C Clear Trap""", }, # notification "cmCtrlGrpAmpsACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21505", "status" : "current", "objects" : { "ctrlGrpAmpsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group A DeciAmps Clear Trap""", }, # notification "cmCtrlGrpAmpsBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21506", "status" : "current", "objects" : { "ctrlGrpAmpsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group B DeciAmps Clear Trap""", }, # notification "cmCtrlGrpAmpsCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21507", "status" : "current", "objects" : { "ctrlGrpAmpsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group C DeciAmps Clear Trap""", }, # notification "cmCtrlGrpAmpsDCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21508", "status" : "current", "objects" : { "ctrlGrpAmpsD" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group D DeciAmps Clear Trap""", }, # notification "cmCtrlGrpAmpsECLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21509", "status" : "current", "objects" : { "ctrlGrpAmpsE" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group E DeciAmps Clear Trap""", }, # notification "cmCtrlGrpAmpsFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21510", "status" : "current", "objects" : { "ctrlGrpAmpsF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group F DeciAmps Clear Trap""", }, # notification "cmCtrlGrpAmpsGCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21511", "status" : "current", "objects" : { "ctrlGrpAmpsG" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group G DeciAmps Clear Trap""", }, # notification "cmCtrlGrpAmpsHCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21512", "status" : "current", "objects" : { "ctrlGrpAmpsH" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group H DeciAmps Clear Trap""", }, # notification "cmCtrlGrpAmpsAVoltsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21513", "status" : "current", "objects" : { "ctrlGrpAmpsAVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """AVolts Clear Trap""", }, # notification "cmCtrlGrpAmpsBVoltsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21514", "status" : "current", "objects" : { "ctrlGrpAmpsBVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """BVolts Clear Trap""", }, # notification "cmCtrlGrpAmpsCVoltsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21515", "status" : "current", "objects" : { "ctrlGrpAmpsCVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """CVolts Clear Trap""", }, # notification "cmCtrlGrpAmpsDVoltsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21516", "status" : "current", "objects" : { "ctrlGrpAmpsDVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DVolts Clear Trap""", }, # notification "cmCtrlGrpAmpsEVoltsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21517", "status" : "current", "objects" : { "ctrlGrpAmpsEVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """EVolts Clear Trap""", }, # notification "cmCtrlGrpAmpsFVoltsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21518", "status" : "current", "objects" : { "ctrlGrpAmpsFVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """FVolts Clear Trap""", }, # notification "cmCtrlGrpAmpsGVoltsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21519", "status" : "current", "objects" : { "ctrlGrpAmpsGVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """GVolts Clear Trap""", }, # notification "cmCtrlGrpAmpsHVoltsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21520", "status" : "current", "objects" : { "ctrlGrpAmpsHVolts" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlGrpAmpsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """HVolts Clear Trap""", }, # notification "cmCtrlOutletPendingCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21605", "status" : "current", "objects" : { "ctrlOutletPending" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Pending Clear Trap""", }, # notification "cmCtrlOutletDeciAmpsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21606", "status" : "current", "objects" : { "ctrlOutletDeciAmps" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Outlet DeciAmps Clear Trap""", }, # notification "cmCtrlOutletGroupCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21607", "status" : "current", "objects" : { "ctrlOutletGroup" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Group Clear Trap""", }, # notification "cmCtrlOutletUpDelayCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21608", "status" : "current", "objects" : { "ctrlOutletUpDelay" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """UpDelay Clear Trap""", }, # notification "cmCtrlOutletDwnDelayCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21609", "status" : "current", "objects" : { "ctrlOutletDwnDelay" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DwnDelay Clear Trap""", }, # notification "cmCtrlOutletRbtDelayCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21610", "status" : "current", "objects" : { "ctrlOutletRbtDelay" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """RbtDelay Clear Trap""", }, # notification "cmCtrlOutletURLCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21611", "status" : "current", "objects" : { "ctrlOutletURL" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """URL Clear Trap""", }, # notification "cmCtrlOutletPOAActionCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21612", "status" : "current", "objects" : { "ctrlOutletPOAAction" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """POAAction Clear Trap""", }, # notification "cmCtrlOutletPOADelayCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21613", "status" : "current", "objects" : { "ctrlOutletPOADelay" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """POADelay Clear Trap""", }, # notification "cmCtrlOutletKWattHrsCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21614", "status" : "current", "objects" : { "ctrlOutletKWattHrs" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """KWattHrs Clear Trap""", }, # notification "cmCtrlOutletPowerCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21615", "status" : "current", "objects" : { "ctrlOutletPower" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrlOutletStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Clear Trap""", }, # notification "cmDewPointSensorTempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21705", "status" : "current", "objects" : { "dewPointSensorTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dewPointSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Dew Point Sensor - Temperature Clear Trap""", }, # notification "cmDewPointSensorTempFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21706", "status" : "current", "objects" : { "dewPointSensorTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dewPointSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Dew Point Sensor - Temperature Clear Trap""", }, # notification "cmDewPointSensorHumidityCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21707", "status" : "current", "objects" : { "dewPointSensorHumidity" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dewPointSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Dew Point Sensor - Humidity Clear Trap""", }, # notification "cmDewPointSensorDewPointCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21708", "status" : "current", "objects" : { "dewPointSensorDewPointC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dewPointSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Dew Point Sensor - Dew Point Clear Trap""", }, # notification "cmDewPointSensorDewPointFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21709", "status" : "current", "objects" : { "dewPointSensorDewPointF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dewPointSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Remote Dew Point Sensor - Dew Point Clear Trap""", }, # notification "cmDigitalSensorDigitalCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21805", "status" : "current", "objects" : { "digitalSensorDigital" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "digitalSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Digital sensor Clear Trap""", }, # notification "cmDstsVoltsACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21905", "status" : "current", "objects" : { "dstsVoltsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """RMS Voltage of Side A Set Point Sensor Clear""", }, # notification "cmDstsDeciAmpsACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21906", "status" : "current", "objects" : { "dstsDeciAmpsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """RMS Current of Side A Set Point Sensor Clear""", }, # notification "cmDstsVoltsBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21907", "status" : "current", "objects" : { "dstsVoltsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """RMS Voltage of Side B Set Point Sensor Clear""", }, # notification "cmDstsDeciAmpsBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21908", "status" : "current", "objects" : { "dstsDeciAmpsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """RMS Current of Side B Set Point Sensor Clear""", }, # notification "cmDstsSourceAActiveCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21909", "status" : "current", "objects" : { "dstsSourceAActive" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source A Active Set Point Sensor Clear""", }, # notification "cmDstsSourceBActiveCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21910", "status" : "current", "objects" : { "dstsSourceBActive" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source B Active Set Point Sensor Clear""", }, # notification "cmDstsPowerStatusACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21911", "status" : "current", "objects" : { "dstsPowerStatusA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source A Power Qualilty Active Set Point Sensor Clear""", }, # notification "cmDstsPowerStatusBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21912", "status" : "current", "objects" : { "dstsPowerStatusB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source B Power Qualilty Active Set Point Sensor Clear""", }, # notification "cmDstsSourceATempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21913", "status" : "current", "objects" : { "dstsSourceATempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source A Temp Sensor Clear""", }, # notification "cmDstsSourceBTempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.21914", "status" : "current", "objects" : { "dstsSourceBTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "dstsName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Source B Temp Sensor Clear""", }, # notification "cmCpmSensorStatusCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22005", "status" : "current", "objects" : { "cpmSensorStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "cpmSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """City Power sensor Clear Trap""", }, # notification "cmSmokeAlarmStatusCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22105", "status" : "current", "objects" : { "smokeAlarmStatus" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "smokeAlarmName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Smoke alarm Clear Trap""", }, # notification "cmNeg48VdcSensorVoltageCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22205", "status" : "current", "objects" : { "neg48VdcSensorVoltage" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "neg48VdcSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """-48Vdc Sensor Clear Trap""", }, # notification "cmPos30VdcSensorVoltageCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22305", "status" : "current", "objects" : { "pos30VdcSensorVoltage" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "pos30VdcSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """30Vdc Sensor Clear Trap""", }, # notification "cmAnalogSensorAnalogCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22405", "status" : "current", "objects" : { "analogSensorAnalog" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "analogSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Analog Sensor Clear Trap""", }, # notification "cmCtrl3ChIECKWattHrsACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22505", "status" : "current", "objects" : { "ctrl3ChIECKWattHrsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours A Clear Trap""", }, # notification "cmCtrl3ChIECVoltsACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22506", "status" : "current", "objects" : { "ctrl3ChIECVoltsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts A Clear Trap""", }, # notification "cmCtrl3ChIECVoltPeakACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22507", "status" : "current", "objects" : { "ctrl3ChIECVoltPeakA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak A Clear Trap""", }, # notification "cmCtrl3ChIECDeciAmpsACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22508", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps A Clear Trap""", }, # notification "cmCtrl3ChIECDeciAmpsPeakACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22509", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsPeakA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak A Clear Trap""", }, # notification "cmCtrl3ChIECRealPowerACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22510", "status" : "current", "objects" : { "ctrl3ChIECRealPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power A Clear Trap""", }, # notification "cmCtrl3ChIECApparentPowerACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22511", "status" : "current", "objects" : { "ctrl3ChIECApparentPowerA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power A Clear Trap""", }, # notification "cmCtrl3ChIECPowerFactorACLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22512", "status" : "current", "objects" : { "ctrl3ChIECPowerFactorA" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor A Clear Trap""", }, # notification "cmCtrl3ChIECKWattHrsBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22513", "status" : "current", "objects" : { "ctrl3ChIECKWattHrsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours B Clear Trap""", }, # notification "cmCtrl3ChIECVoltsBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22514", "status" : "current", "objects" : { "ctrl3ChIECVoltsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts B Clear Trap""", }, # notification "cmCtrl3ChIECVoltPeakBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22515", "status" : "current", "objects" : { "ctrl3ChIECVoltPeakB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak B Clear Trap""", }, # notification "cmCtrl3ChIECDeciAmpsBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22516", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps B Clear Trap""", }, # notification "cmCtrl3ChIECDeciAmpsPeakBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22517", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsPeakB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak B Clear Trap""", }, # notification "cmCtrl3ChIECRealPowerBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22518", "status" : "current", "objects" : { "ctrl3ChIECRealPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power B Clear Trap""", }, # notification "cmCtrl3ChIECApparentPowerBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22519", "status" : "current", "objects" : { "ctrl3ChIECApparentPowerB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power B Clear Trap""", }, # notification "cmCtrl3ChIECPowerFactorBCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22520", "status" : "current", "objects" : { "ctrl3ChIECPowerFactorB" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor B Clear Trap""", }, # notification "cmCtrl3ChIECKWattHrsCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22521", "status" : "current", "objects" : { "ctrl3ChIECKWattHrsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Kilo Watt Hours C Clear Trap""", }, # notification "cmCtrl3ChIECVoltsCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22522", "status" : "current", "objects" : { "ctrl3ChIECVoltsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts C Clear Trap""", }, # notification "cmCtrl3ChIECVoltPeakCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22523", "status" : "current", "objects" : { "ctrl3ChIECVoltPeakC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Volts Peak C Clear Trap""", }, # notification "cmCtrl3ChIECDeciAmpsCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22524", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps C Clear Trap""", }, # notification "cmCtrl3ChIECDeciAmpsPeakCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22525", "status" : "current", "objects" : { "ctrl3ChIECDeciAmpsPeakC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Deciamps Peak C Clear Trap""", }, # notification "cmCtrl3ChIECRealPowerCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22526", "status" : "current", "objects" : { "ctrl3ChIECRealPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Real Power C Clear Trap""", }, # notification "cmCtrl3ChIECApparentPowerCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22527", "status" : "current", "objects" : { "ctrl3ChIECApparentPowerC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Apparent Power C Clear Trap""", }, # notification "cmCtrl3ChIECPowerFactorCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22528", "status" : "current", "objects" : { "ctrl3ChIECPowerFactorC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ctrl3ChIECName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Power Factor C Clear Trap""", }, # notification "cmClimateRelayTempCCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22605", "status" : "current", "objects" : { "climateRelayTempC" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay Temperature Sensor Clear Trap""", }, # notification "cmClimateRelayTempFCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22606", "status" : "current", "objects" : { "climateRelayTempF" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay Temperature Sensor Clear Trap""", }, # notification "cmClimateRelayIO1CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22607", "status" : "current", "objects" : { "climateRelayIO1" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO1 Sensor Clear Trap""", }, # notification "cmClimateRelayIO2CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22608", "status" : "current", "objects" : { "climateRelayIO2" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO2 Sensor Clear Trap""", }, # notification "cmClimateRelayIO3CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22609", "status" : "current", "objects" : { "climateRelayIO3" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO3 Sensor Clear Trap""", }, # notification "cmClimateRelayIO4CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22610", "status" : "current", "objects" : { "climateRelayIO4" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO4 Sensor Clear Trap""", }, # notification "cmClimateRelayIO5CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22611", "status" : "current", "objects" : { "climateRelayIO5" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO5 Sensor Clear Trap""", }, # notification "cmClimateRelayIO6CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22612", "status" : "current", "objects" : { "climateRelayIO6" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "climateRelayName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO6 Sensor Clear Trap""", }, # notification "cmAirSpeedSwitchSensorAirSpeedCLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.22805", "status" : "current", "objects" : { "airSpeedSwitchSensorAirSpeed" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "airSpeedSwitchSensorName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Air Speed Switch Clear Trap""", }, # notification "cmIoExpanderIO1CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23037", "status" : "current", "objects" : { "ioExpanderIO1" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO1 Sensor Clear Trap""", }, # notification "cmIoExpanderIO2CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23038", "status" : "current", "objects" : { "ioExpanderIO2" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO2 Sensor Clear Trap""", }, # notification "cmIoExpanderIO3CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23039", "status" : "current", "objects" : { "ioExpanderIO3" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO3 Sensor Clear Trap""", }, # notification "cmIoExpanderIO4CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23040", "status" : "current", "objects" : { "ioExpanderIO4" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO4 Sensor Clear Trap""", }, # notification "cmIoExpanderIO5CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23041", "status" : "current", "objects" : { "ioExpanderIO5" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO5 Sensor Clear Trap""", }, # notification "cmIoExpanderIO6CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23042", "status" : "current", "objects" : { "ioExpanderIO6" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO6 Sensor Clear Trap""", }, # notification "cmIoExpanderIO7CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23043", "status" : "current", "objects" : { "ioExpanderIO7" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO7 Sensor Clear Trap""", }, # notification "cmIoExpanderIO8CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23044", "status" : "current", "objects" : { "ioExpanderIO8" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO8 Sensor Clear Trap""", }, # notification "cmIoExpanderIO9CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23045", "status" : "current", "objects" : { "ioExpanderIO9" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO9 Sensor Clear Trap""", }, # notification "cmIoExpanderIO10CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23046", "status" : "current", "objects" : { "ioExpanderIO10" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO10 Sensor Clear Trap""", }, # notification "cmIoExpanderIO11CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23047", "status" : "current", "objects" : { "ioExpanderIO11" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO11 Sensor Clear Trap""", }, # notification "cmIoExpanderIO12CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23048", "status" : "current", "objects" : { "ioExpanderIO12" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO12 Sensor Clear Trap""", }, # notification "cmIoExpanderIO13CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23049", "status" : "current", "objects" : { "ioExpanderIO13" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO13 Sensor Clear Trap""", }, # notification "cmIoExpanderIO14CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23050", "status" : "current", "objects" : { "ioExpanderIO14" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO14 Sensor Clear Trap""", }, # notification "cmIoExpanderIO15CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23051", "status" : "current", "objects" : { "ioExpanderIO15" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO15 Sensor Clear Trap""", }, # notification "cmIoExpanderIO16CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23052", "status" : "current", "objects" : { "ioExpanderIO16" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO16 Sensor Clear Trap""", }, # notification "cmIoExpanderIO17CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23053", "status" : "current", "objects" : { "ioExpanderIO17" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO17 Sensor Clear Trap""", }, # notification "cmIoExpanderIO18CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23054", "status" : "current", "objects" : { "ioExpanderIO18" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO18 Sensor Clear Trap""", }, # notification "cmIoExpanderIO19CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23055", "status" : "current", "objects" : { "ioExpanderIO19" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO19 Sensor Clear Trap""", }, # notification "cmIoExpanderIO20CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23056", "status" : "current", "objects" : { "ioExpanderIO20" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO20 Sensor Clear Trap""", }, # notification "cmIoExpanderIO21CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23057", "status" : "current", "objects" : { "ioExpanderIO21" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO21 Sensor Clear Trap""", }, # notification "cmIoExpanderIO22CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23058", "status" : "current", "objects" : { "ioExpanderIO22" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO22 Sensor Clear Trap""", }, # notification "cmIoExpanderIO23CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23059", "status" : "current", "objects" : { "ioExpanderIO23" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO23 Sensor Clear Trap""", }, # notification "cmIoExpanderIO24CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23060", "status" : "current", "objects" : { "ioExpanderIO24" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO24 Sensor Clear Trap""", }, # notification "cmIoExpanderIO25CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23061", "status" : "current", "objects" : { "ioExpanderIO25" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO25 Sensor Clear Trap""", }, # notification "cmIoExpanderIO26CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23062", "status" : "current", "objects" : { "ioExpanderIO26" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO26 Sensor Clear Trap""", }, # notification "cmIoExpanderIO27CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23063", "status" : "current", "objects" : { "ioExpanderIO27" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO27 Sensor Clear Trap""", }, # notification "cmIoExpanderIO28CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23064", "status" : "current", "objects" : { "ioExpanderIO28" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO28 Sensor Clear Trap""", }, # notification "cmIoExpanderIO29CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23065", "status" : "current", "objects" : { "ioExpanderIO29" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO29 Sensor Clear Trap""", }, # notification "cmIoExpanderIO30CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23066", "status" : "current", "objects" : { "ioExpanderIO30" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO30 Sensor Clear Trap""", }, # notification "cmIoExpanderIO31CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23067", "status" : "current", "objects" : { "ioExpanderIO31" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO31 Sensor Clear Trap""", }, # notification "cmIoExpanderIO32CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.23068", "status" : "current", "objects" : { "ioExpanderIO32" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "ioExpanderName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """Climate Relay IO32 Sensor Clear Trap""", }, # notification "cmPowerDMDeciAmps1NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129153", "status" : "current", "objects" : { "powerDMDeciAmps1" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps2NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129154", "status" : "current", "objects" : { "powerDMDeciAmps2" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps3NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129155", "status" : "current", "objects" : { "powerDMDeciAmps3" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps4NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129156", "status" : "current", "objects" : { "powerDMDeciAmps4" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps5NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129157", "status" : "current", "objects" : { "powerDMDeciAmps5" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps6NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129158", "status" : "current", "objects" : { "powerDMDeciAmps6" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps7NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129159", "status" : "current", "objects" : { "powerDMDeciAmps7" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps8NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129160", "status" : "current", "objects" : { "powerDMDeciAmps8" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps9NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129161", "status" : "current", "objects" : { "powerDMDeciAmps9" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps10NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129162", "status" : "current", "objects" : { "powerDMDeciAmps10" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps11NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129163", "status" : "current", "objects" : { "powerDMDeciAmps11" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps12NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129164", "status" : "current", "objects" : { "powerDMDeciAmps12" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps13NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129165", "status" : "current", "objects" : { "powerDMDeciAmps13" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps14NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129166", "status" : "current", "objects" : { "powerDMDeciAmps14" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps15NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129167", "status" : "current", "objects" : { "powerDMDeciAmps15" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps16NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129168", "status" : "current", "objects" : { "powerDMDeciAmps16" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps17NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129169", "status" : "current", "objects" : { "powerDMDeciAmps17" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps18NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129170", "status" : "current", "objects" : { "powerDMDeciAmps18" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps19NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129171", "status" : "current", "objects" : { "powerDMDeciAmps19" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps20NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129172", "status" : "current", "objects" : { "powerDMDeciAmps20" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps21NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129173", "status" : "current", "objects" : { "powerDMDeciAmps21" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps22NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129174", "status" : "current", "objects" : { "powerDMDeciAmps22" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps23NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129175", "status" : "current", "objects" : { "powerDMDeciAmps23" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps24NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129176", "status" : "current", "objects" : { "powerDMDeciAmps24" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps25NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129177", "status" : "current", "objects" : { "powerDMDeciAmps25" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps26NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129178", "status" : "current", "objects" : { "powerDMDeciAmps26" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps27NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129179", "status" : "current", "objects" : { "powerDMDeciAmps27" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps28NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129180", "status" : "current", "objects" : { "powerDMDeciAmps28" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps29NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129181", "status" : "current", "objects" : { "powerDMDeciAmps29" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps30NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129182", "status" : "current", "objects" : { "powerDMDeciAmps30" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps31NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129183", "status" : "current", "objects" : { "powerDMDeciAmps31" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps32NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129184", "status" : "current", "objects" : { "powerDMDeciAmps32" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps33NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129185", "status" : "current", "objects" : { "powerDMDeciAmps33" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps34NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129186", "status" : "current", "objects" : { "powerDMDeciAmps34" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps35NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129187", "status" : "current", "objects" : { "powerDMDeciAmps35" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps36NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129188", "status" : "current", "objects" : { "powerDMDeciAmps36" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps37NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129189", "status" : "current", "objects" : { "powerDMDeciAmps37" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps38NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129190", "status" : "current", "objects" : { "powerDMDeciAmps38" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps39NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129191", "status" : "current", "objects" : { "powerDMDeciAmps39" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps40NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129192", "status" : "current", "objects" : { "powerDMDeciAmps40" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps41NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129193", "status" : "current", "objects" : { "powerDMDeciAmps41" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps42NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129194", "status" : "current", "objects" : { "powerDMDeciAmps42" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps43NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129195", "status" : "current", "objects" : { "powerDMDeciAmps43" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps44NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129196", "status" : "current", "objects" : { "powerDMDeciAmps44" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps45NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129197", "status" : "current", "objects" : { "powerDMDeciAmps45" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps46NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129198", "status" : "current", "objects" : { "powerDMDeciAmps46" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps47NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129199", "status" : "current", "objects" : { "powerDMDeciAmps47" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps48NOTIFY" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.129200", "status" : "current", "objects" : { "powerDMDeciAmps48" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Trap""", }, # notification "cmPowerDMDeciAmps1CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229153", "status" : "current", "objects" : { "powerDMDeciAmps1" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps2CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229154", "status" : "current", "objects" : { "powerDMDeciAmps2" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps3CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229155", "status" : "current", "objects" : { "powerDMDeciAmps3" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps4CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229156", "status" : "current", "objects" : { "powerDMDeciAmps4" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps5CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229157", "status" : "current", "objects" : { "powerDMDeciAmps5" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps6CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229158", "status" : "current", "objects" : { "powerDMDeciAmps6" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps7CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229159", "status" : "current", "objects" : { "powerDMDeciAmps7" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps8CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229160", "status" : "current", "objects" : { "powerDMDeciAmps8" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps9CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229161", "status" : "current", "objects" : { "powerDMDeciAmps9" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps10CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229162", "status" : "current", "objects" : { "powerDMDeciAmps10" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps11CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229163", "status" : "current", "objects" : { "powerDMDeciAmps11" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps12CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229164", "status" : "current", "objects" : { "powerDMDeciAmps12" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps13CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229165", "status" : "current", "objects" : { "powerDMDeciAmps13" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps14CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229166", "status" : "current", "objects" : { "powerDMDeciAmps14" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps15CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229167", "status" : "current", "objects" : { "powerDMDeciAmps15" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps16CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229168", "status" : "current", "objects" : { "powerDMDeciAmps16" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps17CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229169", "status" : "current", "objects" : { "powerDMDeciAmps17" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps18CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229170", "status" : "current", "objects" : { "powerDMDeciAmps18" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps19CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229171", "status" : "current", "objects" : { "powerDMDeciAmps19" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps20CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229172", "status" : "current", "objects" : { "powerDMDeciAmps20" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps21CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229173", "status" : "current", "objects" : { "powerDMDeciAmps21" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps22CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229174", "status" : "current", "objects" : { "powerDMDeciAmps22" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps23CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229175", "status" : "current", "objects" : { "powerDMDeciAmps23" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps24CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229176", "status" : "current", "objects" : { "powerDMDeciAmps24" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps25CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229177", "status" : "current", "objects" : { "powerDMDeciAmps25" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps26CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229178", "status" : "current", "objects" : { "powerDMDeciAmps26" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps27CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229179", "status" : "current", "objects" : { "powerDMDeciAmps27" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps28CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229180", "status" : "current", "objects" : { "powerDMDeciAmps28" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps29CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229181", "status" : "current", "objects" : { "powerDMDeciAmps29" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps30CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229182", "status" : "current", "objects" : { "powerDMDeciAmps30" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps31CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229183", "status" : "current", "objects" : { "powerDMDeciAmps31" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps32CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229184", "status" : "current", "objects" : { "powerDMDeciAmps32" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps33CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229185", "status" : "current", "objects" : { "powerDMDeciAmps33" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps34CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229186", "status" : "current", "objects" : { "powerDMDeciAmps34" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps35CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229187", "status" : "current", "objects" : { "powerDMDeciAmps35" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps36CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229188", "status" : "current", "objects" : { "powerDMDeciAmps36" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps37CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229189", "status" : "current", "objects" : { "powerDMDeciAmps37" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps38CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229190", "status" : "current", "objects" : { "powerDMDeciAmps38" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps39CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229191", "status" : "current", "objects" : { "powerDMDeciAmps39" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps40CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229192", "status" : "current", "objects" : { "powerDMDeciAmps40" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps41CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229193", "status" : "current", "objects" : { "powerDMDeciAmps41" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps42CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229194", "status" : "current", "objects" : { "powerDMDeciAmps42" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps43CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229195", "status" : "current", "objects" : { "powerDMDeciAmps43" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps44CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229196", "status" : "current", "objects" : { "powerDMDeciAmps44" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps45CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229197", "status" : "current", "objects" : { "powerDMDeciAmps45" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps46CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229198", "status" : "current", "objects" : { "powerDMDeciAmps46" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps47CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229199", "status" : "current", "objects" : { "powerDMDeciAmps47" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification "cmPowerDMDeciAmps48CLEAR" : { "nodetype" : "notification", "moduleName" : "IT-WATCHDOGS-MIB-V3", "oid" : "1.3.6.1.4.1.17373.3.32767.0.229200", "status" : "current", "objects" : { "powerDMDeciAmps48" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "powerDMName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "productFriendlyName" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, "alarmTripType" : { "nodetype" : "object", "module" : "IT-WATCHDOGS-MIB-V3" }, }, "description" : """DM48 Current Monitor Amps Clear Trap""", }, # notification }, # notifications }
gpl-2.0
632,302,935,312,327,800
35.619721
165
0.360062
false
InQuest/ThreatKB
migrations/versions/bc0fab3363f7_create_cfg_category_range_mapping_table.py
1
1736
"""create cfg_category_range_mapping table Revision ID: bc0fab3363f7 Revises: 960676c435b2 Create Date: 2017-08-12 23:11:42.385100 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'bc0fab3363f7' down_revision = '960676c435b2' branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('cfg_category_range_mapping', sa.Column('id', sa.Integer(), nullable=False), sa.Column('category', sa.String(length=255), nullable=False), sa.Column('range_min', sa.Integer(unsigned=True), nullable=False), sa.Column('range_max', sa.Integer(unsigned=True), nullable=False), sa.Column('current', sa.Integer(unsigned=True), nullable=False), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('category') ) op.create_index(u'ix_cfg_category_range_mapping_current', 'cfg_category_range_mapping', ['current'], unique=False) op.create_index(u'ix_cfg_category_range_mapping_range_max', 'cfg_category_range_mapping', ['range_max'], unique=False) op.create_index(u'ix_cfg_category_range_mapping_range_min', 'cfg_category_range_mapping', ['range_min'], unique=False) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_index(u'ix_cfg_category_range_mapping_range_min', table_name='cfg_category_range_mapping') op.drop_index(u'ix_cfg_category_range_mapping_range_max', table_name='cfg_category_range_mapping') op.drop_index(u'ix_cfg_category_range_mapping_current', table_name='cfg_category_range_mapping') op.drop_table('cfg_category_range_mapping') # ### end Alembic commands ###
gpl-2.0
-5,685,016,944,618,044,000
40.333333
122
0.710253
false
apple/llvm-project
lldb/test/API/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py
4
18396
""" Test breakpoint names. """ import os import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class BreakpointNames(TestBase): mydir = TestBase.compute_mydir(__file__) NO_DEBUG_INFO_TESTCASE = True @add_test_categories(['pyapi']) def test_setting_names(self): """Use Python APIs to test that we can set breakpoint names.""" self.build() self.setup_target() self.do_check_names() def test_illegal_names(self): """Use Python APIs to test that we don't allow illegal names.""" self.build() self.setup_target() self.do_check_illegal_names() def test_using_names(self): """Use Python APIs to test that operations on names works correctly.""" self.build() self.setup_target() self.do_check_using_names() def test_configuring_names(self): """Use Python APIs to test that configuring options on breakpoint names works correctly.""" self.build() self.make_a_dummy_name() self.setup_target() self.do_check_configuring_names() def test_configuring_permissions_sb(self): """Use Python APIs to test that configuring permissions on names works correctly.""" self.build() self.setup_target() self.do_check_configuring_permissions_sb() def test_configuring_permissions_cli(self): """Use Python APIs to test that configuring permissions on names works correctly.""" self.build() self.setup_target() self.do_check_configuring_permissions_cli() def setup_target(self): exe = self.getBuildArtifact("a.out") # Create a targets we are making breakpoint in and copying to: self.target = self.dbg.CreateTarget(exe) self.assertTrue(self.target, VALID_TARGET) self.main_file_spec = lldb.SBFileSpec(os.path.join(self.getSourceDir(), "main.c")) def check_name_in_target(self, bkpt_name): name_list = lldb.SBStringList() self.target.GetBreakpointNames(name_list) found_it = False for name in name_list: if name == bkpt_name: found_it = True break self.assertTrue(found_it, "Didn't find the name %s in the target's name list:"%(bkpt_name)) def setUp(self): # Call super's setUp(). TestBase.setUp(self) # These are the settings we're going to be putting into names & breakpoints: self.bp_name_string = "ABreakpoint" self.is_one_shot = True self.ignore_count = 1000 self.condition = "1 == 2" self.auto_continue = True self.tid = 0xaaaa self.tidx = 10 self.thread_name = "Fooey" self.queue_name = "Blooey" self.cmd_list = lldb.SBStringList() self.cmd_list.AppendString("frame var") self.cmd_list.AppendString("bt") self.help_string = "I do something interesting" def do_check_names(self): """Use Python APIs to check that we can set & retrieve breakpoint names""" bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) bkpt_name = "ABreakpoint" other_bkpt_name = "_AnotherBreakpoint" # Add a name and make sure we match it: success = bkpt.AddNameWithErrorHandling(bkpt_name) self.assertSuccess(success, "We couldn't add a legal name to a breakpoint.") matches = bkpt.MatchesName(bkpt_name) self.assertTrue(matches, "We didn't match the name we just set") # Make sure we don't match irrelevant names: matches = bkpt.MatchesName("NotABreakpoint") self.assertTrue(not matches, "We matched a name we didn't set.") # Make sure the name is also in the target: self.check_name_in_target(bkpt_name) # Add another name, make sure that works too: bkpt.AddNameWithErrorHandling(other_bkpt_name) matches = bkpt.MatchesName(bkpt_name) self.assertTrue(matches, "Adding a name means we didn't match the name we just set") self.check_name_in_target(other_bkpt_name) # Remove the name and make sure we no longer match it: bkpt.RemoveName(bkpt_name) matches = bkpt.MatchesName(bkpt_name) self.assertTrue(not matches,"We still match a name after removing it.") # Make sure the name list has the remaining name: name_list = lldb.SBStringList() bkpt.GetNames(name_list) num_names = name_list.GetSize() self.assertEquals(num_names, 1, "Name list has %d items, expected 1."%(num_names)) name = name_list.GetStringAtIndex(0) self.assertEquals(name, other_bkpt_name, "Remaining name was: %s expected %s."%(name, other_bkpt_name)) def do_check_illegal_names(self): """Use Python APIs to check that we reject illegal names.""" bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) bad_names = ["-CantStartWithADash", "1CantStartWithANumber", "^CantStartWithNonAlpha", "CantHave-ADash", "Cant Have Spaces"] for bad_name in bad_names: success = bkpt.AddNameWithErrorHandling(bad_name) self.assertTrue(success.Fail(), "We allowed an illegal name: %s"%(bad_name)) bp_name = lldb.SBBreakpointName(self.target, bad_name) self.assertFalse(bp_name.IsValid(), "We made a breakpoint name with an illegal name: %s"%(bad_name)); retval =lldb.SBCommandReturnObject() self.dbg.GetCommandInterpreter().HandleCommand("break set -n whatever -N '%s'"%(bad_name), retval) self.assertTrue(not retval.Succeeded(), "break set succeeded with: illegal name: %s"%(bad_name)) def do_check_using_names(self): """Use Python APIs to check names work in place of breakpoint ID's.""" # Create a dummy breakpoint to use up ID 1 _ = self.target.BreakpointCreateByLocation(self.main_file_spec, 30) # Create a breakpoint to test with bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) bkpt_name = "ABreakpoint" bkpt_id = bkpt.GetID() other_bkpt_name= "_AnotherBreakpoint" # Add a name and make sure we match it: success = bkpt.AddNameWithErrorHandling(bkpt_name) self.assertSuccess(success, "We couldn't add a legal name to a breakpoint.") bkpts = lldb.SBBreakpointList(self.target) self.target.FindBreakpointsByName(bkpt_name, bkpts) self.assertEquals(bkpts.GetSize(), 1, "One breakpoint matched.") found_bkpt = bkpts.GetBreakpointAtIndex(0) self.assertEquals(bkpt.GetID(), found_bkpt.GetID(),"The right breakpoint.") self.assertEquals(bkpt.GetID(), bkpt_id,"With the same ID as before.") retval = lldb.SBCommandReturnObject() self.dbg.GetCommandInterpreter().HandleCommand("break disable %s"%(bkpt_name), retval) self.assertTrue(retval.Succeeded(), "break disable failed with: %s."%(retval.GetError())) self.assertTrue(not bkpt.IsEnabled(), "We didn't disable the breakpoint.") # Also make sure we don't apply commands to non-matching names: self.dbg.GetCommandInterpreter().HandleCommand("break modify --one-shot 1 %s"%(other_bkpt_name), retval) self.assertTrue(retval.Succeeded(), "break modify failed with: %s."%(retval.GetError())) self.assertTrue(not bkpt.IsOneShot(), "We applied one-shot to the wrong breakpoint.") def check_option_values(self, bp_object): self.assertEqual(bp_object.IsOneShot(), self.is_one_shot, "IsOneShot") self.assertEqual(bp_object.GetIgnoreCount(), self.ignore_count, "IgnoreCount") self.assertEqual(bp_object.GetCondition(), self.condition, "Condition") self.assertEqual(bp_object.GetAutoContinue(), self.auto_continue, "AutoContinue") self.assertEqual(bp_object.GetThreadID(), self.tid, "Thread ID") self.assertEqual(bp_object.GetThreadIndex(), self.tidx, "Thread Index") self.assertEqual(bp_object.GetThreadName(), self.thread_name, "Thread Name") self.assertEqual(bp_object.GetQueueName(), self.queue_name, "Queue Name") set_cmds = lldb.SBStringList() bp_object.GetCommandLineCommands(set_cmds) self.assertEqual(set_cmds.GetSize(), self.cmd_list.GetSize(), "Size of command line commands") for idx in range(0, set_cmds.GetSize()): self.assertEqual(self.cmd_list.GetStringAtIndex(idx), set_cmds.GetStringAtIndex(idx), "Command %d"%(idx)) def make_a_dummy_name(self): "This makes a breakpoint name in the dummy target to make sure it gets copied over" dummy_target = self.dbg.GetDummyTarget() self.assertTrue(dummy_target.IsValid(), "Dummy target was not valid.") def cleanup (): self.dbg.GetDummyTarget().DeleteBreakpointName(self.bp_name_string) # Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup) # Now find it in the dummy target, and make sure these settings took: bp_name = lldb.SBBreakpointName(dummy_target, self.bp_name_string) # Make sure the name is right: self.assertEqual(bp_name.GetName(), self.bp_name_string, "Wrong bp_name: %s"%(bp_name.GetName())) bp_name.SetOneShot(self.is_one_shot) bp_name.SetIgnoreCount(self.ignore_count) bp_name.SetCondition(self.condition) bp_name.SetAutoContinue(self.auto_continue) bp_name.SetThreadID(self.tid) bp_name.SetThreadIndex(self.tidx) bp_name.SetThreadName(self.thread_name) bp_name.SetQueueName(self.queue_name) bp_name.SetCommandLineCommands(self.cmd_list) # Now look it up again, and make sure it got set correctly. bp_name = lldb.SBBreakpointName(dummy_target, self.bp_name_string) self.assertTrue(bp_name.IsValid(), "Failed to make breakpoint name.") self.check_option_values(bp_name) def do_check_configuring_names(self): """Use Python APIs to check that configuring breakpoint names works correctly.""" other_bp_name_string = "AnotherBreakpointName" cl_bp_name_string = "CLBreakpointName" # Now find the version copied in from the dummy target, and make sure these settings took: bp_name = lldb.SBBreakpointName(self.target, self.bp_name_string) self.assertTrue(bp_name.IsValid(), "Failed to make breakpoint name.") self.check_option_values(bp_name) # Now add this name to a breakpoint, and make sure it gets configured properly bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) success = bkpt.AddNameWithErrorHandling(self.bp_name_string) self.assertSuccess(success, "Couldn't add this name to the breakpoint") self.check_option_values(bkpt) # Now make a name from this breakpoint, and make sure the new name is properly configured: new_name = lldb.SBBreakpointName(bkpt, other_bp_name_string) self.assertTrue(new_name.IsValid(), "Couldn't make a valid bp_name from a breakpoint.") self.check_option_values(bkpt) # Now change the name's option and make sure it gets propagated to # the breakpoint: new_auto_continue = not self.auto_continue bp_name.SetAutoContinue(new_auto_continue) self.assertEqual(bp_name.GetAutoContinue(), new_auto_continue, "Couldn't change auto-continue on the name") self.assertEqual(bkpt.GetAutoContinue(), new_auto_continue, "Option didn't propagate to the breakpoint.") # Now make this same breakpoint name - but from the command line cmd_str = "breakpoint name configure %s -o %d -i %d -c '%s' -G %d -t %d -x %d -T '%s' -q '%s' -H '%s'"%(cl_bp_name_string, self.is_one_shot, self.ignore_count, self.condition, self.auto_continue, self.tid, self.tidx, self.thread_name, self.queue_name, self.help_string) for cmd in self.cmd_list: cmd_str += " -C '%s'"%(cmd) self.runCmd(cmd_str, check=True) # Now look up this name again and check its options: cl_name = lldb.SBBreakpointName(self.target, cl_bp_name_string) self.check_option_values(cl_name) # Also check the help string: self.assertEqual(self.help_string, cl_name.GetHelpString(), "Help string didn't match") # Change the name and make sure that works: new_help = "I do something even more interesting" cl_name.SetHelpString(new_help) self.assertEqual(new_help, cl_name.GetHelpString(), "SetHelpString didn't") # We should have three names now, make sure the target can list them: name_list = lldb.SBStringList() self.target.GetBreakpointNames(name_list) for name_string in [self.bp_name_string, other_bp_name_string, cl_bp_name_string]: self.assertIn(name_string, name_list, "Didn't find %s in names"%(name_string)) # Delete the name from the current target. Make sure that works and deletes the # name from the breakpoint as well: self.target.DeleteBreakpointName(self.bp_name_string) name_list.Clear() self.target.GetBreakpointNames(name_list) self.assertNotIn(self.bp_name_string, name_list, "Didn't delete %s from a real target"%(self.bp_name_string)) # Also make sure the name got removed from breakpoints holding it: self.assertFalse(bkpt.MatchesName(self.bp_name_string), "Didn't remove the name from the breakpoint.") # Test that deleting the name we injected into the dummy target works (there's also a # cleanup that will do this, but that won't test the result... dummy_target = self.dbg.GetDummyTarget() dummy_target.DeleteBreakpointName(self.bp_name_string) name_list.Clear() dummy_target.GetBreakpointNames(name_list) self.assertNotIn(self.bp_name_string, name_list, "Didn't delete %s from the dummy target"%(self.bp_name_string)) # Also make sure the name got removed from breakpoints holding it: self.assertFalse(bkpt.MatchesName(self.bp_name_string), "Didn't remove the name from the breakpoint.") def check_permission_results(self, bp_name): self.assertEqual(bp_name.GetAllowDelete(), False, "Didn't set allow delete.") protected_bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) protected_id = protected_bkpt.GetID() unprotected_bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) unprotected_id = unprotected_bkpt.GetID() success = protected_bkpt.AddNameWithErrorHandling(self.bp_name_string) self.assertSuccess(success, "Couldn't add this name to the breakpoint") self.target.DisableAllBreakpoints() self.assertEqual(protected_bkpt.IsEnabled(), True, "Didnt' keep breakpoint from being disabled") self.assertEqual(unprotected_bkpt.IsEnabled(), False, "Protected too many breakpoints from disabling.") # Try from the command line too: unprotected_bkpt.SetEnabled(True) result = lldb.SBCommandReturnObject() self.dbg.GetCommandInterpreter().HandleCommand("break disable", result) self.assertTrue(result.Succeeded()) self.assertEqual(protected_bkpt.IsEnabled(), True, "Didnt' keep breakpoint from being disabled") self.assertEqual(unprotected_bkpt.IsEnabled(), False, "Protected too many breakpoints from disabling.") self.target.DeleteAllBreakpoints() bkpt = self.target.FindBreakpointByID(protected_id) self.assertTrue(bkpt.IsValid(), "Didn't keep the breakpoint from being deleted.") bkpt = self.target.FindBreakpointByID(unprotected_id) self.assertFalse(bkpt.IsValid(), "Protected too many breakpoints from deletion.") # Remake the unprotected breakpoint and try again from the command line: unprotected_bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) unprotected_id = unprotected_bkpt.GetID() self.dbg.GetCommandInterpreter().HandleCommand("break delete -f", result) self.assertTrue(result.Succeeded()) bkpt = self.target.FindBreakpointByID(protected_id) self.assertTrue(bkpt.IsValid(), "Didn't keep the breakpoint from being deleted.") bkpt = self.target.FindBreakpointByID(unprotected_id) self.assertFalse(bkpt.IsValid(), "Protected too many breakpoints from deletion.") def do_check_configuring_permissions_sb(self): bp_name = lldb.SBBreakpointName(self.target, self.bp_name_string) # Make a breakpoint name with delete disallowed: bp_name = lldb.SBBreakpointName(self.target, self.bp_name_string) self.assertTrue(bp_name.IsValid(), "Failed to make breakpoint name for valid name.") bp_name.SetAllowDelete(False) bp_name.SetAllowDisable(False) bp_name.SetAllowList(False) self.check_permission_results(bp_name) def do_check_configuring_permissions_cli(self): # Make the name with the right options using the command line: self.runCmd("breakpoint name configure -L 0 -D 0 -A 0 %s"%(self.bp_name_string), check=True) # Now look up the breakpoint we made, and check that it works. bp_name = lldb.SBBreakpointName(self.target, self.bp_name_string) self.assertTrue(bp_name.IsValid(), "Didn't make a breakpoint name we could find.") self.check_permission_results(bp_name)
apache-2.0
2,050,503,746,968,287,000
48.718919
130
0.64302
false
kaflesudip/grabfeed
docs/source/conf.py
1
11341
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Grabfeed documentation build configuration file, created by # sphinx-quickstart on Tue Jan 19 09:26:38 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys import os import shlex import sphinx_rtd_theme # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.coverage', 'sphinx.ext.mathjax', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = 'Grabfeed' copyright = '2016, Sudip Kafle' author = 'Sudip Kafle' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.3' # The full version, including alpha/beta/rc tags. release = '0.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' #html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # Now only 'ja' uses this config value #html_search_options = {'type': 'default'} # The name of a javascript file (relative to the configuration directory) that # implements a search results scorer. If empty, the default will be used. #html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. htmlhelp_basename = 'Grabfeeddoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', # Latex figure (float) alignment #'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'Grabfeed.tex', 'Grabfeed Documentation', 'Sudip Kafle', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'grabfeed', 'Grabfeed Documentation', [author], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'Grabfeed', 'Grabfeed Documentation', author, 'Grabfeed', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False # -- Options for Epub output ---------------------------------------------- # Bibliographic Dublin Core info. epub_title = project epub_author = author epub_publisher = author epub_copyright = copyright # The basename for the epub file. It defaults to the project name. #epub_basename = project # The HTML theme for the epub output. Since the default themes are not optimized # for small screen space, using the same theme for HTML and epub output is # usually not wise. This defaults to 'epub', a theme designed to save visual # space. #epub_theme = 'epub' # The language of the text. It defaults to the language option # or 'en' if the language is not set. #epub_language = '' # The scheme of the identifier. Typical schemes are ISBN or URL. #epub_scheme = '' # The unique identifier of the text. This can be a ISBN number # or the project homepage. #epub_identifier = '' # A unique identification for the text. #epub_uid = '' # A tuple containing the cover image and cover page html template filenames. #epub_cover = () # A sequence of (type, uri, title) tuples for the guide element of content.opf. #epub_guide = () # HTML files that should be inserted before the pages created by sphinx. # The format is a list of tuples containing the path and title. #epub_pre_files = [] # HTML files shat should be inserted after the pages created by sphinx. # The format is a list of tuples containing the path and title. #epub_post_files = [] # A list of files that should not be packed into the epub file. epub_exclude_files = ['search.html'] # The depth of the table of contents in toc.ncx. #epub_tocdepth = 3 # Allow duplicate toc entries. #epub_tocdup = True # Choose between 'default' and 'includehidden'. #epub_tocscope = 'default' # Fix unsupported image types using the Pillow. #epub_fix_images = False # Scale large images. #epub_max_image_width = 0 # How to display URL addresses: 'footnote', 'no', or 'inline'. #epub_show_urls = 'inline' # If false, no index is generated. #epub_use_index = True
apache-2.0
-7,082,674,678,730,671,000
30.328729
80
0.707786
false
kperun/nestml
pynestml/visitors/ast_line_operation_visitor.py
1
1699
# # ASTLineOperatorVisitor.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # NEST is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with NEST. If not, see <http://www.gnu.org/licenses/>. """ rhs : left=rhs (plusOp='+' | minusOp='-') right=rhs """ from pynestml.meta_model.ast_expression import ASTExpression from pynestml.visitors.ast_visitor import ASTVisitor class ASTLineOperatorVisitor(ASTVisitor): """ Visits a single binary operation consisting of + or - and updates the type accordingly. """ def visit_expression(self, node): """ Visits a single expression containing a plus or minus operator and updates its type. :param node: a single expression :type node: ASTExpression """ lhs_type = node.get_lhs().type rhs_type = node.get_rhs().type arith_op = node.get_binary_operator() lhs_type.referenced_object = node.get_lhs() rhs_type.referenced_object = node.get_rhs() if arith_op.is_plus_op: node.type = lhs_type + rhs_type return elif arith_op.is_minus_op: node.type = lhs_type - rhs_type return
gpl-2.0
-7,360,699,407,849,808,000
31.673077
92
0.67628
false
bodhiconnolly/python-day-one-client
location.py
1
7437
#------------------------------------------------------------------------------- # Name: location v1.0 # Purpose: get location input from user and find relevant weather # # Author: Bodhi Connolly # # Created: 24/05/2014 # Copyright: (c) Bodhi Connolly 2014 # Licence: GNU General Public License, version 3 (GPL-3.0) #------------------------------------------------------------------------------- from pygeocoder import Geocoder,GeocoderError import urllib2 import json import wx from cStringIO import StringIO class Location ( wx.Dialog ): """A dialog to get user location and local weather via Google Maps and OpenWeatherMap""" def __init__( self, parent ): """Initialises the items in the dialog Location.__init__(Parent) -> None """ wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = 'Entry Location', pos = wx.DefaultPosition, size = wx.Size( -1,-1), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) bSizer1 = wx.BoxSizer( wx.VERTICAL ) bSizer2 = wx.BoxSizer( wx.HORIZONTAL ) self.input_location = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 200,-1 ), wx.TE_PROCESS_ENTER) self.Bind(wx.EVT_TEXT_ENTER,self.button_click,self.input_location) bSizer2.Add( self.input_location, 0, wx.ALL, 5 ) self.button_search = wx.Button( self, wx.ID_ANY, u"Search", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer2.Add( self.button_search, 0, wx.ALL, 5 ) self.button_search.Bind(wx.EVT_BUTTON,self.button_click) self.button_submit = wx.Button( self, wx.ID_OK, u"OK", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer2.Add( self.button_submit, 0, wx.ALL, 5 ) self.button_submit.Bind(wx.EVT_BUTTON,self.submit) self.cancel = wx.Button(self, wx.ID_CANCEL,size=(1,1)) bSizer1.Add( bSizer2, 1, wx.EXPAND, 5 ) self.bitmap = wx.StaticBitmap( self, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer1.Add( self.bitmap, 1, wx.ALL|wx.EXPAND, 5 ) self.location_text = wx.StaticText( self, wx.ID_ANY, u"Location:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.location_text.Wrap( -1 ) bSizer1.Add( self.location_text, 0, wx.ALL, 5 ) self.weather_text = wx.StaticText( self, wx.ID_ANY, u"Weather:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.weather_text.Wrap( -1 ) bSizer1.Add( self.weather_text, 0, wx.ALL, 5 ) self.weathernames={'Clear':'Clear','Clouds':'cloudy'} self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) self.searched=False def button_click(self,evt=None): """Finds the coordinates from the user entry text and gets the weather from these coordinates Location.button_click(event) -> None """ self.get_weather(self.get_coordinates()) self.searched=True def get_coordinates(self): """Searches Google Maps for the location entered and returns the results Note: returns None if cannot find location Location.get_coordinates() -> pygeolib.GeocoderResult """ try: self.results=Geocoder.geocode(self.input_location.GetRange(0, self.input_location.GetLastPosition())) except GeocoderError: return None try: self.location_text.SetLabel(str(self.results)) except UnicodeDecodeError: return None return self.results def get_weather(self,coordinates): """Searches OpenWeatherMap for the weather at specified coordinates and sets variables based on this result for adding to entry. Also loads image of coordinates from Google Maps Static Image API. Location.get_weather() -> None """ if coordinates==None: self.location_text.SetLabel('Invalid Location') self.weather_text.SetLabel('No Weather') else: coordinates=coordinates.coordinates request = urllib2.urlopen( 'http://api.openweathermap.org/data/2.5/weather?lat=' +str(coordinates[0])+'&lon=' +str(coordinates[1])+'&units=metric') response = request.read() self.weather_json = json.loads(response) self.weather_text.SetLabel("Weather is %s with a temperature of %d" % (self.weather_json['weather'][0]['main'].lower(), self.weather_json['main']['temp'])) request.close() img_source = urllib2.urlopen( 'http://maps.googleapis.com/maps/api/staticmap?'+ '&zoom=11&size=600x200&sensor=false&markers=' +str(coordinates[0])+','+str(coordinates[1])) data = img_source.read() img_source.close() img = wx.ImageFromStream(StringIO(data)) bm = wx.BitmapFromImage((img)) self.bitmap.SetBitmap(bm) w, h = self.GetClientSize() self.SetSize((w+50,h+50)) try: self.celcius=int(self.weather_json['main']['temp']) except KeyError: pass try: self.icon=(self.weathernames[self.weather_json ['weather'][0]['main']]) except KeyError: self.icon='Clear' try: self.description=self.weather_json['weather'][0]['main'] except KeyError: pass try: self.humidity=self.weather_json['main']['humidity'] except KeyError: pass try: self.country=self.results.country except KeyError: pass try: self.placename=(str(self.results.street_number) +' '+self.results.route) except (TypeError,KeyError): self.placename='' try: self.adminarea=self.results.administrative_area_level_1 except KeyError: pass try: self.locality=self.results.locality except KeyError: pass def submit(self,evt=None): """Closes the dialog if user has already searched, else search and then close the dialog. Location.submit() -> None """ if self.searched: self.Close() else: self.button_click() self.Close() def main(): a = wx.App(0) f = Location(None) f.Show() a.MainLoop() if __name__ == '__main__': main()
gpl-3.0
-414,652,122,782,092,900
36.371859
80
0.514724
false
Jaxkr/TruthBot.org
Truthbot/news/migrations/0001_initial.py
1
3654
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-08-06 00:21 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Comment', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('text', models.TextField()), ('score', models.IntegerField(default=0)), ('timestamp', models.DateTimeField(default=django.utils.timezone.now, editable=False)), ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='CommentReply', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('text', models.TextField()), ('timestamp', models.DateTimeField(default=django.utils.timezone.now, editable=False)), ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ('comment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='news.Comment')), ], options={ 'ordering': ['timestamp'], }, ), migrations.CreateModel( name='CommentVote', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('comment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='news.Comment')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='Post', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('link', models.CharField(max_length=2083)), ('title', models.CharField(max_length=350)), ('timestamp', models.DateTimeField(default=django.utils.timezone.now)), ('score', models.IntegerField(default=0)), ('slug', models.SlugField(blank=True, unique=True)), ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='PostVote', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='news.Post')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.AddField( model_name='commentreply', name='post', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='news.Post'), ), migrations.AddField( model_name='comment', name='post', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='news.Post'), ), ]
gpl-2.0
-7,073,445,214,023,424,000
44.111111
120
0.584291
false
bdacode/hoster
hoster/mediafire_com.py
1
5195
# -*- coding: utf-8 -*- """Copyright (C) 2013 COLDWELL AG This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ import re import time import base64 import hashlib from bs4 import BeautifulSoup from ... import hoster # fix for HTTPS TLSv1 connection import ssl from requests.adapters import HTTPAdapter from requests.packages.urllib3.poolmanager import PoolManager @hoster.host class this: model = hoster.HttpPremiumHoster name = 'mediafire.com' patterns = [ hoster.Matcher('https?', '*.mediafire.com', "!/download/<id>/<name>"), hoster.Matcher('https?', '*.mediafire.com', "!/download/<id>"), hoster.Matcher('https?', '*.mediafire.com', r'/(file/|(view/?|download\.php)?\?)(?P<id>\w{11}|\w{15})($|/)'), hoster.Matcher('https?', '*.mediafire.com', _query_string=r'^(?P<id>(\w{11}|\w{15}))$'), ] url_template = 'http://www.mediafire.com/file/{id}' def on_check(file): name, size = get_file_infos(file) print name, size file.set_infos(name=name, size=size) def get_file_infos(file): id = file.pmatch.id resp = file.account.get("http://www.mediafire.com/api/file/get_info.php", params={"quick_key": id}) name = re.search(r"<filename>(.*?)</filename>", resp.text).group(1) size = re.search(r"<size>(.*?)</size>", resp.text).group(1) return name, int(size) def on_download_premium(chunk): id = chunk.file.pmatch.id resp = chunk.account.get("http://www.mediafire.com/?{}".format(id), allow_redirects=False) if "Enter Password" in resp.text and 'display:block;">This file is' in resp.text: raise NotImplementedError() password = input.password(file=chunk.file) if not password: chunk.password_aborted() password = password['password'] url = re.search(r'kNO = "(http://.*?)"', resp.text) if url: url = url.group(1) if not url: if resp.status_code == 302 and resp.headers['Location']: url = resp.headers['location'] if not url: resp = chunk.account.get("http://www.mediafire.com/dynamic/dlget.php", params={"qk": id}) url = re.search('dllink":"(http:.*?)"', resp.text) if url: url = url.group(1) if not url: chunk.no_download_link() return url def on_download_free(chunk): resp = chunk.account.get(chunk.file.url, allow_redirects=False) if resp.status_code == 302 and resp.headers['Location']: return resp.headers['Location'] raise NotImplementedError() class MyHTTPSAdapter(HTTPAdapter): def init_poolmanager(self, connections, maxsize, block): self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize, ssl_version=ssl.PROTOCOL_TLSv1, block=block) def on_initialize_account(self): self.APP_ID = 27112 self.APP_KEY = "czQ1cDd5NWE3OTl2ZGNsZmpkd3Q1eXZhNHcxdzE4c2Zlbmt2djdudw==" self.token = None self.browser.mount('https://', MyHTTPSAdapter()) resp = self.get("https://www.mediafire.com/") if self.username is None: return s = BeautifulSoup(resp.text) form = s.select('#form_login1') url, form = hoster.serialize_html_form(form[0]) url = hoster.urljoin("https://www.mediafire.com/", url) form['login_email'] = self.username form['login_pass'] = self.password form['login_remember'] = "on" resp = self.post(url, data=form, referer="https://www.mediafire.com/") if not self.browser.cookies['user']: self.login_failed() sig = hashlib.sha1() sig.update(self.username) sig.update(self.password) sig.update(str(self.APP_ID)) sig.update(base64.b64decode(self.APP_KEY)) sig = sig.hexdigest() params = { "email": self.username, "password": self.password, "application_id": self.APP_ID, "signature": sig, "version": 1} resp = self.get("https://www.mediafire.com/api/user/get_session_token.php", params=params) m = re.search(r"<session_token>(.*?)</session_token>", resp.text) if not m: self.fatal('error getting session token') self.token = m.group(1) resp = self.get("https://www.mediafire.com/myaccount/billinghistory.php") m = re.search(r'<div class="lg-txt">(\d+/\d+/\d+)</div> <div>', resp.text) if m: self.expires = m.group(1) self.premium = self.expires > time.time() and True or False if self.premium: resp = self.get("https://www.mediafire.com/myaccount.php") m = re.search(r'View Statistics.*?class="lg-txt">(.*?)</div', resp.text) if m: self.traffic = m.group(1) else: self.traffic = None
gpl-3.0
2,031,624,889,750,480,600
32.516129
123
0.646968
false
conejoninja/xbmc-seriesly
servers/rapidshare.py
1
1655
# -*- coding: utf-8 -*- #------------------------------------------------------------ # seriesly - XBMC Plugin # Conector para rapidshare # http://blog.tvalacarta.info/plugin-xbmc/seriesly/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core import scrapertools from core import logger from core import config def get_video_url( page_url , premium = False , user="" , password="", video_password="" ): logger.info("[rapidshare.py] get_video_url(page_url='%s')" % page_url) video_urls = [] return video_urls # Encuentra vídeos del servidor en el texto pasado def find_videos(data): encontrados = set() devuelve = [] # https://rapidshare.com/files/3346009389/_BiW__Last_Exile_Ginyoku_no_Fam_-_Episodio_09__A68583B1_.mkv # "https://rapidshare.com/files/3346009389/_BiW__Last_Exile_Ginyoku_no_Fam_-_Episodio_09__A68583B1_.mkv" # http://rapidshare.com/files/2327495081/Camino.Sangriento.4.HDR.Proper.200Ro.dri.part5.rar # https://rapidshare.com/files/715435909/Salmon.Fishing.in.the.Yemen.2012.720p.UNSOLOCLIC.INFO.mkv patronvideos = '(rapidshare.com/files/[0-9]+/.*?)["|<]' logger.info("[rapidshare.py] find_videos #"+patronvideos+"#") matches = re.compile(patronvideos,re.DOTALL).findall(data+'"') for match in matches: titulo = "[rapidshare]" url = "http://"+match if url not in encontrados: logger.info(" url="+url) devuelve.append( [ titulo , url , 'rapidshare' ] ) encontrados.add(url) else: logger.info(" url duplicada="+url) return devuelve
gpl-3.0
3,959,878,289,778,645,500
37.465116
108
0.611245
false
RedHatInsights/insights-core
insights/combiners/md5check.py
1
1060
""" NormalMD5 Combiner for the NormalMD5 Parser =========================================== Combiner for the :class:`insights.parsers.md5check.NormalMD5` parser. This parser is multioutput, one parser instance for each file md5sum. Ths combiner puts all of them back together and presents them as a dict where the keys are the filenames and the md5sums are the values. This class inherits all methods and attributes from the ``dict`` object. Examples: >>> type(md5sums) <class 'insights.combiners.md5check.NormalMD5'> >>> sorted(md5sums.keys()) ['/etc/localtime1', '/etc/localtime2'] >>> md5sums['/etc/localtime2'] 'd41d8cd98f00b204e9800998ecf8427e' """ from .. import combiner from insights.parsers.md5check import NormalMD5 as NormalMD5Parser @combiner(NormalMD5Parser) class NormalMD5(dict): """ Combiner for the NormalMD5 parser. """ def __init__(self, md5_checksums): super(NormalMD5, self).__init__() for md5info in md5_checksums: self.update({md5info.filename: md5info.md5sum})
apache-2.0
-2,259,252,239,409,799,700
30.176471
72
0.684906
false
ifarup/colourlab
tests/test_misc.py
1
1116
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ test_misc: Unittests for all functions in the misc module. Copyright (C) 2017 Ivar Farup This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ import unittest import matplotlib import matplotlib.pyplot as plt from colourlab import misc, space, data t = data.g_MacAdam() ell = t.get_ellipses(space.xyY) _, ax = plt.subplots() misc.plot_ellipses(ell, ax) misc.plot_ellipses(ell) class TestPlot(unittest.TestCase): def test_plot(self): self.assertTrue(isinstance(ax, matplotlib.axes.Axes))
gpl-3.0
6,108,424,612,598,163,000
30
69
0.759857
false
Answeror/pypaper
pypaper/acm.py
1
4948
#!/usr/bin/env python # -*- coding: utf-8 -*- from pyquery import PyQuery as pq import yapbib.biblist as biblist class ACM(object): def __init__(self, id): self.id = id @property def title(self): if not hasattr(self, 'b'): self.b = self._full_bibtex() return self.b.get_items()[0]['title'] @staticmethod def from_url(url): from urlparse import urlparse, parse_qs words = parse_qs(urlparse(url).query)['id'][0].split('.') assert len(words) == 2 return ACM(id=words[1]) #import re #try: #content = urlread(url) #return ACM(id=re.search(r"document.cookie = 'picked=' \+ '(\d+)'", content).group(1)) #except: #print(url) #return None @staticmethod def from_title(title): from urllib import urlencode url = 'http://dl.acm.org/results.cfm' d = pq(urlread(url + '?' + urlencode({'query': title}))) return ACM.from_url(d('a.medium-text').eq(0).attr('href')) @staticmethod def from_bibtex(f): b = biblist.BibList() ret = b.import_bibtex(f) assert ret return [ACM.from_title(it['title']) for it in b.get_items()] def export_bibtex(self, f): b = self._full_bibtex() b.export_bibtex(f) def _full_bibtex(self): b = self._original_bibtex() it = b.get_items()[0] it['abstract'] = self._abstract() return b def _original_bibtex(self): TEMPLATE = 'http://dl.acm.org/exportformats.cfm?id=%s&expformat=bibtex&_cf_containerId=theformats_body&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=142656B43EEEE8D6E34FC208DBFCC647&_cf_rc=3' url = TEMPLATE % self.id d = pq(urlread(url)) content = d('pre').text() from StringIO import StringIO f = StringIO(content) b = biblist.BibList() ret = b.import_bibtex(f) assert ret, content return b def _abstract(self): TEMPLATE = 'http://dl.acm.org/tab_abstract.cfm?id=%s&usebody=tabbody&cfid=216938597&cftoken=33552307&_cf_containerId=abstract&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=142656B43EEEE8D6E34FC208DBFCC647&_cf_rc=0' url = TEMPLATE % self.id d = pq(urlread(url)) return d.text() def download_pdf(self): TEMPLATE = 'http://dl.acm.org/ft_gateway.cfm?id=%s&ftid=723552&dwn=1&CFID=216938597&CFTOKEN=33552307' url = TEMPLATE % self.id content = urlread(url) filename = escape(self.title) + '.pdf' import os if not os.path.exists(filename): with open(filename, 'wb') as f: f.write(content) def escape(name): #import string #valid_chars = "-_.() %s%s" % (string.ascii_letters, string.digits) #return ''.join([ch if ch in valid_chars else ' ' for ch in name]) from gn import Gn gn = Gn() return gn(name) def urlread(url): import urllib2 import cookielib hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'Accept-Encoding': 'none', 'Accept-Language': 'en-US,en;q=0.8', 'Connection': 'keep-alive'} req = urllib2.Request(url, headers=hdr) page = urllib2.urlopen(req) return page.read() def from_clipboard(): import win32clipboard win32clipboard.OpenClipboard() data = win32clipboard.GetClipboardData() win32clipboard.CloseClipboard() return data def test_download(): bib = ACM.from_url('http://dl.acm.org/citation.cfm?id=1672308.1672326&coll=DL&dl=ACM&CFID=216938597&CFTOKEN=33552307') bib.download_pdf() def test_from_url(): bib = ACM.from_url('http://dl.acm.org/citation.cfm?id=1672308.1672326&coll=DL&dl=ACM&CFID=216938597&CFTOKEN=33552307') print(bib.id) def test_from_title(): bib = ACM.from_title('Applications of mobile activity recognition') print(bib.id) def get_params(): import sys return sys.argv[1] if len(sys.argv) > 1 else from_clipboard() def download_bibtex(arg): bib = ACM.from_url(arg) #from StringIO import StringIO #f = StringIO() bib.export_bibtex('out.bib') #print(f.getvalue()) def download_pdf(arg): import time bibs = ACM.from_bibtex(arg) print('bibs loaded') for bib in bibs: for i in range(10): try: print(bib.title) bib.download_pdf() time.sleep(10) except: print('failed') else: print('done') break if __name__ == '__main__': arg = get_params() if arg.endswith('.bib'): download_pdf(arg) else: download_bibtex(arg)
mit
-4,266,264,121,243,585,000
28.452381
223
0.589733
false
guokeno0/vitess
py/vtdb/vtgate_client.py
1
13325
# Copyright 2015 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. """This module defines the vtgate client interface. """ from vtdb import vtgate_cursor # mapping from protocol to python class. vtgate_client_conn_classes = dict() def register_conn_class(protocol, c): """Used by implementations to register themselves. Args: protocol: short string to document the protocol. c: class to register. """ vtgate_client_conn_classes[protocol] = c def connect(protocol, vtgate_addrs, timeout, *pargs, **kargs): """connect will return a dialed VTGateClient connection to a vtgate server. FIXME(alainjobart): exceptions raised are not consistent. Args: protocol: the registered protocol to use. vtgate_addrs: single or multiple vtgate server addresses to connect to. Which address is actually used depends on the load balancing capabilities of the underlying protocol used. timeout: connection timeout, float in seconds. *pargs: passed to the registered protocol __init__ method. **kargs: passed to the registered protocol __init__ method. Returns: A dialed VTGateClient. Raises: dbexceptions.OperationalError: if we are unable to establish the connection (for instance, no available instance). dbexceptions.Error: if vtgate_addrs have the wrong type. ValueError: If the protocol is unknown, or vtgate_addrs are malformed. """ if protocol not in vtgate_client_conn_classes: raise ValueError('Unknown vtgate_client protocol', protocol) conn = vtgate_client_conn_classes[protocol]( vtgate_addrs, timeout, *pargs, **kargs) conn.dial() return conn # Note: Eventually, this object will be replaced by a proto3 CallerID # object when all vitess customers have migrated to proto3. class CallerID(object): """An object with principal, component, and subcomponent fields.""" def __init__(self, principal=None, component=None, subcomponent=None): self.principal = principal self.component = component self.subcomponent = subcomponent class VTGateClient(object): """VTGateClient is the interface for the vtgate client implementations. All implementations must implement all these methods. If something goes wrong with the connection, this object will be thrown out. FIXME(alainjobart) transactional state (the Session object) is currently maintained by this object. It should be maintained by the cursor, and just returned / passed in with every method that makes sense. """ def __init__(self, addr, timeout): """Initialize a vtgate connection. Args: addr: server address. Can be protocol dependent. timeout: connection timeout (float, in seconds). """ self.addr = addr self.timeout = timeout # self.session is used by vtgate_utils.exponential_backoff_retry. # implementations should use it to store the session object. self.session = None def dial(self): """Dial to the server. If successful, call close() to close the connection. """ raise NotImplementedError('Child class needs to implement this') def close(self): """Close the connection. This object may be re-used again by calling dial(). """ raise NotImplementedError('Child class needs to implement this') def is_closed(self): """Checks the connection status. Returns: True if this connection is closed. """ raise NotImplementedError('Child class needs to implement this') def cursor(self, *pargs, **kwargs): """Creates a cursor instance associated with this connection. Args: *pargs: passed to the cursor constructor. **kwargs: passed to the cursor constructor. Returns: A new cursor to use on this connection. """ cursorclass = kwargs.pop('cursorclass', None) or vtgate_cursor.VTGateCursor return cursorclass(self, *pargs, **kwargs) def begin(self, effective_caller_id=None): """Starts a transaction. FIXME(alainjobart): instead of storing the Session as member variable, should return it and let the cursor store it. Args: effective_caller_id: CallerID Object. Raises: dbexceptions.TimeoutError: for connection timeout. dbexceptions.TransientError: the server is overloaded, and this query is asked to back off. dbexceptions.IntegrityError: integrity of an index would not be guaranteed with this statement. dbexceptions.DatabaseError: generic database error. dbexceptions.ProgrammingError: the supplied statements are invalid, this is probably an error in the code. dbexceptions.FatalError: this query should not be retried. """ raise NotImplementedError('Child class needs to implement this') def commit(self): """Commits the current transaction. FIXME(alainjobart): should take the session in. Raises: dbexceptions.TimeoutError: for connection timeout. dbexceptions.TransientError: the server is overloaded, and this query is asked to back off. dbexceptions.IntegrityError: integrity of an index would not be guaranteed with this statement. dbexceptions.DatabaseError: generic database error. dbexceptions.ProgrammingError: the supplied statements are invalid, this is probably an error in the code. dbexceptions.FatalError: this query should not be retried. """ raise NotImplementedError('Child class needs to implement this') def rollback(self): """Rolls the current transaction back. FIXME(alainjobart): should take the session in. Raises: dbexceptions.TimeoutError: for connection timeout. dbexceptions.TransientError: the server is overloaded, and this query is asked to back off. dbexceptions.IntegrityError: integrity of an index would not be guaranteed with this statement. dbexceptions.DatabaseError: generic database error. dbexceptions.ProgrammingError: the supplied statements are invalid, this is probably an error in the code. dbexceptions.FatalError: this query should not be retried. """ raise NotImplementedError('Child class needs to implement this') def _execute(self, sql, bind_variables, tablet_type, keyspace_name=None, shards=None, keyspace_ids=None, keyranges=None, entity_keyspace_id_map=None, entity_column_name=None, not_in_transaction=False, effective_caller_id=None, **kwargs): """Executes the given sql. FIXME(alainjobart): should take the session in. FIXME(alainjobart): implementations have keyspace before tablet_type! Args: sql: query to execute. bind_variables: map of bind variables for the query. tablet_type: the (string) version of the tablet type. keyspace_name: if specified, the keyspace to send the query to. Required if any of the routing parameters is used. Not required only if using vtgate v3 API. shards: if specified, use this list of shards names to route the query. Incompatible with keyspace_ids, keyranges, entity_keyspace_id_map, entity_column_name. Requires keyspace. keyspace_ids: if specified, use this list to route the query. Incompatible with shards, keyranges, entity_keyspace_id_map, entity_column_name. Requires keyspace. keyranges: if specified, use this list to route the query. Incompatible with shards, keyspace_ids, entity_keyspace_id_map, entity_column_name. Requires keyspace. entity_keyspace_id_map: if specified, use this map to route the query. Incompatible with shards, keyspace_ids, keyranges. Requires keyspace, entity_column_name. entity_column_name: if specified, use this value to route the query. Incompatible with shards, keyspace_ids, keyranges. Requires keyspace, entity_keyspace_id_map. not_in_transaction: force this execute to be outside the current transaction, if any. effective_caller_id: CallerID object. **kwargs: implementation specific parameters. Returns: results: list of rows. rowcount: how many rows were affected. lastrowid: auto-increment value for the last row inserted. fields: describes the field names and types. Raises: dbexceptions.TimeoutError: for connection timeout. dbexceptions.TransientError: the server is overloaded, and this query is asked to back off. dbexceptions.IntegrityError: integrity of an index would not be guaranteed with this statement. dbexceptions.DatabaseError: generic database error. dbexceptions.ProgrammingError: the supplied statements are invalid, this is probably an error in the code. dbexceptions.FatalError: this query should not be retried. """ raise NotImplementedError('Child class needs to implement this') def _execute_batch( self, sql_list, bind_variables_list, tablet_type, keyspace_list=None, shards_list=None, keyspace_ids_list=None, as_transaction=False, effective_caller_id=None, **kwargs): """Executes a list of sql queries. These follow the same routing rules as _execute. FIXME(alainjobart): should take the session in. Args: sql_list: list of SQL queries to execute. bind_variables_list: bind variables to associated with each query. tablet_type: the (string) version of the tablet type. keyspace_list: if specified, the keyspaces to send the queries to. Required if any of the routing parameters is used. Not required only if using vtgate v3 API. shards_list: if specified, use this list of shards names (per sql query) to route each query. Incompatible with keyspace_ids_list. Requires keyspace_list. keyspace_ids_list: if specified, use this list of keyspace_ids (per sql query) to route each query. Incompatible with shards_list. Requires keyspace_list. as_transaction: starts and commits a transaction around the statements. effective_caller_id: CallerID object. **kwargs: implementation specific parameters. Returns: results: an array of (results, rowcount, lastrowid, fields) tuples, one for each query. Raises: dbexceptions.TimeoutError: for connection timeout. dbexceptions.TransientError: the server is overloaded, and this query is asked to back off. dbexceptions.IntegrityError: integrity of an index would not be guaranteed with this statement. dbexceptions.DatabaseError: generic database error. dbexceptions.ProgrammingError: the supplied statements are invalid, this is probably an error in the code. dbexceptions.FatalError: this query should not be retried. """ raise NotImplementedError('Child class needs to implement this') def _stream_execute( self, sql, bind_variables, tablet_type, keyspace=None, shards=None, keyspace_ids=None, keyranges=None, effective_caller_id=None, **kwargs): """Executes the given sql, in streaming mode. FIXME(alainjobart): the return values are weird (historical reasons) and unused for now. We should use them, and not store the current streaming status in the connection, but in the cursor. Args: sql: query to execute. bind_variables: map of bind variables for the query. tablet_type: the (string) version of the tablet type. keyspace: if specified, the keyspace to send the query to. Required if any of the routing parameters is used. Not required only if using vtgate v3 API. shards: if specified, use this list of shards names to route the query. Incompatible with keyspace_ids, keyranges. Requires keyspace. keyspace_ids: if specified, use this list to route the query. Incompatible with shards, keyranges. Requires keyspace. keyranges: if specified, use this list to route the query. Incompatible with shards, keyspace_ids. Requires keyspace. effective_caller_id: CallerID object. **kwargs: implementation specific parameters. Returns: A (row generator, fields) pair. Raises: dbexceptions.TimeoutError: for connection timeout. dbexceptions.TransientError: the server is overloaded, and this query is asked to back off. dbexceptions.IntegrityError: integrity of an index would not be guaranteed with this statement. dbexceptions.DatabaseError: generic database error. dbexceptions.ProgrammingError: the supplied statements are invalid, this is probably an error in the code. dbexceptions.FatalError: this query should not be retried. """ raise NotImplementedError('Child class needs to implement this') def get_srv_keyspace(self, keyspace): """Returns a SrvKeyspace object. Args: keyspace: name of the keyspace to retrieve. Returns: srv_keyspace: a keyspace.Keyspace object. Raises: TBD """ raise NotImplementedError('Child class needs to implement this')
bsd-3-clause
-6,460,589,704,704,032,000
37.623188
79
0.705666
false
CitoEngine/cito_plugin_server
cito_plugin_server/settings/base.py
1
5183
"""Copyright 2014 Cyrus Dasadia Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import os import sys import logging try: from unipath import Path except ImportError: print 'Please run pip install Unipath, to install this module.' sys.exit(1) PROJECT_ROOT = Path(__file__).ancestor(2) # PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__)) # sys.path.insert(0, PROJECT_ROOT) LOG_PATH = PROJECT_ROOT.ancestor(1) DEBUG = False TEMPLATE_DEBUG = False ADMINS = ( # ('Your Name', '[email protected]'), ) MANAGERS = ADMINS # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # In a Windows environment this must be set to your system time zone. TIME_ZONE = 'UTC' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'en-us' SITE_ID = 1 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # If you set this to False, Django will not format dates, numbers and # calendars according to the current locale. USE_L10N = True # If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = True # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/home/media/media.lawrence.com/media/" MEDIA_ROOT = '' # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" MEDIA_URL = '' # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/home/media/media.lawrence.com/static/" STATIC_ROOT = PROJECT_ROOT.child('static') STATIC_ROOT = '' # URL prefix for static files. # Example: "http://media.lawrence.com/static/" STATIC_URL = '/static/' # Additional locations of static files STATICFILES_DIRS = ( # Put strings here, like "/home/html/static" or "C:/www/django/static". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. PROJECT_ROOT.child('static'), ) # List of finder classes that know how to find static files in # various locations. STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', # 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.Loader', ) TEMPLATE_CONTEXT_PROCESSORS = ( "django.contrib.auth.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors.static", "django.core.context_processors.tz", "django.contrib.messages.context_processors.messages", "django.core.context_processors.request", ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', # Uncomment the next line for simple clickjacking protection: # 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) ROOT_URLCONF = 'cito_plugin_server.urls' # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'cito_plugin_server.wsgi.application' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. PROJECT_ROOT.child('templates'), ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'gunicorn', 'south', 'cito_plugin_server', 'webservice', ) STATIC_FILES = PROJECT_ROOT.ancestor(1).child('staticfiles') try: from .secret_key import * except ImportError: print "settings/secret_key.py not found!" sys.exit(1)
apache-2.0
5,227,405,392,165,726,000
31.597484
88
0.737604
false
Mirantis/mos-horizon
openstack_dashboard/test/integration_tests/pages/identity/userspage.py
1
6565
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from selenium.webdriver.common import by from openstack_dashboard.test.integration_tests.pages import basepage from openstack_dashboard.test.integration_tests.regions import forms from openstack_dashboard.test.integration_tests.regions import tables class UsersTable(tables.TableRegion): name = 'users' CREATE_USER_FORM_FIELDS = ("name", "email", "password", "confirm_password", "project", "role_id") EDIT_USER_FORM_FIELDS = ("name", "email", "project") CHANGE_PASSWORD_FORM_FIELDS = ("password", "confirm_password", "name") _search_button_locator = (by.By.CSS_SELECTOR, 'div.table_search span.fa-search') @tables.bind_table_action('create') def create_user(self, create_button): create_button.click() return forms.FormRegion(self.driver, self.conf, field_mappings=self.CREATE_USER_FORM_FIELDS) @tables.bind_row_action('edit', primary=True) def edit_user(self, edit_button, row): edit_button.click() return forms.FormRegion(self.driver, self.conf, field_mappings=self.EDIT_USER_FORM_FIELDS) @tables.bind_row_action('change_password') def change_password(self, change_password_button, row): change_password_button.click() return forms.FormRegion( self.driver, self.conf, field_mappings=self.CHANGE_PASSWORD_FORM_FIELDS) # Row action 'Disable user' / 'Enable user' @tables.bind_row_action('toggle') def disable_enable_user(self, disable_enable_user_button, row): disable_enable_user_button.click() @tables.bind_row_action('delete') def delete_user(self, delete_button, row): delete_button.click() return forms.BaseFormRegion(self.driver, self.conf) @tables.bind_table_action('delete') def delete_users(self, delete_button): delete_button.click() return forms.BaseFormRegion(self.driver, self.conf) def available_row_actions(self, row): primary_selector = (by.By.CSS_SELECTOR, 'td.actions_column *.btn:nth-child(1)') secondary_locator = \ (by.By.CSS_SELECTOR, 'td.actions_column li > a, td.actions_column li > button') result = [row._get_element( *primary_selector).get_attribute('innerHTML').strip()] for element in row._get_elements(*secondary_locator): if element.is_enabled(): result.append(element.get_attribute('innerHTML').strip()) return result class UsersPage(basepage.BaseNavigationPage): USERS_TABLE_NAME_COLUMN = 'name' USERS_TABLE_ENABLED_COLUMN = 'enabled' def __init__(self, driver, conf): super(UsersPage, self).__init__(driver, conf) self._page_title = "Users" def _get_row_with_user_name(self, name): return self.users_table.get_row(self.USERS_TABLE_NAME_COLUMN, name) @property def users_table(self): return UsersTable(self.driver, self.conf) def create_user(self, name, password, project, role, email=None): create_user_form = self.users_table.create_user() create_user_form.name.text = name if email is not None: create_user_form.email.text = email create_user_form.password.text = password create_user_form.confirm_password.text = password create_user_form.project.text = project create_user_form.role_id.text = role create_user_form.submit() def edit_user(self, name, new_name=None, new_email=None, new_primary_project=None): row = self._get_row_with_user_name(name) edit_user_form = self.users_table.edit_user(row) if new_name: edit_user_form.name.text = new_name if new_email: edit_user_form.email.text = new_email if new_primary_project: edit_user_form.project.text = new_primary_project edit_user_form.submit() def get_user_info(self, name): user_info = {} row = self._get_row_with_user_name(name) edit_user_form = self.users_table.edit_user(row) user_info['name'] = edit_user_form.name.text user_info['email'] = edit_user_form.email.text or None user_info['primary_project'] = edit_user_form.project.text edit_user_form.cancel() return user_info def change_password(self, name, new_passwd): row = self._get_row_with_user_name(name) change_password_form = self.users_table.change_password(row) change_password_form.password.text = new_passwd change_password_form.confirm_password.text = new_passwd change_password_form.submit() def available_row_actions(self, name): row = self._get_row_with_user_name(name) return self.users_table.available_row_actions(row) def delete_user(self, name): row = self._get_row_with_user_name(name) confirm_delete_users_form = self.users_table.delete_user(row) confirm_delete_users_form.submit() def delete_users(self, *names): for name in names: self._get_row_with_user_name(name).mark() confirm_delete_users_form = self.users_table.delete_users() confirm_delete_users_form.submit() def is_user_present(self, name): return bool(self._get_row_with_user_name(name)) def disable_enable_user(self, name, action): row = self._get_row_with_user_name(name) self.users_table.disable_enable_user(row) if action == 'disable': return row.cells[self.USERS_TABLE_ENABLED_COLUMN].text == 'No' elif action == 'enable': return row.cells[self.USERS_TABLE_ENABLED_COLUMN].text == 'Yes' @property def visible_user_names(self): names = [row.cells['name'].text for row in self.users_table.rows] return filter(None, names)
apache-2.0
6,476,544,970,106,714,000
37.846154
78
0.637624
false
depristo/xvfbwrapper
setup.py
1
1339
#!/usr/bin/env python """disutils setup/install script for xvfbwrapper""" import os from distutils.core import setup this_dir = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(this_dir, 'README.rst')) as f: LONG_DESCRIPTION = '\n' + f.read() setup( name='xvfbwrapper', version='0.2.5', py_modules=['xvfbwrapper'], author='Corey Goldberg', author_email='cgoldberg _at_ gmail.com', description='run headless display inside X virtual framebuffer (Xvfb)', long_description=LONG_DESCRIPTION, url='https://github.com/cgoldberg/xvfbwrapper', download_url='http://pypi.python.org/pypi/xvfbwrapper', keywords='xvfb virtual display headless x11'.split(), license='MIT', classifiers=[ 'Operating System :: Unix', 'Operating System :: POSIX :: Linux', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Topic :: Software Development :: Libraries :: Python Modules', ] )
mit
9,206,166,086,070,455,000
30.880952
75
0.631068
false
zstackorg/zstack-utility
kvmagent/kvmagent/plugins/ha_plugin.py
1
27718
from kvmagent import kvmagent from zstacklib.utils import jsonobject from zstacklib.utils import http from zstacklib.utils import log from zstacklib.utils import shell from zstacklib.utils import linux from zstacklib.utils import lvm from zstacklib.utils import thread import os.path import time import traceback import threading logger = log.get_logger(__name__) class UmountException(Exception): pass class AgentRsp(object): def __init__(self): self.success = True self.error = None class ScanRsp(object): def __init__(self): super(ScanRsp, self).__init__() self.result = None class ReportPsStatusCmd(object): def __init__(self): self.hostUuid = None self.psUuids = None self.psStatus = None self.reason = None class ReportSelfFencerCmd(object): def __init__(self): self.hostUuid = None self.psUuids = None self.reason = None last_multipath_run = time.time() def kill_vm(maxAttempts, mountPaths=None, isFileSystem=None): zstack_uuid_pattern = "'[0-9a-f]{8}[0-9a-f]{4}[1-5][0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}'" virsh_list = shell.call("virsh list --all") logger.debug("virsh_list:\n" + virsh_list) vm_in_process_uuid_list = shell.call("virsh list | egrep -o " + zstack_uuid_pattern + " | sort | uniq") logger.debug('vm_in_process_uuid_list:\n' + vm_in_process_uuid_list) # kill vm's qemu process vm_pids_dict = {} for vm_uuid in vm_in_process_uuid_list.split('\n'): vm_uuid = vm_uuid.strip(' \t\n\r') if not vm_uuid: continue if mountPaths and isFileSystem is not None \ and not is_need_kill(vm_uuid, mountPaths, isFileSystem): continue vm_pid = shell.call("ps aux | grep qemu-kvm | grep -v grep | awk '/%s/{print $2}'" % vm_uuid) vm_pid = vm_pid.strip(' \t\n\r') vm_pids_dict[vm_uuid] = vm_pid for vm_uuid, vm_pid in vm_pids_dict.items(): kill = shell.ShellCmd('kill -9 %s' % vm_pid) kill(False) if kill.return_code == 0: logger.warn('kill the vm[uuid:%s, pid:%s] because we lost connection to the storage.' 'failed to read the heartbeat file %s times' % (vm_uuid, vm_pid, maxAttempts)) else: logger.warn('failed to kill the vm[uuid:%s, pid:%s] %s' % (vm_uuid, vm_pid, kill.stderr)) return vm_pids_dict def mount_path_is_nfs(mount_path): typ = shell.call("mount | grep '%s' | awk '{print $5}'" % mount_path) return typ.startswith('nfs') @linux.retry(times=8, sleep_time=2) def do_kill_and_umount(mount_path, is_nfs): kill_progresses_using_mount_path(mount_path) umount_fs(mount_path, is_nfs) def kill_and_umount(mount_path, is_nfs): do_kill_and_umount(mount_path, is_nfs) if is_nfs: shell.ShellCmd("systemctl start nfs-client.target")(False) def umount_fs(mount_path, is_nfs): if is_nfs: shell.ShellCmd("systemctl stop nfs-client.target")(False) time.sleep(2) o = shell.ShellCmd("umount -f %s" % mount_path) o(False) if o.return_code != 0: raise UmountException(o.stderr) def kill_progresses_using_mount_path(mount_path): o = shell.ShellCmd("pkill -9 -e -f '%s'" % mount_path) o(False) logger.warn('kill the progresses with mount path: %s, killed process: %s' % (mount_path, o.stdout)) def is_need_kill(vmUuid, mountPaths, isFileSystem): def vm_match_storage_type(vmUuid, isFileSystem): o = shell.ShellCmd("virsh dumpxml %s | grep \"disk type='file'\" | grep -v \"device='cdrom'\"" % vmUuid) o(False) if (o.return_code == 0 and isFileSystem) or (o.return_code != 0 and not isFileSystem): return True return False def vm_in_this_file_system_storage(vm_uuid, ps_paths): cmd = shell.ShellCmd("virsh dumpxml %s | grep \"source file=\" | head -1 |awk -F \"'\" '{print $2}'" % vm_uuid) cmd(False) vm_path = cmd.stdout.strip() if cmd.return_code != 0 or vm_in_storage_list(vm_path, ps_paths): return True return False def vm_in_this_distributed_storage(vm_uuid, ps_paths): cmd = shell.ShellCmd("virsh dumpxml %s | grep \"source protocol\" | head -1 | awk -F \"'\" '{print $4}'" % vm_uuid) cmd(False) vm_path = cmd.stdout.strip() if cmd.return_code != 0 or vm_in_storage_list(vm_path, ps_paths): return True return False def vm_in_storage_list(vm_path, storage_paths): if vm_path == "" or any([vm_path.startswith(ps_path) for ps_path in storage_paths]): return True return False if vm_match_storage_type(vmUuid, isFileSystem): if isFileSystem and vm_in_this_file_system_storage(vmUuid, mountPaths): return True elif not isFileSystem and vm_in_this_distributed_storage(vmUuid, mountPaths): return True return False class HaPlugin(kvmagent.KvmAgent): SCAN_HOST_PATH = "/ha/scanhost" SETUP_SELF_FENCER_PATH = "/ha/selffencer/setup" CANCEL_SELF_FENCER_PATH = "/ha/selffencer/cancel" CEPH_SELF_FENCER = "/ha/ceph/setupselffencer" CANCEL_CEPH_SELF_FENCER = "/ha/ceph/cancelselffencer" SHAREDBLOCK_SELF_FENCER = "/ha/sharedblock/setupselffencer" CANCEL_SHAREDBLOCK_SELF_FENCER = "/ha/sharedblock/cancelselffencer" ALIYUN_NAS_SELF_FENCER = "/ha/aliyun/nas/setupselffencer" CANCEL_NAS_SELF_FENCER = "/ha/aliyun/nas/cancelselffencer" RET_SUCCESS = "success" RET_FAILURE = "failure" RET_NOT_STABLE = "unstable" def __init__(self): # {ps_uuid: created_time} e.g. {'07ee15b2f68648abb489f43182bd59d7': 1544513500.163033} self.run_fencer_timestamp = {} # type: dict[str, float] self.fencer_lock = threading.RLock() @kvmagent.replyerror def cancel_ceph_self_fencer(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) self.cancel_fencer(cmd.uuid) return jsonobject.dumps(AgentRsp()) @kvmagent.replyerror def cancel_filesystem_self_fencer(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) for ps_uuid in cmd.psUuids: self.cancel_fencer(ps_uuid) return jsonobject.dumps(AgentRsp()) @kvmagent.replyerror def cancel_aliyun_nas_self_fencer(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) self.cancel_fencer(cmd.uuid) return jsonobject.dumps(AgentRsp()) @kvmagent.replyerror def setup_aliyun_nas_self_fencer(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) created_time = time.time() self.setup_fencer(cmd.uuid, created_time) @thread.AsyncThread def heartbeat_on_aliyunnas(): failure = 0 while self.run_fencer(cmd.uuid, created_time): try: time.sleep(cmd.interval) mount_path = cmd.mountPath test_file = os.path.join(mount_path, cmd.heartbeat, '%s-ping-test-file-%s' % (cmd.uuid, kvmagent.HOST_UUID)) touch = shell.ShellCmd('timeout 5 touch %s' % test_file) touch(False) if touch.return_code != 0: logger.debug('touch file failed, cause: %s' % touch.stderr) failure += 1 else: failure = 0 linux.rm_file_force(test_file) continue if failure < cmd.maxAttempts: continue try: logger.warn("aliyun nas storage %s fencer fired!" % cmd.uuid) vm_uuids = kill_vm(cmd.maxAttempts).keys() if vm_uuids: self.report_self_fencer_triggered([cmd.uuid], ','.join(vm_uuids)) # reset the failure count failure = 0 except Exception as e: logger.warn("kill vm failed, %s" % e.message) content = traceback.format_exc() logger.warn("traceback: %s" % content) finally: self.report_storage_status([cmd.uuid], 'Disconnected') except Exception as e: logger.debug('self-fencer on aliyun nas primary storage %s stopped abnormally' % cmd.uuid) content = traceback.format_exc() logger.warn(content) logger.debug('stop self-fencer on aliyun nas primary storage %s' % cmd.uuid) heartbeat_on_aliyunnas() return jsonobject.dumps(AgentRsp()) @kvmagent.replyerror def cancel_sharedblock_self_fencer(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) self.cancel_fencer(cmd.vgUuid) return jsonobject.dumps(AgentRsp()) @kvmagent.replyerror def setup_sharedblock_self_fencer(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) @thread.AsyncThread def heartbeat_on_sharedblock(): failure = 0 while self.run_fencer(cmd.vgUuid, created_time): try: time.sleep(cmd.interval) global last_multipath_run if cmd.fail_if_no_path and time.time() - last_multipath_run > 4: last_multipath_run = time.time() linux.set_fail_if_no_path() health = lvm.check_vg_status(cmd.vgUuid, cmd.storageCheckerTimeout, check_pv=False) logger.debug("sharedblock group primary storage %s fencer run result: %s" % (cmd.vgUuid, health)) if health[0] is True: failure = 0 continue failure += 1 if failure < cmd.maxAttempts: continue try: logger.warn("shared block storage %s fencer fired!" % cmd.vgUuid) self.report_storage_status([cmd.vgUuid], 'Disconnected', health[1]) # we will check one qcow2 per pv to determine volumes on pv should be kill invalid_pv_uuids = lvm.get_invalid_pv_uuids(cmd.vgUuid, cmd.checkIo) vms = lvm.get_running_vm_root_volume_on_pv(cmd.vgUuid, invalid_pv_uuids, True) killed_vm_uuids = [] for vm in vms: kill = shell.ShellCmd('kill -9 %s' % vm.pid) kill(False) if kill.return_code == 0: logger.warn( 'kill the vm[uuid:%s, pid:%s] because we lost connection to the storage.' 'failed to run health check %s times' % (vm.uuid, vm.pid, cmd.maxAttempts)) killed_vm_uuids.append(vm.uuid) else: logger.warn( 'failed to kill the vm[uuid:%s, pid:%s] %s' % (vm.uuid, vm.pid, kill.stderr)) for volume in vm.volumes: used_process = linux.linux_lsof(volume) if len(used_process) == 0: try: lvm.deactive_lv(volume, False) except Exception as e: logger.debug("deactivate volume %s for vm %s failed, %s" % (volume, vm.uuid, e.message)) content = traceback.format_exc() logger.warn("traceback: %s" % content) else: logger.debug("volume %s still used: %s, skip to deactivate" % (volume, used_process)) if len(killed_vm_uuids) != 0: self.report_self_fencer_triggered([cmd.vgUuid], ','.join(killed_vm_uuids)) lvm.remove_partial_lv_dm(cmd.vgUuid) if lvm.check_vg_status(cmd.vgUuid, cmd.storageCheckerTimeout, True)[0] is False: lvm.drop_vg_lock(cmd.vgUuid) lvm.remove_device_map_for_vg(cmd.vgUuid) # reset the failure count failure = 0 except Exception as e: logger.warn("kill vm failed, %s" % e.message) content = traceback.format_exc() logger.warn("traceback: %s" % content) except Exception as e: logger.debug('self-fencer on sharedblock primary storage %s stopped abnormally, try again soon...' % cmd.vgUuid) content = traceback.format_exc() logger.warn(content) if not self.run_fencer(cmd.vgUuid, created_time): logger.debug('stop self-fencer on sharedblock primary storage %s for judger failed' % cmd.vgUuid) else: logger.warn('stop self-fencer on sharedblock primary storage %s' % cmd.vgUuid) created_time = time.time() self.setup_fencer(cmd.vgUuid, created_time) heartbeat_on_sharedblock() return jsonobject.dumps(AgentRsp()) @kvmagent.replyerror def setup_ceph_self_fencer(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) def check_tools(): ceph = shell.run('which ceph') rbd = shell.run('which rbd') if ceph == 0 and rbd == 0: return True return False if not check_tools(): rsp = AgentRsp() rsp.error = "no ceph or rbd on current host, please install the tools first" rsp.success = False return jsonobject.dumps(rsp) mon_url = '\;'.join(cmd.monUrls) mon_url = mon_url.replace(':', '\\\:') created_time = time.time() self.setup_fencer(cmd.uuid, created_time) def get_ceph_rbd_args(): if cmd.userKey is None: return 'rbd:%s:mon_host=%s' % (cmd.heartbeatImagePath, mon_url) return 'rbd:%s:id=zstack:key=%s:auth_supported=cephx\;none:mon_host=%s' % (cmd.heartbeatImagePath, cmd.userKey, mon_url) def ceph_in_error_stat(): # HEALTH_OK,HEALTH_WARN,HEALTH_ERR and others(may be empty)... health = shell.ShellCmd('timeout %s ceph health' % cmd.storageCheckerTimeout) health(False) # If the command times out, then exit with status 124 if health.return_code == 124: return True health_status = health.stdout return not (health_status.startswith('HEALTH_OK') or health_status.startswith('HEALTH_WARN')) def heartbeat_file_exists(): touch = shell.ShellCmd('timeout %s qemu-img info %s' % (cmd.storageCheckerTimeout, get_ceph_rbd_args())) touch(False) if touch.return_code == 0: return True logger.warn('cannot query heartbeat image: %s: %s' % (cmd.heartbeatImagePath, touch.stderr)) return False def create_heartbeat_file(): create = shell.ShellCmd('timeout %s qemu-img create -f raw %s 1' % (cmd.storageCheckerTimeout, get_ceph_rbd_args())) create(False) if create.return_code == 0 or "File exists" in create.stderr: return True logger.warn('cannot create heartbeat image: %s: %s' % (cmd.heartbeatImagePath, create.stderr)) return False def delete_heartbeat_file(): shell.run("timeout %s rbd rm --id zstack %s -m %s" % (cmd.storageCheckerTimeout, cmd.heartbeatImagePath, mon_url)) @thread.AsyncThread def heartbeat_on_ceph(): try: failure = 0 while self.run_fencer(cmd.uuid, created_time): time.sleep(cmd.interval) if heartbeat_file_exists() or create_heartbeat_file(): failure = 0 continue failure += 1 if failure == cmd.maxAttempts: # c.f. We discovered that, Ceph could behave the following: # 1. Create heart-beat file, failed with 'File exists' # 2. Query the hb file in step 1, and failed again with 'No such file or directory' if ceph_in_error_stat(): path = (os.path.split(cmd.heartbeatImagePath))[0] vm_uuids = kill_vm(cmd.maxAttempts, [path], False).keys() if vm_uuids: self.report_self_fencer_triggered([cmd.uuid], ','.join(vm_uuids)) else: delete_heartbeat_file() # reset the failure count failure = 0 logger.debug('stop self-fencer on ceph primary storage') except: logger.debug('self-fencer on ceph primary storage stopped abnormally') content = traceback.format_exc() logger.warn(content) heartbeat_on_ceph() return jsonobject.dumps(AgentRsp()) @kvmagent.replyerror def setup_self_fencer(self, req): cmd = jsonobject.loads(req[http.REQUEST_BODY]) @thread.AsyncThread def heartbeat_file_fencer(mount_path, ps_uuid, mounted_by_zstack): def try_remount_fs(): if mount_path_is_nfs(mount_path): shell.run("systemctl start nfs-client.target") while self.run_fencer(ps_uuid, created_time): if linux.is_mounted(path=mount_path) and touch_heartbeat_file(): self.report_storage_status([ps_uuid], 'Connected') logger.debug("fs[uuid:%s] is reachable again, report to management" % ps_uuid) break try: logger.debug('fs[uuid:%s] is unreachable, it will be remounted after 180s' % ps_uuid) time.sleep(180) if not self.run_fencer(ps_uuid, created_time): break linux.remount(url, mount_path, options) self.report_storage_status([ps_uuid], 'Connected') logger.debug("remount fs[uuid:%s] success, report to management" % ps_uuid) break except: logger.warn('remount fs[uuid:%s] fail, try again soon' % ps_uuid) kill_progresses_using_mount_path(mount_path) logger.debug('stop remount fs[uuid:%s]' % ps_uuid) def after_kill_vm(): if not killed_vm_pids or not mounted_by_zstack: return try: kill_and_umount(mount_path, mount_path_is_nfs(mount_path)) except UmountException: if shell.run('ps -p %s' % ' '.join(killed_vm_pids)) == 0: virsh_list = shell.call("timeout 10 virsh list --all || echo 'cannot obtain virsh list'") logger.debug("virsh_list:\n" + virsh_list) logger.error('kill vm[pids:%s] failed because of unavailable fs[mountPath:%s].' ' please retry "umount -f %s"' % (killed_vm_pids, mount_path, mount_path)) return try_remount_fs() def touch_heartbeat_file(): touch = shell.ShellCmd('timeout %s touch %s' % (cmd.storageCheckerTimeout, heartbeat_file_path)) touch(False) if touch.return_code != 0: logger.warn('unable to touch %s, %s %s' % (heartbeat_file_path, touch.stderr, touch.stdout)) return touch.return_code == 0 heartbeat_file_path = os.path.join(mount_path, 'heartbeat-file-kvm-host-%s.hb' % cmd.hostUuid) created_time = time.time() self.setup_fencer(ps_uuid, created_time) try: failure = 0 url = shell.call("mount | grep -e '%s' | awk '{print $1}'" % mount_path).strip() options = shell.call("mount | grep -e '%s' | awk -F '[()]' '{print $2}'" % mount_path).strip() while self.run_fencer(ps_uuid, created_time): time.sleep(cmd.interval) if touch_heartbeat_file(): failure = 0 continue failure += 1 if failure == cmd.maxAttempts: logger.warn('failed to touch the heartbeat file[%s] %s times, we lost the connection to the storage,' 'shutdown ourselves' % (heartbeat_file_path, cmd.maxAttempts)) self.report_storage_status([ps_uuid], 'Disconnected') killed_vms = kill_vm(cmd.maxAttempts, [mount_path], True) if len(killed_vms) != 0: self.report_self_fencer_triggered([ps_uuid], ','.join(killed_vms.keys())) killed_vm_pids = killed_vms.values() after_kill_vm() logger.debug('stop heartbeat[%s] for filesystem self-fencer' % heartbeat_file_path) except: content = traceback.format_exc() logger.warn(content) for mount_path, uuid, mounted_by_zstack in zip(cmd.mountPaths, cmd.uuids, cmd.mountedByZStack): if not linux.timeout_isdir(mount_path): raise Exception('the mount path[%s] is not a directory' % mount_path) heartbeat_file_fencer(mount_path, uuid, mounted_by_zstack) return jsonobject.dumps(AgentRsp()) @kvmagent.replyerror def scan_host(self, req): rsp = ScanRsp() success = 0 cmd = jsonobject.loads(req[http.REQUEST_BODY]) for i in range(0, cmd.times): if shell.run("nmap --host-timeout 10s -sP -PI %s | grep -q 'Host is up'" % cmd.ip) == 0: success += 1 if success == cmd.successTimes: rsp.result = self.RET_SUCCESS return jsonobject.dumps(rsp) time.sleep(cmd.interval) if success == 0: rsp.result = self.RET_FAILURE return jsonobject.dumps(rsp) # WE SUCCEED A FEW TIMES, IT SEEMS THE CONNECTION NOT STABLE success = 0 for i in range(0, cmd.successTimes): if shell.run("nmap --host-timeout 10s -sP -PI %s | grep -q 'Host is up'" % cmd.ip) == 0: success += 1 time.sleep(cmd.successInterval) if success == cmd.successTimes: rsp.result = self.RET_SUCCESS return jsonobject.dumps(rsp) if success == 0: rsp.result = self.RET_FAILURE return jsonobject.dumps(rsp) rsp.result = self.RET_NOT_STABLE logger.info('scanhost[%s]: %s' % (cmd.ip, rsp.result)) return jsonobject.dumps(rsp) def start(self): http_server = kvmagent.get_http_server() http_server.register_async_uri(self.SCAN_HOST_PATH, self.scan_host) http_server.register_async_uri(self.SETUP_SELF_FENCER_PATH, self.setup_self_fencer) http_server.register_async_uri(self.CEPH_SELF_FENCER, self.setup_ceph_self_fencer) http_server.register_async_uri(self.CANCEL_SELF_FENCER_PATH, self.cancel_filesystem_self_fencer) http_server.register_async_uri(self.CANCEL_CEPH_SELF_FENCER, self.cancel_ceph_self_fencer) http_server.register_async_uri(self.SHAREDBLOCK_SELF_FENCER, self.setup_sharedblock_self_fencer) http_server.register_async_uri(self.CANCEL_SHAREDBLOCK_SELF_FENCER, self.cancel_sharedblock_self_fencer) http_server.register_async_uri(self.ALIYUN_NAS_SELF_FENCER, self.setup_aliyun_nas_self_fencer) http_server.register_async_uri(self.CANCEL_NAS_SELF_FENCER, self.cancel_aliyun_nas_self_fencer) def stop(self): pass def configure(self, config): self.config = config @thread.AsyncThread def report_self_fencer_triggered(self, ps_uuids, vm_uuids_string=None): url = self.config.get(kvmagent.SEND_COMMAND_URL) if not url: logger.warn('cannot find SEND_COMMAND_URL, unable to report self fencer triggered on [psList:%s]' % ps_uuids) return host_uuid = self.config.get(kvmagent.HOST_UUID) if not host_uuid: logger.warn( 'cannot find HOST_UUID, unable to report self fencer triggered on [psList:%s]' % ps_uuids) return def report_to_management_node(): cmd = ReportSelfFencerCmd() cmd.psUuids = ps_uuids cmd.hostUuid = host_uuid cmd.vmUuidsString = vm_uuids_string cmd.reason = "primary storage[uuids:%s] on host[uuid:%s] heartbeat fail, self fencer has been triggered" % (ps_uuids, host_uuid) logger.debug( 'host[uuid:%s] primary storage[psList:%s], triggered self fencer, report it to %s' % ( host_uuid, ps_uuids, url)) http.json_dump_post(url, cmd, {'commandpath': '/kvm/reportselffencer'}) report_to_management_node() @thread.AsyncThread def report_storage_status(self, ps_uuids, ps_status, reason=""): url = self.config.get(kvmagent.SEND_COMMAND_URL) if not url: logger.warn('cannot find SEND_COMMAND_URL, unable to report storages status[psList:%s, status:%s]' % ( ps_uuids, ps_status)) return host_uuid = self.config.get(kvmagent.HOST_UUID) if not host_uuid: logger.warn( 'cannot find HOST_UUID, unable to report storages status[psList:%s, status:%s]' % (ps_uuids, ps_status)) return def report_to_management_node(): cmd = ReportPsStatusCmd() cmd.psUuids = ps_uuids cmd.hostUuid = host_uuid cmd.psStatus = ps_status cmd.reason = reason logger.debug( 'primary storage[psList:%s] has new connection status[%s], report it to %s' % ( ps_uuids, ps_status, url)) http.json_dump_post(url, cmd, {'commandpath': '/kvm/reportstoragestatus'}) report_to_management_node() def run_fencer(self, ps_uuid, created_time): with self.fencer_lock: if not self.run_fencer_timestamp[ps_uuid] or self.run_fencer_timestamp[ps_uuid] > created_time: return False self.run_fencer_timestamp[ps_uuid] = created_time return True def setup_fencer(self, ps_uuid, created_time): with self.fencer_lock: self.run_fencer_timestamp[ps_uuid] = created_time def cancel_fencer(self, ps_uuid): with self.fencer_lock: self.run_fencer_timestamp.pop(ps_uuid, None)
apache-2.0
-99,950,752,034,942,160
40.370149
140
0.548452
false
hatbot-team/hatbot_resources
preparation/resources/Resource.py
1
3889
from hb_res.storage import get_storage from copy import copy import time __author__ = "mike" _resource_blacklist = {'Resource'} _resources_by_trunk = dict() _built_trunks = set() _building_trunks = set() def build_deps(res_obj): assert hasattr(res_obj, 'dependencies') for dep in res_obj.dependencies: assert dep in _resources_by_trunk assert dep not in _building_trunks, \ 'Dependency loop encountered: {} depends on {} to be built, and vice versa'.format( dep, res_obj.__class__.__name__) _resources_by_trunk[dep]().build() def applied_modifiers(res_obj): generated = set() for explanation in res_obj: r = copy(explanation) for functor in res_obj.modifiers: if r is None: break r = functor(r) if r is not None and r not in generated: generated.add(r) yield r def generate_asset(res_obj, out_storage): out_storage.clear() count = 0 for explanation in applied_modifiers(res_obj): if count % 100 == 0: print(count, end='\r') count += 1 out_storage.add_entry(explanation) return count def resource_build(res_obj): trunk = res_obj.trunk if trunk in _built_trunks: print("= Skipping {} generation as the resource is already built".format(trunk)) return _building_trunks.add(trunk) build_deps(res_obj) print("<=> Starting {} generation <=>".format(trunk)) start = time.monotonic() with get_storage(trunk) as out_storage: count = generate_asset(res_obj, out_storage) end = time.monotonic() print("> {} generated in {} seconds".format(trunk, end - start)) print("> {} explanations have passed the filters".format(count)) _building_trunks.remove(trunk) _built_trunks.add(trunk) class ResourceMeta(type): """ metaclass for classes which represent resource package """ def __new__(mcs, name, bases, dct): """ we have to register resource in _registered_resources """ assert name.endswith('Resource') trunk = name[:-len('Resource')] global _resources_by_trunk if trunk in _resources_by_trunk.keys(): raise KeyError('Resource with name {} is already registered'.format(name)) old_iter = dct['__iter__'] def iter_wrapped(self): build_deps(self) return old_iter(self) @property def trunk_prop(_): return trunk dct['trunk'] = trunk_prop dct['build'] = resource_build dct['__iter__'] = iter_wrapped res = super(ResourceMeta, mcs).__new__(mcs, name, bases, dct) if name not in _resource_blacklist: _resources_by_trunk[trunk] = res return res class Resource(metaclass=ResourceMeta): def __iter__(self): raise NotImplementedError def gen_resource(res_name, modifiers, dependencies=()): def decorator(func): def __init__(self): self.modifiers = modifiers self.dependencies = dependencies def __iter__(self): return iter(func()) return ResourceMeta(res_name, tuple(), {'__iter__': __iter__, '__init__': __init__}) return decorator def trunks_registered(): global _resources_by_trunk return _resources_by_trunk.keys() def resources_registered(): global _resources_by_trunk return _resources_by_trunk.values() def resource_by_trunk(name) -> Resource: """ Returns resource described by its name :param name: name of desired resource :return: iterable resource as list of strings """ global _resources_by_trunk resource = _resources_by_trunk.get(name, None) if resource is None: raise KeyError('Unknown resource {}'.format(name)) return resource
mit
-335,135,762,861,733,000
26.006944
95
0.60504
false
ojii/sandlib
lib/lib-python/2.7/test/test_descr.py
1
159616
import __builtin__ import sys import types import unittest import popen2 # trigger early the warning from popen2.py from copy import deepcopy from test import test_support class OperatorsTest(unittest.TestCase): def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) self.binops = { 'add': '+', 'sub': '-', 'mul': '*', 'div': '/', 'divmod': 'divmod', 'pow': '**', 'lshift': '<<', 'rshift': '>>', 'and': '&', 'xor': '^', 'or': '|', 'cmp': 'cmp', 'lt': '<', 'le': '<=', 'eq': '==', 'ne': '!=', 'gt': '>', 'ge': '>=', } for name, expr in self.binops.items(): if expr.islower(): expr = expr + "(a, b)" else: expr = 'a %s b' % expr self.binops[name] = expr self.unops = { 'pos': '+', 'neg': '-', 'abs': 'abs', 'invert': '~', 'int': 'int', 'long': 'long', 'float': 'float', 'oct': 'oct', 'hex': 'hex', } for name, expr in self.unops.items(): if expr.islower(): expr = expr + "(a)" else: expr = '%s a' % expr self.unops[name] = expr def unop_test(self, a, res, expr="len(a)", meth="__len__"): d = {'a': a} self.assertEqual(eval(expr, d), res) t = type(a) m = getattr(t, meth) # Find method in parent class while meth not in t.__dict__: t = t.__bases__[0] # in some implementations (e.g. PyPy), 'm' can be a regular unbound # method object; the getattr() below obtains its underlying function. self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth]) self.assertEqual(m(a), res) bm = getattr(a, meth) self.assertEqual(bm(), res) def binop_test(self, a, b, res, expr="a+b", meth="__add__"): d = {'a': a, 'b': b} # XXX Hack so this passes before 2.3 when -Qnew is specified. if meth == "__div__" and 1/2 == 0.5: meth = "__truediv__" if meth == '__divmod__': pass self.assertEqual(eval(expr, d), res) t = type(a) m = getattr(t, meth) while meth not in t.__dict__: t = t.__bases__[0] # in some implementations (e.g. PyPy), 'm' can be a regular unbound # method object; the getattr() below obtains its underlying function. self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth]) self.assertEqual(m(a, b), res) bm = getattr(a, meth) self.assertEqual(bm(b), res) def ternop_test(self, a, b, c, res, expr="a[b:c]", meth="__getslice__"): d = {'a': a, 'b': b, 'c': c} self.assertEqual(eval(expr, d), res) t = type(a) m = getattr(t, meth) while meth not in t.__dict__: t = t.__bases__[0] # in some implementations (e.g. PyPy), 'm' can be a regular unbound # method object; the getattr() below obtains its underlying function. self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth]) self.assertEqual(m(a, b, c), res) bm = getattr(a, meth) self.assertEqual(bm(b, c), res) def setop_test(self, a, b, res, stmt="a+=b", meth="__iadd__"): d = {'a': deepcopy(a), 'b': b} exec stmt in d self.assertEqual(d['a'], res) t = type(a) m = getattr(t, meth) while meth not in t.__dict__: t = t.__bases__[0] # in some implementations (e.g. PyPy), 'm' can be a regular unbound # method object; the getattr() below obtains its underlying function. self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth]) d['a'] = deepcopy(a) m(d['a'], b) self.assertEqual(d['a'], res) d['a'] = deepcopy(a) bm = getattr(d['a'], meth) bm(b) self.assertEqual(d['a'], res) def set2op_test(self, a, b, c, res, stmt="a[b]=c", meth="__setitem__"): d = {'a': deepcopy(a), 'b': b, 'c': c} exec stmt in d self.assertEqual(d['a'], res) t = type(a) m = getattr(t, meth) while meth not in t.__dict__: t = t.__bases__[0] # in some implementations (e.g. PyPy), 'm' can be a regular unbound # method object; the getattr() below obtains its underlying function. self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth]) d['a'] = deepcopy(a) m(d['a'], b, c) self.assertEqual(d['a'], res) d['a'] = deepcopy(a) bm = getattr(d['a'], meth) bm(b, c) self.assertEqual(d['a'], res) def set3op_test(self, a, b, c, d, res, stmt="a[b:c]=d", meth="__setslice__"): dictionary = {'a': deepcopy(a), 'b': b, 'c': c, 'd': d} exec stmt in dictionary self.assertEqual(dictionary['a'], res) t = type(a) while meth not in t.__dict__: t = t.__bases__[0] m = getattr(t, meth) # in some implementations (e.g. PyPy), 'm' can be a regular unbound # method object; the getattr() below obtains its underlying function. self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth]) dictionary['a'] = deepcopy(a) m(dictionary['a'], b, c, d) self.assertEqual(dictionary['a'], res) dictionary['a'] = deepcopy(a) bm = getattr(dictionary['a'], meth) bm(b, c, d) self.assertEqual(dictionary['a'], res) def test_lists(self): # Testing list operations... # Asserts are within individual test methods self.binop_test([1], [2], [1,2], "a+b", "__add__") self.binop_test([1,2,3], 2, 1, "b in a", "__contains__") self.binop_test([1,2,3], 4, 0, "b in a", "__contains__") self.binop_test([1,2,3], 1, 2, "a[b]", "__getitem__") self.ternop_test([1,2,3], 0, 2, [1,2], "a[b:c]", "__getslice__") self.setop_test([1], [2], [1,2], "a+=b", "__iadd__") self.setop_test([1,2], 3, [1,2,1,2,1,2], "a*=b", "__imul__") self.unop_test([1,2,3], 3, "len(a)", "__len__") self.binop_test([1,2], 3, [1,2,1,2,1,2], "a*b", "__mul__") self.binop_test([1,2], 3, [1,2,1,2,1,2], "b*a", "__rmul__") self.set2op_test([1,2], 1, 3, [1,3], "a[b]=c", "__setitem__") self.set3op_test([1,2,3,4], 1, 3, [5,6], [1,5,6,4], "a[b:c]=d", "__setslice__") def test_dicts(self): # Testing dict operations... if hasattr(dict, '__cmp__'): # PyPy has only rich comparison on dicts self.binop_test({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__") else: self.binop_test({1:2}, {2:1}, True, "a < b", "__lt__") self.binop_test({1:2,3:4}, 1, 1, "b in a", "__contains__") self.binop_test({1:2,3:4}, 2, 0, "b in a", "__contains__") self.binop_test({1:2,3:4}, 1, 2, "a[b]", "__getitem__") d = {1:2, 3:4} l1 = [] for i in d.keys(): l1.append(i) l = [] for i in iter(d): l.append(i) self.assertEqual(l, l1) l = [] for i in d.__iter__(): l.append(i) self.assertEqual(l, l1) l = [] for i in dict.__iter__(d): l.append(i) self.assertEqual(l, l1) d = {1:2, 3:4} self.unop_test(d, 2, "len(a)", "__len__") self.assertEqual(eval(repr(d), {}), d) self.assertEqual(eval(d.__repr__(), {}), d) self.set2op_test({1:2,3:4}, 2, 3, {1:2,2:3,3:4}, "a[b]=c", "__setitem__") # Tests for unary and binary operators def number_operators(self, a, b, skip=[]): dict = {'a': a, 'b': b} for name, expr in self.binops.items(): if name not in skip: name = "__%s__" % name if hasattr(a, name): res = eval(expr, dict) self.binop_test(a, b, res, expr, name) for name, expr in self.unops.items(): if name not in skip: name = "__%s__" % name if hasattr(a, name): res = eval(expr, dict) self.unop_test(a, res, expr, name) def test_ints(self): # Testing int operations... self.number_operators(100, 3) # The following crashes in Python 2.2 self.assertEqual((1).__nonzero__(), 1) self.assertEqual((0).__nonzero__(), 0) # This returns 'NotImplemented' in Python 2.2 class C(int): def __add__(self, other): return NotImplemented self.assertEqual(C(5L), 5) try: C() + "" except TypeError: pass else: self.fail("NotImplemented should have caused TypeError") try: C(sys.maxint+1) except OverflowError: pass else: self.fail("should have raised OverflowError") def test_longs(self): # Testing long operations... self.number_operators(100L, 3L) def test_floats(self): # Testing float operations... self.number_operators(100.0, 3.0) def test_complexes(self): # Testing complex operations... self.number_operators(100.0j, 3.0j, skip=['lt', 'le', 'gt', 'ge', 'int', 'long', 'float']) class Number(complex): __slots__ = ['prec'] def __new__(cls, *args, **kwds): result = complex.__new__(cls, *args) result.prec = kwds.get('prec', 12) return result def __repr__(self): prec = self.prec if self.imag == 0.0: return "%.*g" % (prec, self.real) if self.real == 0.0: return "%.*gj" % (prec, self.imag) return "(%.*g+%.*gj)" % (prec, self.real, prec, self.imag) __str__ = __repr__ a = Number(3.14, prec=6) self.assertEqual(repr(a), "3.14") self.assertEqual(a.prec, 6) a = Number(a, prec=2) self.assertEqual(repr(a), "3.1") self.assertEqual(a.prec, 2) a = Number(234.5) self.assertEqual(repr(a), "234.5") self.assertEqual(a.prec, 12) @test_support.impl_detail("the module 'xxsubtype' is internal") def test_spam_lists(self): # Testing spamlist operations... import copy, xxsubtype as spam def spamlist(l, memo=None): import xxsubtype as spam return spam.spamlist(l) # This is an ugly hack: copy._deepcopy_dispatch[spam.spamlist] = spamlist self.binop_test(spamlist([1]), spamlist([2]), spamlist([1,2]), "a+b", "__add__") self.binop_test(spamlist([1,2,3]), 2, 1, "b in a", "__contains__") self.binop_test(spamlist([1,2,3]), 4, 0, "b in a", "__contains__") self.binop_test(spamlist([1,2,3]), 1, 2, "a[b]", "__getitem__") self.ternop_test(spamlist([1,2,3]), 0, 2, spamlist([1,2]), "a[b:c]", "__getslice__") self.setop_test(spamlist([1]), spamlist([2]), spamlist([1,2]), "a+=b", "__iadd__") self.setop_test(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "a*=b", "__imul__") self.unop_test(spamlist([1,2,3]), 3, "len(a)", "__len__") self.binop_test(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "a*b", "__mul__") self.binop_test(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "b*a", "__rmul__") self.set2op_test(spamlist([1,2]), 1, 3, spamlist([1,3]), "a[b]=c", "__setitem__") self.set3op_test(spamlist([1,2,3,4]), 1, 3, spamlist([5,6]), spamlist([1,5,6,4]), "a[b:c]=d", "__setslice__") # Test subclassing class C(spam.spamlist): def foo(self): return 1 a = C() self.assertEqual(a, []) self.assertEqual(a.foo(), 1) a.append(100) self.assertEqual(a, [100]) self.assertEqual(a.getstate(), 0) a.setstate(42) self.assertEqual(a.getstate(), 42) @test_support.impl_detail("the module 'xxsubtype' is internal") def test_spam_dicts(self): # Testing spamdict operations... import copy, xxsubtype as spam def spamdict(d, memo=None): import xxsubtype as spam sd = spam.spamdict() for k, v in d.items(): sd[k] = v return sd # This is an ugly hack: copy._deepcopy_dispatch[spam.spamdict] = spamdict self.binop_test(spamdict({1:2}), spamdict({2:1}), -1, "cmp(a,b)", "__cmp__") self.binop_test(spamdict({1:2,3:4}), 1, 1, "b in a", "__contains__") self.binop_test(spamdict({1:2,3:4}), 2, 0, "b in a", "__contains__") self.binop_test(spamdict({1:2,3:4}), 1, 2, "a[b]", "__getitem__") d = spamdict({1:2,3:4}) l1 = [] for i in d.keys(): l1.append(i) l = [] for i in iter(d): l.append(i) self.assertEqual(l, l1) l = [] for i in d.__iter__(): l.append(i) self.assertEqual(l, l1) l = [] for i in type(spamdict({})).__iter__(d): l.append(i) self.assertEqual(l, l1) straightd = {1:2, 3:4} spamd = spamdict(straightd) self.unop_test(spamd, 2, "len(a)", "__len__") self.unop_test(spamd, repr(straightd), "repr(a)", "__repr__") self.set2op_test(spamdict({1:2,3:4}), 2, 3, spamdict({1:2,2:3,3:4}), "a[b]=c", "__setitem__") # Test subclassing class C(spam.spamdict): def foo(self): return 1 a = C() self.assertEqual(a.items(), []) self.assertEqual(a.foo(), 1) a['foo'] = 'bar' self.assertEqual(a.items(), [('foo', 'bar')]) self.assertEqual(a.getstate(), 0) a.setstate(100) self.assertEqual(a.getstate(), 100) class ClassPropertiesAndMethods(unittest.TestCase): def test_python_dicts(self): # Testing Python subclass of dict... self.assertTrue(issubclass(dict, dict)) self.assertIsInstance({}, dict) d = dict() self.assertEqual(d, {}) self.assertTrue(d.__class__ is dict) self.assertIsInstance(d, dict) class C(dict): state = -1 def __init__(self_local, *a, **kw): if a: self.assertEqual(len(a), 1) self_local.state = a[0] if kw: for k, v in kw.items(): self_local[v] = k def __getitem__(self, key): return self.get(key, 0) def __setitem__(self_local, key, value): self.assertIsInstance(key, type(0)) dict.__setitem__(self_local, key, value) def setstate(self, state): self.state = state def getstate(self): return self.state self.assertTrue(issubclass(C, dict)) a1 = C(12) self.assertEqual(a1.state, 12) a2 = C(foo=1, bar=2) self.assertEqual(a2[1] == 'foo' and a2[2], 'bar') a = C() self.assertEqual(a.state, -1) self.assertEqual(a.getstate(), -1) a.setstate(0) self.assertEqual(a.state, 0) self.assertEqual(a.getstate(), 0) a.setstate(10) self.assertEqual(a.state, 10) self.assertEqual(a.getstate(), 10) self.assertEqual(a[42], 0) a[42] = 24 self.assertEqual(a[42], 24) N = 50 for i in range(N): a[i] = C() for j in range(N): a[i][j] = i*j for i in range(N): for j in range(N): self.assertEqual(a[i][j], i*j) def test_python_lists(self): # Testing Python subclass of list... class C(list): def __getitem__(self, i): return list.__getitem__(self, i) + 100 def __getslice__(self, i, j): return (i, j) a = C() a.extend([0,1,2]) self.assertEqual(a[0], 100) self.assertEqual(a[1], 101) self.assertEqual(a[2], 102) self.assertEqual(a[100:200], (100,200)) def test_metaclass(self): # Testing __metaclass__... class C: __metaclass__ = type def __init__(self): self.__state = 0 def getstate(self): return self.__state def setstate(self, state): self.__state = state a = C() self.assertEqual(a.getstate(), 0) a.setstate(10) self.assertEqual(a.getstate(), 10) class D: class __metaclass__(type): def myself(cls): return cls self.assertEqual(D.myself(), D) d = D() self.assertEqual(d.__class__, D) class M1(type): def __new__(cls, name, bases, dict): dict['__spam__'] = 1 return type.__new__(cls, name, bases, dict) class C: __metaclass__ = M1 self.assertEqual(C.__spam__, 1) c = C() self.assertEqual(c.__spam__, 1) class _instance(object): pass class M2(object): @staticmethod def __new__(cls, name, bases, dict): self = object.__new__(cls) self.name = name self.bases = bases self.dict = dict return self def __call__(self): it = _instance() # Early binding of methods for key in self.dict: if key.startswith("__"): continue setattr(it, key, self.dict[key].__get__(it, self)) return it class C: __metaclass__ = M2 def spam(self): return 42 self.assertEqual(C.name, 'C') self.assertEqual(C.bases, ()) self.assertIn('spam', C.dict) c = C() self.assertEqual(c.spam(), 42) # More metaclass examples class autosuper(type): # Automatically add __super to the class # This trick only works for dynamic classes def __new__(metaclass, name, bases, dict): cls = super(autosuper, metaclass).__new__(metaclass, name, bases, dict) # Name mangling for __super removes leading underscores while name[:1] == "_": name = name[1:] if name: name = "_%s__super" % name else: name = "__super" setattr(cls, name, super(cls)) return cls class A: __metaclass__ = autosuper def meth(self): return "A" class B(A): def meth(self): return "B" + self.__super.meth() class C(A): def meth(self): return "C" + self.__super.meth() class D(C, B): def meth(self): return "D" + self.__super.meth() self.assertEqual(D().meth(), "DCBA") class E(B, C): def meth(self): return "E" + self.__super.meth() self.assertEqual(E().meth(), "EBCA") class autoproperty(type): # Automatically create property attributes when methods # named _get_x and/or _set_x are found def __new__(metaclass, name, bases, dict): hits = {} for key, val in dict.iteritems(): if key.startswith("_get_"): key = key[5:] get, set = hits.get(key, (None, None)) get = val hits[key] = get, set elif key.startswith("_set_"): key = key[5:] get, set = hits.get(key, (None, None)) set = val hits[key] = get, set for key, (get, set) in hits.iteritems(): dict[key] = property(get, set) return super(autoproperty, metaclass).__new__(metaclass, name, bases, dict) class A: __metaclass__ = autoproperty def _get_x(self): return -self.__x def _set_x(self, x): self.__x = -x a = A() self.assertTrue(not hasattr(a, "x")) a.x = 12 self.assertEqual(a.x, 12) self.assertEqual(a._A__x, -12) class multimetaclass(autoproperty, autosuper): # Merge of multiple cooperating metaclasses pass class A: __metaclass__ = multimetaclass def _get_x(self): return "A" class B(A): def _get_x(self): return "B" + self.__super._get_x() class C(A): def _get_x(self): return "C" + self.__super._get_x() class D(C, B): def _get_x(self): return "D" + self.__super._get_x() self.assertEqual(D().x, "DCBA") # Make sure type(x) doesn't call x.__class__.__init__ class T(type): counter = 0 def __init__(self, *args): T.counter += 1 class C: __metaclass__ = T self.assertEqual(T.counter, 1) a = C() self.assertEqual(type(a), C) self.assertEqual(T.counter, 1) class C(object): pass c = C() try: c() except TypeError: pass else: self.fail("calling object w/o call method should raise " "TypeError") # Testing code to find most derived baseclass class A(type): def __new__(*args, **kwargs): return type.__new__(*args, **kwargs) class B(object): pass class C(object): __metaclass__ = A # The most derived metaclass of D is A rather than type. class D(B, C): pass def test_module_subclasses(self): # Testing Python subclass of module... log = [] MT = type(sys) class MM(MT): def __init__(self, name): MT.__init__(self, name) def __getattribute__(self, name): log.append(("getattr", name)) return MT.__getattribute__(self, name) def __setattr__(self, name, value): log.append(("setattr", name, value)) MT.__setattr__(self, name, value) def __delattr__(self, name): log.append(("delattr", name)) MT.__delattr__(self, name) a = MM("a") a.foo = 12 x = a.foo del a.foo self.assertEqual(log, [("setattr", "foo", 12), ("getattr", "foo"), ("delattr", "foo")]) # http://python.org/sf/1174712 try: class Module(types.ModuleType, str): pass except TypeError: pass else: self.fail("inheriting from ModuleType and str at the same time " "should fail") def test_multiple_inheritence(self): # Testing multiple inheritance... class C(object): def __init__(self): self.__state = 0 def getstate(self): return self.__state def setstate(self, state): self.__state = state a = C() self.assertEqual(a.getstate(), 0) a.setstate(10) self.assertEqual(a.getstate(), 10) class D(dict, C): def __init__(self): type({}).__init__(self) C.__init__(self) d = D() self.assertEqual(d.keys(), []) d["hello"] = "world" self.assertEqual(d.items(), [("hello", "world")]) self.assertEqual(d["hello"], "world") self.assertEqual(d.getstate(), 0) d.setstate(10) self.assertEqual(d.getstate(), 10) self.assertEqual(D.__mro__, (D, dict, C, object)) # SF bug #442833 class Node(object): def __int__(self): return int(self.foo()) def foo(self): return "23" class Frag(Node, list): def foo(self): return "42" self.assertEqual(Node().__int__(), 23) self.assertEqual(int(Node()), 23) self.assertEqual(Frag().__int__(), 42) self.assertEqual(int(Frag()), 42) # MI mixing classic and new-style classes. class A: x = 1 class B(A): pass class C(A): x = 2 class D(B, C): pass self.assertEqual(D.x, 1) # Classic MRO is preserved for a classic base class. class E(D, object): pass self.assertEqual(E.__mro__, (E, D, B, A, C, object)) self.assertEqual(E.x, 1) # But with a mix of classic bases, their MROs are combined using # new-style MRO. class F(B, C, object): pass self.assertEqual(F.__mro__, (F, B, C, A, object)) self.assertEqual(F.x, 2) # Try something else. class C: def cmethod(self): return "C a" def all_method(self): return "C b" class M1(C, object): def m1method(self): return "M1 a" def all_method(self): return "M1 b" self.assertEqual(M1.__mro__, (M1, C, object)) m = M1() self.assertEqual(m.cmethod(), "C a") self.assertEqual(m.m1method(), "M1 a") self.assertEqual(m.all_method(), "M1 b") class D(C): def dmethod(self): return "D a" def all_method(self): return "D b" class M2(D, object): def m2method(self): return "M2 a" def all_method(self): return "M2 b" self.assertEqual(M2.__mro__, (M2, D, C, object)) m = M2() self.assertEqual(m.cmethod(), "C a") self.assertEqual(m.dmethod(), "D a") self.assertEqual(m.m2method(), "M2 a") self.assertEqual(m.all_method(), "M2 b") class M3(M1, M2, object): def m3method(self): return "M3 a" def all_method(self): return "M3 b" self.assertEqual(M3.__mro__, (M3, M1, M2, D, C, object)) m = M3() self.assertEqual(m.cmethod(), "C a") self.assertEqual(m.dmethod(), "D a") self.assertEqual(m.m1method(), "M1 a") self.assertEqual(m.m2method(), "M2 a") self.assertEqual(m.m3method(), "M3 a") self.assertEqual(m.all_method(), "M3 b") class Classic: pass try: class New(Classic): __metaclass__ = type except TypeError: pass else: self.fail("new class with only classic bases - shouldn't be") def test_diamond_inheritence(self): # Testing multiple inheritance special cases... class A(object): def spam(self): return "A" self.assertEqual(A().spam(), "A") class B(A): def boo(self): return "B" def spam(self): return "B" self.assertEqual(B().spam(), "B") self.assertEqual(B().boo(), "B") class C(A): def boo(self): return "C" self.assertEqual(C().spam(), "A") self.assertEqual(C().boo(), "C") class D(B, C): pass self.assertEqual(D().spam(), "B") self.assertEqual(D().boo(), "B") self.assertEqual(D.__mro__, (D, B, C, A, object)) class E(C, B): pass self.assertEqual(E().spam(), "B") self.assertEqual(E().boo(), "C") self.assertEqual(E.__mro__, (E, C, B, A, object)) # MRO order disagreement try: class F(D, E): pass except TypeError: pass else: self.fail("expected MRO order disagreement (F)") try: class G(E, D): pass except TypeError: pass else: self.fail("expected MRO order disagreement (G)") # see thread python-dev/2002-October/029035.html def test_ex5_from_c3_switch(self): # Testing ex5 from C3 switch discussion... class A(object): pass class B(object): pass class C(object): pass class X(A): pass class Y(A): pass class Z(X,B,Y,C): pass self.assertEqual(Z.__mro__, (Z, X, B, Y, A, C, object)) # see "A Monotonic Superclass Linearization for Dylan", # by Kim Barrett et al. (OOPSLA 1996) def test_monotonicity(self): # Testing MRO monotonicity... class Boat(object): pass class DayBoat(Boat): pass class WheelBoat(Boat): pass class EngineLess(DayBoat): pass class SmallMultihull(DayBoat): pass class PedalWheelBoat(EngineLess,WheelBoat): pass class SmallCatamaran(SmallMultihull): pass class Pedalo(PedalWheelBoat,SmallCatamaran): pass self.assertEqual(PedalWheelBoat.__mro__, (PedalWheelBoat, EngineLess, DayBoat, WheelBoat, Boat, object)) self.assertEqual(SmallCatamaran.__mro__, (SmallCatamaran, SmallMultihull, DayBoat, Boat, object)) self.assertEqual(Pedalo.__mro__, (Pedalo, PedalWheelBoat, EngineLess, SmallCatamaran, SmallMultihull, DayBoat, WheelBoat, Boat, object)) # see "A Monotonic Superclass Linearization for Dylan", # by Kim Barrett et al. (OOPSLA 1996) def test_consistency_with_epg(self): # Testing consistency with EPG... class Pane(object): pass class ScrollingMixin(object): pass class EditingMixin(object): pass class ScrollablePane(Pane,ScrollingMixin): pass class EditablePane(Pane,EditingMixin): pass class EditableScrollablePane(ScrollablePane,EditablePane): pass self.assertEqual(EditableScrollablePane.__mro__, (EditableScrollablePane, ScrollablePane, EditablePane, Pane, ScrollingMixin, EditingMixin, object)) def test_mro_disagreement(self): # Testing error messages for MRO disagreement... mro_err_msg = """Cannot create a consistent method resolution order (MRO) for bases """ def raises(exc, expected, callable, *args): try: callable(*args) except exc, msg: # the exact msg is generally considered an impl detail if test_support.check_impl_detail(): if not str(msg).startswith(expected): self.fail("Message %r, expected %r" % (str(msg), expected)) else: self.fail("Expected %s" % exc) class A(object): pass class B(A): pass class C(object): pass # Test some very simple errors raises(TypeError, "duplicate base class A", type, "X", (A, A), {}) raises(TypeError, mro_err_msg, type, "X", (A, B), {}) raises(TypeError, mro_err_msg, type, "X", (A, C, B), {}) # Test a slightly more complex error class GridLayout(object): pass class HorizontalGrid(GridLayout): pass class VerticalGrid(GridLayout): pass class HVGrid(HorizontalGrid, VerticalGrid): pass class VHGrid(VerticalGrid, HorizontalGrid): pass raises(TypeError, mro_err_msg, type, "ConfusedGrid", (HVGrid, VHGrid), {}) def test_object_class(self): # Testing object class... a = object() self.assertEqual(a.__class__, object) self.assertEqual(type(a), object) b = object() self.assertNotEqual(a, b) self.assertFalse(hasattr(a, "foo")) try: a.foo = 12 except (AttributeError, TypeError): pass else: self.fail("object() should not allow setting a foo attribute") self.assertFalse(hasattr(object(), "__dict__")) class Cdict(object): pass x = Cdict() self.assertEqual(x.__dict__, {}) x.foo = 1 self.assertEqual(x.foo, 1) self.assertEqual(x.__dict__, {'foo': 1}) def test_slots(self): # Testing __slots__... class C0(object): __slots__ = [] x = C0() self.assertFalse(hasattr(x, "__dict__")) self.assertFalse(hasattr(x, "foo")) class C1(object): __slots__ = ['a'] x = C1() self.assertFalse(hasattr(x, "__dict__")) self.assertFalse(hasattr(x, "a")) x.a = 1 self.assertEqual(x.a, 1) x.a = None self.assertEqual(x.a, None) del x.a self.assertFalse(hasattr(x, "a")) class C3(object): __slots__ = ['a', 'b', 'c'] x = C3() self.assertFalse(hasattr(x, "__dict__")) self.assertFalse(hasattr(x, 'a')) self.assertFalse(hasattr(x, 'b')) self.assertFalse(hasattr(x, 'c')) x.a = 1 x.b = 2 x.c = 3 self.assertEqual(x.a, 1) self.assertEqual(x.b, 2) self.assertEqual(x.c, 3) class C4(object): """Validate name mangling""" __slots__ = ['__a'] def __init__(self, value): self.__a = value def get(self): return self.__a x = C4(5) self.assertFalse(hasattr(x, '__dict__')) self.assertFalse(hasattr(x, '__a')) self.assertEqual(x.get(), 5) try: x.__a = 6 except AttributeError: pass else: self.fail("Double underscored names not mangled") # Make sure slot names are proper identifiers try: class C(object): __slots__ = [None] except TypeError: pass else: self.fail("[None] slots not caught") try: class C(object): __slots__ = ["foo bar"] except TypeError: pass else: self.fail("['foo bar'] slots not caught") try: class C(object): __slots__ = ["foo\0bar"] except TypeError: pass else: self.fail("['foo\\0bar'] slots not caught") try: class C(object): __slots__ = ["1"] except TypeError: pass else: self.fail("['1'] slots not caught") try: class C(object): __slots__ = [""] except TypeError: pass else: self.fail("[''] slots not caught") class C(object): __slots__ = ["a", "a_b", "_a", "A0123456789Z"] # XXX(nnorwitz): was there supposed to be something tested # from the class above? # Test a single string is not expanded as a sequence. class C(object): __slots__ = "abc" c = C() c.abc = 5 self.assertEqual(c.abc, 5) # Test unicode slot names try: unicode except NameError: pass else: # Test a single unicode string is not expanded as a sequence. class C(object): __slots__ = unicode("abc") c = C() c.abc = 5 self.assertEqual(c.abc, 5) # _unicode_to_string used to modify slots in certain circumstances slots = (unicode("foo"), unicode("bar")) class C(object): __slots__ = slots x = C() x.foo = 5 self.assertEqual(x.foo, 5) self.assertEqual(type(slots[0]), unicode) # this used to leak references try: class C(object): __slots__ = [unichr(128)] except (TypeError, UnicodeEncodeError): pass else: self.fail("[unichr(128)] slots not caught") # Test leaks class Counted(object): counter = 0 # counts the number of instances alive def __init__(self): Counted.counter += 1 def __del__(self): Counted.counter -= 1 class C(object): __slots__ = ['a', 'b', 'c'] x = C() x.a = Counted() x.b = Counted() x.c = Counted() self.assertEqual(Counted.counter, 3) del x test_support.gc_collect() self.assertEqual(Counted.counter, 0) class D(C): pass x = D() x.a = Counted() x.z = Counted() self.assertEqual(Counted.counter, 2) del x test_support.gc_collect() self.assertEqual(Counted.counter, 0) class E(D): __slots__ = ['e'] x = E() x.a = Counted() x.z = Counted() x.e = Counted() self.assertEqual(Counted.counter, 3) del x test_support.gc_collect() self.assertEqual(Counted.counter, 0) # Test cyclical leaks [SF bug 519621] class F(object): __slots__ = ['a', 'b'] s = F() s.a = [Counted(), s] self.assertEqual(Counted.counter, 1) s = None test_support.gc_collect() self.assertEqual(Counted.counter, 0) # Test lookup leaks [SF bug 572567] import gc if test_support.check_impl_detail(): class G(object): def __cmp__(self, other): return 0 __hash__ = None # Silence Py3k warning g = G() orig_objects = len(gc.get_objects()) for i in xrange(10): g==g new_objects = len(gc.get_objects()) self.assertEqual(orig_objects, new_objects) class H(object): __slots__ = ['a', 'b'] def __init__(self): self.a = 1 self.b = 2 def __del__(self_): self.assertEqual(self_.a, 1) self.assertEqual(self_.b, 2) with test_support.captured_output('stderr') as s: h = H() del h self.assertEqual(s.getvalue(), '') class X(object): __slots__ = "a" with self.assertRaises(AttributeError): del X().a def test_slots_special(self): # Testing __dict__ and __weakref__ in __slots__... class D(object): __slots__ = ["__dict__"] a = D() self.assertTrue(hasattr(a, "__dict__")) self.assertFalse(hasattr(a, "__weakref__")) a.foo = 42 self.assertEqual(a.__dict__, {"foo": 42}) class W(object): __slots__ = ["__weakref__"] a = W() self.assertTrue(hasattr(a, "__weakref__")) self.assertFalse(hasattr(a, "__dict__")) try: a.foo = 42 except AttributeError: pass else: self.fail("shouldn't be allowed to set a.foo") class C1(W, D): __slots__ = [] a = C1() self.assertTrue(hasattr(a, "__dict__")) self.assertTrue(hasattr(a, "__weakref__")) a.foo = 42 self.assertEqual(a.__dict__, {"foo": 42}) class C2(D, W): __slots__ = [] a = C2() self.assertTrue(hasattr(a, "__dict__")) self.assertTrue(hasattr(a, "__weakref__")) a.foo = 42 self.assertEqual(a.__dict__, {"foo": 42}) def test_slots_descriptor(self): # Issue2115: slot descriptors did not correctly check # the type of the given object import abc class MyABC: __metaclass__ = abc.ABCMeta __slots__ = "a" class Unrelated(object): pass MyABC.register(Unrelated) u = Unrelated() self.assertIsInstance(u, MyABC) # This used to crash self.assertRaises(TypeError, MyABC.a.__set__, u, 3) def test_metaclass_cmp(self): # See bug 7491. class M(type): def __cmp__(self, other): return -1 class X(object): __metaclass__ = M self.assertTrue(X < M) def test_dynamics(self): # Testing class attribute propagation... class D(object): pass class E(D): pass class F(D): pass D.foo = 1 self.assertEqual(D.foo, 1) # Test that dynamic attributes are inherited self.assertEqual(E.foo, 1) self.assertEqual(F.foo, 1) # Test dynamic instances class C(object): pass a = C() self.assertFalse(hasattr(a, "foobar")) C.foobar = 2 self.assertEqual(a.foobar, 2) C.method = lambda self: 42 self.assertEqual(a.method(), 42) C.__repr__ = lambda self: "C()" self.assertEqual(repr(a), "C()") C.__int__ = lambda self: 100 self.assertEqual(int(a), 100) self.assertEqual(a.foobar, 2) self.assertFalse(hasattr(a, "spam")) def mygetattr(self, name): if name == "spam": return "spam" raise AttributeError C.__getattr__ = mygetattr self.assertEqual(a.spam, "spam") a.new = 12 self.assertEqual(a.new, 12) def mysetattr(self, name, value): if name == "spam": raise AttributeError return object.__setattr__(self, name, value) C.__setattr__ = mysetattr try: a.spam = "not spam" except AttributeError: pass else: self.fail("expected AttributeError") self.assertEqual(a.spam, "spam") class D(C): pass d = D() d.foo = 1 self.assertEqual(d.foo, 1) # Test handling of int*seq and seq*int class I(int): pass self.assertEqual("a"*I(2), "aa") self.assertEqual(I(2)*"a", "aa") self.assertEqual(2*I(3), 6) self.assertEqual(I(3)*2, 6) self.assertEqual(I(3)*I(2), 6) # Test handling of long*seq and seq*long class L(long): pass self.assertEqual("a"*L(2L), "aa") self.assertEqual(L(2L)*"a", "aa") self.assertEqual(2*L(3), 6) self.assertEqual(L(3)*2, 6) self.assertEqual(L(3)*L(2), 6) # Test comparison of classes with dynamic metaclasses class dynamicmetaclass(type): pass class someclass: __metaclass__ = dynamicmetaclass self.assertNotEqual(someclass, object) def test_errors(self): # Testing errors... try: class C(list, dict): pass except TypeError: pass else: self.fail("inheritance from both list and dict should be illegal") try: class C(object, None): pass except TypeError: pass else: self.fail("inheritance from non-type should be illegal") class Classic: pass try: class C(type(len)): pass except TypeError: pass else: self.fail("inheritance from CFunction should be illegal") try: class C(object): __slots__ = 1 except TypeError: pass else: self.fail("__slots__ = 1 should be illegal") try: class C(object): __slots__ = [1] except TypeError: pass else: self.fail("__slots__ = [1] should be illegal") class M1(type): pass class M2(type): pass class A1(object): __metaclass__ = M1 class A2(object): __metaclass__ = M2 try: class B(A1, A2): pass except TypeError: pass else: self.fail("finding the most derived metaclass should have failed") def test_classmethods(self): # Testing class methods... class C(object): def foo(*a): return a goo = classmethod(foo) c = C() self.assertEqual(C.goo(1), (C, 1)) self.assertEqual(c.goo(1), (C, 1)) self.assertEqual(c.foo(1), (c, 1)) class D(C): pass d = D() self.assertEqual(D.goo(1), (D, 1)) self.assertEqual(d.goo(1), (D, 1)) self.assertEqual(d.foo(1), (d, 1)) self.assertEqual(D.foo(d, 1), (d, 1)) # Test for a specific crash (SF bug 528132) def f(cls, arg): return (cls, arg) ff = classmethod(f) self.assertEqual(ff.__get__(0, int)(42), (int, 42)) self.assertEqual(ff.__get__(0)(42), (int, 42)) # Test super() with classmethods (SF bug 535444) self.assertEqual(C.goo.im_self, C) self.assertEqual(D.goo.im_self, D) self.assertEqual(super(D,D).goo.im_self, D) self.assertEqual(super(D,d).goo.im_self, D) self.assertEqual(super(D,D).goo(), (D,)) self.assertEqual(super(D,d).goo(), (D,)) # Verify that a non-callable will raise meth = classmethod(1).__get__(1) self.assertRaises(TypeError, meth) # Verify that classmethod() doesn't allow keyword args try: classmethod(f, kw=1) except TypeError: pass else: self.fail("classmethod shouldn't accept keyword args") @test_support.impl_detail("the module 'xxsubtype' is internal") def test_classmethods_in_c(self): # Testing C-based class methods... import xxsubtype as spam a = (1, 2, 3) d = {'abc': 123} x, a1, d1 = spam.spamlist.classmeth(*a, **d) self.assertEqual(x, spam.spamlist) self.assertEqual(a, a1) self.assertEqual(d, d1) x, a1, d1 = spam.spamlist().classmeth(*a, **d) self.assertEqual(x, spam.spamlist) self.assertEqual(a, a1) self.assertEqual(d, d1) def test_staticmethods(self): # Testing static methods... class C(object): def foo(*a): return a goo = staticmethod(foo) c = C() self.assertEqual(C.goo(1), (1,)) self.assertEqual(c.goo(1), (1,)) self.assertEqual(c.foo(1), (c, 1,)) class D(C): pass d = D() self.assertEqual(D.goo(1), (1,)) self.assertEqual(d.goo(1), (1,)) self.assertEqual(d.foo(1), (d, 1)) self.assertEqual(D.foo(d, 1), (d, 1)) @test_support.impl_detail("the module 'xxsubtype' is internal") def test_staticmethods_in_c(self): # Testing C-based static methods... import xxsubtype as spam a = (1, 2, 3) d = {"abc": 123} x, a1, d1 = spam.spamlist.staticmeth(*a, **d) self.assertEqual(x, None) self.assertEqual(a, a1) self.assertEqual(d, d1) x, a1, d2 = spam.spamlist().staticmeth(*a, **d) self.assertEqual(x, None) self.assertEqual(a, a1) self.assertEqual(d, d1) def test_classic(self): # Testing classic classes... class C: def foo(*a): return a goo = classmethod(foo) c = C() self.assertEqual(C.goo(1), (C, 1)) self.assertEqual(c.goo(1), (C, 1)) self.assertEqual(c.foo(1), (c, 1)) class D(C): pass d = D() self.assertEqual(D.goo(1), (D, 1)) self.assertEqual(d.goo(1), (D, 1)) self.assertEqual(d.foo(1), (d, 1)) self.assertEqual(D.foo(d, 1), (d, 1)) class E: # *not* subclassing from C foo = C.foo self.assertEqual(E().foo, C.foo) # i.e., unbound self.assertTrue(repr(C.foo.__get__(C())).startswith("<bound method ")) def test_compattr(self): # Testing computed attributes... class C(object): class computed_attribute(object): def __init__(self, get, set=None, delete=None): self.__get = get self.__set = set self.__delete = delete def __get__(self, obj, type=None): return self.__get(obj) def __set__(self, obj, value): return self.__set(obj, value) def __delete__(self, obj): return self.__delete(obj) def __init__(self): self.__x = 0 def __get_x(self): x = self.__x self.__x = x+1 return x def __set_x(self, x): self.__x = x def __delete_x(self): del self.__x x = computed_attribute(__get_x, __set_x, __delete_x) a = C() self.assertEqual(a.x, 0) self.assertEqual(a.x, 1) a.x = 10 self.assertEqual(a.x, 10) self.assertEqual(a.x, 11) del a.x self.assertEqual(hasattr(a, 'x'), 0) def test_newslots(self): # Testing __new__ slot override... class C(list): def __new__(cls): self = list.__new__(cls) self.foo = 1 return self def __init__(self): self.foo = self.foo + 2 a = C() self.assertEqual(a.foo, 3) self.assertEqual(a.__class__, C) class D(C): pass b = D() self.assertEqual(b.foo, 3) self.assertEqual(b.__class__, D) def test_altmro(self): # Testing mro() and overriding it... class A(object): def f(self): return "A" class B(A): pass class C(A): def f(self): return "C" class D(B, C): pass self.assertEqual(D.mro(), [D, B, C, A, object]) self.assertEqual(D.__mro__, (D, B, C, A, object)) self.assertEqual(D().f(), "C") class PerverseMetaType(type): def mro(cls): L = type.mro(cls) L.reverse() return L class X(D,B,C,A): __metaclass__ = PerverseMetaType self.assertEqual(X.__mro__, (object, A, C, B, D, X)) self.assertEqual(X().f(), "A") try: class X(object): class __metaclass__(type): def mro(self): return [self, dict, object] # In CPython, the class creation above already raises # TypeError, as a protection against the fact that # instances of X would segfault it. In other Python # implementations it would be ok to let the class X # be created, but instead get a clean TypeError on the # __setitem__ below. x = object.__new__(X) x[5] = 6 except TypeError: pass else: self.fail("devious mro() return not caught") try: class X(object): class __metaclass__(type): def mro(self): return [1] except TypeError: pass else: self.fail("non-class mro() return not caught") try: class X(object): class __metaclass__(type): def mro(self): return 1 except TypeError: pass else: self.fail("non-sequence mro() return not caught") def test_overloading(self): # Testing operator overloading... class B(object): "Intermediate class because object doesn't have a __setattr__" class C(B): def __getattr__(self, name): if name == "foo": return ("getattr", name) else: raise AttributeError def __setattr__(self, name, value): if name == "foo": self.setattr = (name, value) else: return B.__setattr__(self, name, value) def __delattr__(self, name): if name == "foo": self.delattr = name else: return B.__delattr__(self, name) def __getitem__(self, key): return ("getitem", key) def __setitem__(self, key, value): self.setitem = (key, value) def __delitem__(self, key): self.delitem = key def __getslice__(self, i, j): return ("getslice", i, j) def __setslice__(self, i, j, value): self.setslice = (i, j, value) def __delslice__(self, i, j): self.delslice = (i, j) a = C() self.assertEqual(a.foo, ("getattr", "foo")) a.foo = 12 self.assertEqual(a.setattr, ("foo", 12)) del a.foo self.assertEqual(a.delattr, "foo") self.assertEqual(a[12], ("getitem", 12)) a[12] = 21 self.assertEqual(a.setitem, (12, 21)) del a[12] self.assertEqual(a.delitem, 12) self.assertEqual(a[0:10], ("getslice", 0, 10)) a[0:10] = "foo" self.assertEqual(a.setslice, (0, 10, "foo")) del a[0:10] self.assertEqual(a.delslice, (0, 10)) def test_methods(self): # Testing methods... class C(object): def __init__(self, x): self.x = x def foo(self): return self.x c1 = C(1) self.assertEqual(c1.foo(), 1) class D(C): boo = C.foo goo = c1.foo d2 = D(2) self.assertEqual(d2.foo(), 2) self.assertEqual(d2.boo(), 2) self.assertEqual(d2.goo(), 1) class E(object): foo = C.foo self.assertEqual(E().foo, C.foo) # i.e., unbound self.assertTrue(repr(C.foo.__get__(C(1))).startswith("<bound method ")) def test_special_method_lookup(self): # The lookup of special methods bypasses __getattr__ and # __getattribute__, but they still can be descriptors. def run_context(manager): with manager: pass def iden(self): return self def hello(self): return "hello" def empty_seq(self): return [] def zero(self): return 0 def complex_num(self): return 1j def stop(self): raise StopIteration def return_true(self, thing=None): return True def do_isinstance(obj): return isinstance(int, obj) def do_issubclass(obj): return issubclass(int, obj) def swallow(*args): pass def do_dict_missing(checker): class DictSub(checker.__class__, dict): pass self.assertEqual(DictSub()["hi"], 4) def some_number(self_, key): self.assertEqual(key, "hi") return 4 def format_impl(self, spec): return "hello" # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it # does it right. specials = [ ("__unicode__", unicode, hello, set(), {}), ("__reversed__", reversed, empty_seq, set(), {}), ("__length_hint__", list, zero, set(), {"__iter__" : iden, "next" : stop}), ("__sizeof__", sys.getsizeof, zero, set(), {}), ("__instancecheck__", do_isinstance, return_true, set(), {}), ("__missing__", do_dict_missing, some_number, set(("__class__",)), {}), ("__subclasscheck__", do_issubclass, return_true, set(("__bases__",)), {}), ("__enter__", run_context, iden, set(), {"__exit__" : swallow}), ("__exit__", run_context, swallow, set(), {"__enter__" : iden}), ("__complex__", complex, complex_num, set(), {}), ("__format__", format, format_impl, set(), {}), ("__dir__", dir, empty_seq, set(), {}), ] class Checker(object): def __getattr__(self, attr, test=self): test.fail("__getattr__ called with {0}".format(attr)) def __getattribute__(self, attr, test=self): if attr not in ok: test.fail("__getattribute__ called with {0}".format(attr)) return object.__getattribute__(self, attr) class SpecialDescr(object): def __init__(self, impl): self.impl = impl def __get__(self, obj, owner): record.append(1) return self.impl.__get__(obj, owner) class MyException(Exception): pass class ErrDescr(object): def __get__(self, obj, owner): raise MyException for name, runner, meth_impl, ok, env in specials: if name == '__length_hint__' or name == '__sizeof__': if not test_support.check_impl_detail(): continue class X(Checker): pass for attr, obj in env.iteritems(): setattr(X, attr, obj) setattr(X, name, meth_impl) runner(X()) record = [] class X(Checker): pass for attr, obj in env.iteritems(): setattr(X, attr, obj) setattr(X, name, SpecialDescr(meth_impl)) runner(X()) self.assertEqual(record, [1], name) class X(Checker): pass for attr, obj in env.iteritems(): setattr(X, attr, obj) setattr(X, name, ErrDescr()) try: runner(X()) except MyException: pass else: self.fail("{0!r} didn't raise".format(name)) def test_specials(self): # Testing special operators... # Test operators like __hash__ for which a built-in default exists # Test the default behavior for static classes class C(object): def __getitem__(self, i): if 0 <= i < 10: return i raise IndexError c1 = C() c2 = C() self.assertTrue(not not c1) # What? self.assertNotEqual(id(c1), id(c2)) hash(c1) hash(c2) self.assertEqual(cmp(c1, c2), cmp(id(c1), id(c2))) self.assertEqual(c1, c1) self.assertTrue(c1 != c2) self.assertTrue(not c1 != c1) self.assertTrue(not c1 == c2) # Note that the module name appears in str/repr, and that varies # depending on whether this test is run standalone or from a framework. self.assertTrue(str(c1).find('C object at ') >= 0) self.assertEqual(str(c1), repr(c1)) self.assertNotIn(-1, c1) for i in range(10): self.assertIn(i, c1) self.assertNotIn(10, c1) # Test the default behavior for dynamic classes class D(object): def __getitem__(self, i): if 0 <= i < 10: return i raise IndexError d1 = D() d2 = D() self.assertTrue(not not d1) self.assertNotEqual(id(d1), id(d2)) hash(d1) hash(d2) self.assertEqual(cmp(d1, d2), cmp(id(d1), id(d2))) self.assertEqual(d1, d1) self.assertNotEqual(d1, d2) self.assertTrue(not d1 != d1) self.assertTrue(not d1 == d2) # Note that the module name appears in str/repr, and that varies # depending on whether this test is run standalone or from a framework. self.assertTrue(str(d1).find('D object at ') >= 0) self.assertEqual(str(d1), repr(d1)) self.assertNotIn(-1, d1) for i in range(10): self.assertIn(i, d1) self.assertNotIn(10, d1) # Test overridden behavior for static classes class Proxy(object): def __init__(self, x): self.x = x def __nonzero__(self): return not not self.x def __hash__(self): return hash(self.x) def __eq__(self, other): return self.x == other def __ne__(self, other): return self.x != other def __cmp__(self, other): return cmp(self.x, other.x) def __str__(self): return "Proxy:%s" % self.x def __repr__(self): return "Proxy(%r)" % self.x def __contains__(self, value): return value in self.x p0 = Proxy(0) p1 = Proxy(1) p_1 = Proxy(-1) self.assertFalse(p0) self.assertTrue(not not p1) self.assertEqual(hash(p0), hash(0)) self.assertEqual(p0, p0) self.assertNotEqual(p0, p1) self.assertTrue(not p0 != p0) self.assertEqual(not p0, p1) self.assertEqual(cmp(p0, p1), -1) self.assertEqual(cmp(p0, p0), 0) self.assertEqual(cmp(p0, p_1), 1) self.assertEqual(str(p0), "Proxy:0") self.assertEqual(repr(p0), "Proxy(0)") p10 = Proxy(range(10)) self.assertNotIn(-1, p10) for i in range(10): self.assertIn(i, p10) self.assertNotIn(10, p10) # Test overridden behavior for dynamic classes class DProxy(object): def __init__(self, x): self.x = x def __nonzero__(self): return not not self.x def __hash__(self): return hash(self.x) def __eq__(self, other): return self.x == other def __ne__(self, other): return self.x != other def __cmp__(self, other): return cmp(self.x, other.x) def __str__(self): return "DProxy:%s" % self.x def __repr__(self): return "DProxy(%r)" % self.x def __contains__(self, value): return value in self.x p0 = DProxy(0) p1 = DProxy(1) p_1 = DProxy(-1) self.assertFalse(p0) self.assertTrue(not not p1) self.assertEqual(hash(p0), hash(0)) self.assertEqual(p0, p0) self.assertNotEqual(p0, p1) self.assertNotEqual(not p0, p0) self.assertEqual(not p0, p1) self.assertEqual(cmp(p0, p1), -1) self.assertEqual(cmp(p0, p0), 0) self.assertEqual(cmp(p0, p_1), 1) self.assertEqual(str(p0), "DProxy:0") self.assertEqual(repr(p0), "DProxy(0)") p10 = DProxy(range(10)) self.assertNotIn(-1, p10) for i in range(10): self.assertIn(i, p10) self.assertNotIn(10, p10) # Safety test for __cmp__ def unsafecmp(a, b): if not hasattr(a, '__cmp__'): return # some types don't have a __cmp__ any more (so the # test doesn't make sense any more), or maybe they # never had a __cmp__ at all, e.g. in PyPy try: a.__class__.__cmp__(a, b) except TypeError: pass else: self.fail("shouldn't allow %s.__cmp__(%r, %r)" % ( a.__class__, a, b)) unsafecmp(u"123", "123") unsafecmp("123", u"123") unsafecmp(1, 1.0) unsafecmp(1.0, 1) unsafecmp(1, 1L) unsafecmp(1L, 1) @test_support.impl_detail("custom logic for printing to real file objects") def test_recursions_1(self): # Testing recursion checks ... class Letter(str): def __new__(cls, letter): if letter == 'EPS': return str.__new__(cls) return str.__new__(cls, letter) def __str__(self): if not self: return 'EPS' return self # sys.stdout needs to be the original to trigger the recursion bug test_stdout = sys.stdout sys.stdout = test_support.get_original_stdout() try: # nothing should actually be printed, this should raise an exception print Letter('w') except RuntimeError: pass else: self.fail("expected a RuntimeError for print recursion") finally: sys.stdout = test_stdout def test_recursions_2(self): # Bug #1202533. class A(object): pass A.__mul__ = types.MethodType(lambda self, x: self * x, None, A) try: A()*2 except RuntimeError: pass else: self.fail("expected a RuntimeError") def test_weakrefs(self): # Testing weak references... import weakref class C(object): pass c = C() r = weakref.ref(c) self.assertEqual(r(), c) del c test_support.gc_collect() self.assertEqual(r(), None) del r class NoWeak(object): __slots__ = ['foo'] no = NoWeak() try: weakref.ref(no) except TypeError, msg: self.assertTrue(str(msg).find("weak reference") >= 0) else: if test_support.check_impl_detail(pypy=False): self.fail("weakref.ref(no) should be illegal") #else: pypy supports taking weakrefs to some more objects class Weak(object): __slots__ = ['foo', '__weakref__'] yes = Weak() r = weakref.ref(yes) self.assertEqual(r(), yes) del yes test_support.gc_collect() self.assertEqual(r(), None) del r def test_properties(self): # Testing property... class C(object): def getx(self): return self.__x def setx(self, value): self.__x = value def delx(self): del self.__x x = property(getx, setx, delx, doc="I'm the x property.") a = C() self.assertFalse(hasattr(a, "x")) a.x = 42 self.assertEqual(a._C__x, 42) self.assertEqual(a.x, 42) del a.x self.assertFalse(hasattr(a, "x")) self.assertFalse(hasattr(a, "_C__x")) C.x.__set__(a, 100) self.assertEqual(C.x.__get__(a), 100) C.x.__delete__(a) self.assertFalse(hasattr(a, "x")) raw = C.__dict__['x'] self.assertIsInstance(raw, property) attrs = dir(raw) self.assertIn("__doc__", attrs) self.assertIn("fget", attrs) self.assertIn("fset", attrs) self.assertIn("fdel", attrs) self.assertEqual(raw.__doc__, "I'm the x property.") self.assertTrue(raw.fget is C.__dict__['getx']) self.assertTrue(raw.fset is C.__dict__['setx']) self.assertTrue(raw.fdel is C.__dict__['delx']) for attr in "__doc__", "fget", "fset", "fdel": try: setattr(raw, attr, 42) except TypeError, msg: if str(msg).find('readonly') < 0: self.fail("when setting readonly attr %r on a property, " "got unexpected TypeError msg %r" % (attr, str(msg))) else: self.fail("expected TypeError from trying to set readonly %r " "attr on a property" % attr) class D(object): __getitem__ = property(lambda s: 1/0) d = D() try: for i in d: str(i) except ZeroDivisionError: pass else: self.fail("expected ZeroDivisionError from bad property") @unittest.skipIf(sys.flags.optimize >= 2, "Docstrings are omitted with -O2 and above") def test_properties_doc_attrib(self): class E(object): def getter(self): "getter method" return 0 def setter(self_, value): "setter method" pass prop = property(getter) self.assertEqual(prop.__doc__, "getter method") prop2 = property(fset=setter) self.assertEqual(prop2.__doc__, None) def test_testcapi_no_segfault(self): # this segfaulted in 2.5b2 try: import _testcapi except ImportError: pass else: class X(object): p = property(_testcapi.test_with_docstring) def test_properties_plus(self): class C(object): foo = property(doc="hello") @foo.getter def foo(self): return self._foo @foo.setter def foo(self, value): self._foo = abs(value) @foo.deleter def foo(self): del self._foo c = C() self.assertEqual(C.foo.__doc__, "hello") self.assertFalse(hasattr(c, "foo")) c.foo = -42 self.assertTrue(hasattr(c, '_foo')) self.assertEqual(c._foo, 42) self.assertEqual(c.foo, 42) del c.foo self.assertFalse(hasattr(c, '_foo')) self.assertFalse(hasattr(c, "foo")) class D(C): @C.foo.deleter def foo(self): try: del self._foo except AttributeError: pass d = D() d.foo = 24 self.assertEqual(d.foo, 24) del d.foo del d.foo class E(object): @property def foo(self): return self._foo @foo.setter def foo(self, value): raise RuntimeError @foo.setter def foo(self, value): self._foo = abs(value) @foo.deleter def foo(self, value=None): del self._foo e = E() e.foo = -42 self.assertEqual(e.foo, 42) del e.foo class F(E): @E.foo.deleter def foo(self): del self._foo @foo.setter def foo(self, value): self._foo = max(0, value) f = F() f.foo = -10 self.assertEqual(f.foo, 0) del f.foo def test_dict_constructors(self): # Testing dict constructor ... d = dict() self.assertEqual(d, {}) d = dict({}) self.assertEqual(d, {}) d = dict({1: 2, 'a': 'b'}) self.assertEqual(d, {1: 2, 'a': 'b'}) self.assertEqual(d, dict(d.items())) self.assertEqual(d, dict(d.iteritems())) d = dict({'one':1, 'two':2}) self.assertEqual(d, dict(one=1, two=2)) self.assertEqual(d, dict(**d)) self.assertEqual(d, dict({"one": 1}, two=2)) self.assertEqual(d, dict([("two", 2)], one=1)) self.assertEqual(d, dict([("one", 100), ("two", 200)], **d)) self.assertEqual(d, dict(**d)) for badarg in 0, 0L, 0j, "0", [0], (0,): try: dict(badarg) except TypeError: pass except ValueError: if badarg == "0": # It's a sequence, and its elements are also sequences (gotta # love strings <wink>), but they aren't of length 2, so this # one seemed better as a ValueError than a TypeError. pass else: self.fail("no TypeError from dict(%r)" % badarg) else: self.fail("no TypeError from dict(%r)" % badarg) try: dict({}, {}) except TypeError: pass else: self.fail("no TypeError from dict({}, {})") class Mapping: # Lacks a .keys() method; will be added later. dict = {1:2, 3:4, 'a':1j} try: dict(Mapping()) except TypeError: pass else: self.fail("no TypeError from dict(incomplete mapping)") Mapping.keys = lambda self: self.dict.keys() Mapping.__getitem__ = lambda self, i: self.dict[i] d = dict(Mapping()) self.assertEqual(d, Mapping.dict) # Init from sequence of iterable objects, each producing a 2-sequence. class AddressBookEntry: def __init__(self, first, last): self.first = first self.last = last def __iter__(self): return iter([self.first, self.last]) d = dict([AddressBookEntry('Tim', 'Warsaw'), AddressBookEntry('Barry', 'Peters'), AddressBookEntry('Tim', 'Peters'), AddressBookEntry('Barry', 'Warsaw')]) self.assertEqual(d, {'Barry': 'Warsaw', 'Tim': 'Peters'}) d = dict(zip(range(4), range(1, 5))) self.assertEqual(d, dict([(i, i+1) for i in range(4)])) # Bad sequence lengths. for bad in [('tooshort',)], [('too', 'long', 'by 1')]: try: dict(bad) except ValueError: pass else: self.fail("no ValueError from dict(%r)" % bad) def test_dir(self): # Testing dir() ... junk = 12 self.assertEqual(dir(), ['junk', 'self']) del junk # Just make sure these don't blow up! for arg in 2, 2L, 2j, 2e0, [2], "2", u"2", (2,), {2:2}, type, self.test_dir: dir(arg) # Try classic classes. class C: Cdata = 1 def Cmethod(self): pass cstuff = ['Cdata', 'Cmethod', '__doc__', '__module__'] self.assertEqual(dir(C), cstuff) self.assertIn('im_self', dir(C.Cmethod)) c = C() # c.__doc__ is an odd thing to see here; ditto c.__module__. self.assertEqual(dir(c), cstuff) c.cdata = 2 c.cmethod = lambda self: 0 self.assertEqual(dir(c), cstuff + ['cdata', 'cmethod']) self.assertIn('im_self', dir(c.Cmethod)) class A(C): Adata = 1 def Amethod(self): pass astuff = ['Adata', 'Amethod'] + cstuff self.assertEqual(dir(A), astuff) self.assertIn('im_self', dir(A.Amethod)) a = A() self.assertEqual(dir(a), astuff) self.assertIn('im_self', dir(a.Amethod)) a.adata = 42 a.amethod = lambda self: 3 self.assertEqual(dir(a), astuff + ['adata', 'amethod']) # The same, but with new-style classes. Since these have object as a # base class, a lot more gets sucked in. def interesting(strings): return [s for s in strings if not s.startswith('_')] class C(object): Cdata = 1 def Cmethod(self): pass cstuff = ['Cdata', 'Cmethod'] self.assertEqual(interesting(dir(C)), cstuff) c = C() self.assertEqual(interesting(dir(c)), cstuff) self.assertIn('im_self', dir(C.Cmethod)) c.cdata = 2 c.cmethod = lambda self: 0 self.assertEqual(interesting(dir(c)), cstuff + ['cdata', 'cmethod']) self.assertIn('im_self', dir(c.Cmethod)) class A(C): Adata = 1 def Amethod(self): pass astuff = ['Adata', 'Amethod'] + cstuff self.assertEqual(interesting(dir(A)), astuff) self.assertIn('im_self', dir(A.Amethod)) a = A() self.assertEqual(interesting(dir(a)), astuff) a.adata = 42 a.amethod = lambda self: 3 self.assertEqual(interesting(dir(a)), astuff + ['adata', 'amethod']) self.assertIn('im_self', dir(a.Amethod)) # Try a module subclass. class M(type(sys)): pass minstance = M("m") minstance.b = 2 minstance.a = 1 names = [x for x in dir(minstance) if x not in ["__name__", "__doc__"]] self.assertEqual(names, ['a', 'b']) class M2(M): def getdict(self): return "Not a dict!" __dict__ = property(getdict) m2instance = M2("m2") m2instance.b = 2 m2instance.a = 1 self.assertEqual(m2instance.__dict__, "Not a dict!") try: dir(m2instance) except TypeError: pass # Two essentially featureless objects, just inheriting stuff from # object. self.assertEqual(dir(NotImplemented), dir(Ellipsis)) if test_support.check_impl_detail(): # None differs in PyPy: it has a __nonzero__ self.assertEqual(dir(None), dir(Ellipsis)) # Nasty test case for proxied objects class Wrapper(object): def __init__(self, obj): self.__obj = obj def __repr__(self): return "Wrapper(%s)" % repr(self.__obj) def __getitem__(self, key): return Wrapper(self.__obj[key]) def __len__(self): return len(self.__obj) def __getattr__(self, name): return Wrapper(getattr(self.__obj, name)) class C(object): def __getclass(self): return Wrapper(type(self)) __class__ = property(__getclass) dir(C()) # This used to segfault def test_supers(self): # Testing super... class A(object): def meth(self, a): return "A(%r)" % a self.assertEqual(A().meth(1), "A(1)") class B(A): def __init__(self): self.__super = super(B, self) def meth(self, a): return "B(%r)" % a + self.__super.meth(a) self.assertEqual(B().meth(2), "B(2)A(2)") class C(A): def meth(self, a): return "C(%r)" % a + self.__super.meth(a) C._C__super = super(C) self.assertEqual(C().meth(3), "C(3)A(3)") class D(C, B): def meth(self, a): return "D(%r)" % a + super(D, self).meth(a) self.assertEqual(D().meth(4), "D(4)C(4)B(4)A(4)") # Test for subclassing super class mysuper(super): def __init__(self, *args): return super(mysuper, self).__init__(*args) class E(D): def meth(self, a): return "E(%r)" % a + mysuper(E, self).meth(a) self.assertEqual(E().meth(5), "E(5)D(5)C(5)B(5)A(5)") class F(E): def meth(self, a): s = self.__super # == mysuper(F, self) return "F(%r)[%s]" % (a, s.__class__.__name__) + s.meth(a) F._F__super = mysuper(F) self.assertEqual(F().meth(6), "F(6)[mysuper]E(6)D(6)C(6)B(6)A(6)") # Make sure certain errors are raised try: super(D, 42) except TypeError: pass else: self.fail("shouldn't allow super(D, 42)") try: super(D, C()) except TypeError: pass else: self.fail("shouldn't allow super(D, C())") try: super(D).__get__(12) except TypeError: pass else: self.fail("shouldn't allow super(D).__get__(12)") try: super(D).__get__(C()) except TypeError: pass else: self.fail("shouldn't allow super(D).__get__(C())") # Make sure data descriptors can be overridden and accessed via super # (new feature in Python 2.3) class DDbase(object): def getx(self): return 42 x = property(getx) class DDsub(DDbase): def getx(self): return "hello" x = property(getx) dd = DDsub() self.assertEqual(dd.x, "hello") self.assertEqual(super(DDsub, dd).x, 42) # Ensure that super() lookup of descriptor from classmethod # works (SF ID# 743627) class Base(object): aProp = property(lambda self: "foo") class Sub(Base): @classmethod def test(klass): return super(Sub,klass).aProp self.assertEqual(Sub.test(), Base.aProp) # Verify that super() doesn't allow keyword args try: super(Base, kw=1) except TypeError: pass else: self.assertEqual("super shouldn't accept keyword args") def test_basic_inheritance(self): # Testing inheritance from basic types... class hexint(int): def __repr__(self): return hex(self) def __add__(self, other): return hexint(int.__add__(self, other)) # (Note that overriding __radd__ doesn't work, # because the int type gets first dibs.) self.assertEqual(repr(hexint(7) + 9), "0x10") self.assertEqual(repr(hexint(1000) + 7), "0x3ef") a = hexint(12345) self.assertEqual(a, 12345) self.assertEqual(int(a), 12345) self.assertTrue(int(a).__class__ is int) self.assertEqual(hash(a), hash(12345)) self.assertTrue((+a).__class__ is int) self.assertTrue((a >> 0).__class__ is int) self.assertTrue((a << 0).__class__ is int) self.assertTrue((hexint(0) << 12).__class__ is int) self.assertTrue((hexint(0) >> 12).__class__ is int) class octlong(long): __slots__ = [] def __str__(self): s = oct(self) if s[-1] == 'L': s = s[:-1] return s def __add__(self, other): return self.__class__(super(octlong, self).__add__(other)) __radd__ = __add__ self.assertEqual(str(octlong(3) + 5), "010") # (Note that overriding __radd__ here only seems to work # because the example uses a short int left argument.) self.assertEqual(str(5 + octlong(3000)), "05675") a = octlong(12345) self.assertEqual(a, 12345L) self.assertEqual(long(a), 12345L) self.assertEqual(hash(a), hash(12345L)) self.assertTrue(long(a).__class__ is long) self.assertTrue((+a).__class__ is long) self.assertTrue((-a).__class__ is long) self.assertTrue((-octlong(0)).__class__ is long) self.assertTrue((a >> 0).__class__ is long) self.assertTrue((a << 0).__class__ is long) self.assertTrue((a - 0).__class__ is long) self.assertTrue((a * 1).__class__ is long) self.assertTrue((a ** 1).__class__ is long) self.assertTrue((a // 1).__class__ is long) self.assertTrue((1 * a).__class__ is long) self.assertTrue((a | 0).__class__ is long) self.assertTrue((a ^ 0).__class__ is long) self.assertTrue((a & -1L).__class__ is long) self.assertTrue((octlong(0) << 12).__class__ is long) self.assertTrue((octlong(0) >> 12).__class__ is long) self.assertTrue(abs(octlong(0)).__class__ is long) # Because octlong overrides __add__, we can't check the absence of +0 # optimizations using octlong. class longclone(long): pass a = longclone(1) self.assertTrue((a + 0).__class__ is long) self.assertTrue((0 + a).__class__ is long) # Check that negative clones don't segfault a = longclone(-1) self.assertEqual(a.__dict__, {}) self.assertEqual(long(a), -1) # self.assertTrue PyNumber_Long() copies the sign bit class precfloat(float): __slots__ = ['prec'] def __init__(self, value=0.0, prec=12): self.prec = int(prec) def __repr__(self): return "%.*g" % (self.prec, self) self.assertEqual(repr(precfloat(1.1)), "1.1") a = precfloat(12345) self.assertEqual(a, 12345.0) self.assertEqual(float(a), 12345.0) self.assertTrue(float(a).__class__ is float) self.assertEqual(hash(a), hash(12345.0)) self.assertTrue((+a).__class__ is float) class madcomplex(complex): def __repr__(self): return "%.17gj%+.17g" % (self.imag, self.real) a = madcomplex(-3, 4) self.assertEqual(repr(a), "4j-3") base = complex(-3, 4) self.assertEqual(base.__class__, complex) self.assertEqual(a, base) self.assertEqual(complex(a), base) self.assertEqual(complex(a).__class__, complex) a = madcomplex(a) # just trying another form of the constructor self.assertEqual(repr(a), "4j-3") self.assertEqual(a, base) self.assertEqual(complex(a), base) self.assertEqual(complex(a).__class__, complex) self.assertEqual(hash(a), hash(base)) self.assertEqual((+a).__class__, complex) self.assertEqual((a + 0).__class__, complex) self.assertEqual(a + 0, base) self.assertEqual((a - 0).__class__, complex) self.assertEqual(a - 0, base) self.assertEqual((a * 1).__class__, complex) self.assertEqual(a * 1, base) self.assertEqual((a / 1).__class__, complex) self.assertEqual(a / 1, base) class madtuple(tuple): _rev = None def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__(L) return self._rev a = madtuple((1,2,3,4,5,6,7,8,9,0)) self.assertEqual(a, (1,2,3,4,5,6,7,8,9,0)) self.assertEqual(a.rev(), madtuple((0,9,8,7,6,5,4,3,2,1))) self.assertEqual(a.rev().rev(), madtuple((1,2,3,4,5,6,7,8,9,0))) for i in range(512): t = madtuple(range(i)) u = t.rev() v = u.rev() self.assertEqual(v, t) a = madtuple((1,2,3,4,5)) self.assertEqual(tuple(a), (1,2,3,4,5)) self.assertTrue(tuple(a).__class__ is tuple) self.assertEqual(hash(a), hash((1,2,3,4,5))) self.assertTrue(a[:].__class__ is tuple) self.assertTrue((a * 1).__class__ is tuple) self.assertTrue((a * 0).__class__ is tuple) self.assertTrue((a + ()).__class__ is tuple) a = madtuple(()) self.assertEqual(tuple(a), ()) self.assertTrue(tuple(a).__class__ is tuple) self.assertTrue((a + a).__class__ is tuple) self.assertTrue((a * 0).__class__ is tuple) self.assertTrue((a * 1).__class__ is tuple) self.assertTrue((a * 2).__class__ is tuple) self.assertTrue(a[:].__class__ is tuple) class madstring(str): _rev = None def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__("".join(L)) return self._rev s = madstring("abcdefghijklmnopqrstuvwxyz") self.assertEqual(s, "abcdefghijklmnopqrstuvwxyz") self.assertEqual(s.rev(), madstring("zyxwvutsrqponmlkjihgfedcba")) self.assertEqual(s.rev().rev(), madstring("abcdefghijklmnopqrstuvwxyz")) for i in range(256): s = madstring("".join(map(chr, range(i)))) t = s.rev() u = t.rev() self.assertEqual(u, s) s = madstring("12345") self.assertEqual(str(s), "12345") self.assertTrue(str(s).__class__ is str) base = "\x00" * 5 s = madstring(base) self.assertEqual(s, base) self.assertEqual(str(s), base) self.assertTrue(str(s).__class__ is str) self.assertEqual(hash(s), hash(base)) self.assertEqual({s: 1}[base], 1) self.assertEqual({base: 1}[s], 1) self.assertTrue((s + "").__class__ is str) self.assertEqual(s + "", base) self.assertTrue(("" + s).__class__ is str) self.assertEqual("" + s, base) self.assertTrue((s * 0).__class__ is str) self.assertEqual(s * 0, "") self.assertTrue((s * 1).__class__ is str) self.assertEqual(s * 1, base) self.assertTrue((s * 2).__class__ is str) self.assertEqual(s * 2, base + base) self.assertTrue(s[:].__class__ is str) self.assertEqual(s[:], base) self.assertTrue(s[0:0].__class__ is str) self.assertEqual(s[0:0], "") self.assertTrue(s.strip().__class__ is str) self.assertEqual(s.strip(), base) self.assertTrue(s.lstrip().__class__ is str) self.assertEqual(s.lstrip(), base) self.assertTrue(s.rstrip().__class__ is str) self.assertEqual(s.rstrip(), base) identitytab = ''.join([chr(i) for i in range(256)]) self.assertTrue(s.translate(identitytab).__class__ is str) self.assertEqual(s.translate(identitytab), base) self.assertTrue(s.translate(identitytab, "x").__class__ is str) self.assertEqual(s.translate(identitytab, "x"), base) self.assertEqual(s.translate(identitytab, "\x00"), "") self.assertTrue(s.replace("x", "x").__class__ is str) self.assertEqual(s.replace("x", "x"), base) self.assertTrue(s.ljust(len(s)).__class__ is str) self.assertEqual(s.ljust(len(s)), base) self.assertTrue(s.rjust(len(s)).__class__ is str) self.assertEqual(s.rjust(len(s)), base) self.assertTrue(s.center(len(s)).__class__ is str) self.assertEqual(s.center(len(s)), base) self.assertTrue(s.lower().__class__ is str) self.assertEqual(s.lower(), base) class madunicode(unicode): _rev = None def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__(u"".join(L)) return self._rev u = madunicode("ABCDEF") self.assertEqual(u, u"ABCDEF") self.assertEqual(u.rev(), madunicode(u"FEDCBA")) self.assertEqual(u.rev().rev(), madunicode(u"ABCDEF")) base = u"12345" u = madunicode(base) self.assertEqual(unicode(u), base) self.assertTrue(unicode(u).__class__ is unicode) self.assertEqual(hash(u), hash(base)) self.assertEqual({u: 1}[base], 1) self.assertEqual({base: 1}[u], 1) self.assertTrue(u.strip().__class__ is unicode) self.assertEqual(u.strip(), base) self.assertTrue(u.lstrip().__class__ is unicode) self.assertEqual(u.lstrip(), base) self.assertTrue(u.rstrip().__class__ is unicode) self.assertEqual(u.rstrip(), base) self.assertTrue(u.replace(u"x", u"x").__class__ is unicode) self.assertEqual(u.replace(u"x", u"x"), base) self.assertTrue(u.replace(u"xy", u"xy").__class__ is unicode) self.assertEqual(u.replace(u"xy", u"xy"), base) self.assertTrue(u.center(len(u)).__class__ is unicode) self.assertEqual(u.center(len(u)), base) self.assertTrue(u.ljust(len(u)).__class__ is unicode) self.assertEqual(u.ljust(len(u)), base) self.assertTrue(u.rjust(len(u)).__class__ is unicode) self.assertEqual(u.rjust(len(u)), base) self.assertTrue(u.lower().__class__ is unicode) self.assertEqual(u.lower(), base) self.assertTrue(u.upper().__class__ is unicode) self.assertEqual(u.upper(), base) self.assertTrue(u.capitalize().__class__ is unicode) self.assertEqual(u.capitalize(), base) self.assertTrue(u.title().__class__ is unicode) self.assertEqual(u.title(), base) self.assertTrue((u + u"").__class__ is unicode) self.assertEqual(u + u"", base) self.assertTrue((u"" + u).__class__ is unicode) self.assertEqual(u"" + u, base) self.assertTrue((u * 0).__class__ is unicode) self.assertEqual(u * 0, u"") self.assertTrue((u * 1).__class__ is unicode) self.assertEqual(u * 1, base) self.assertTrue((u * 2).__class__ is unicode) self.assertEqual(u * 2, base + base) self.assertTrue(u[:].__class__ is unicode) self.assertEqual(u[:], base) self.assertTrue(u[0:0].__class__ is unicode) self.assertEqual(u[0:0], u"") class sublist(list): pass a = sublist(range(5)) self.assertEqual(a, range(5)) a.append("hello") self.assertEqual(a, range(5) + ["hello"]) a[5] = 5 self.assertEqual(a, range(6)) a.extend(range(6, 20)) self.assertEqual(a, range(20)) a[-5:] = [] self.assertEqual(a, range(15)) del a[10:15] self.assertEqual(len(a), 10) self.assertEqual(a, range(10)) self.assertEqual(list(a), range(10)) self.assertEqual(a[0], 0) self.assertEqual(a[9], 9) self.assertEqual(a[-10], 0) self.assertEqual(a[-1], 9) self.assertEqual(a[:5], range(5)) class CountedInput(file): """Counts lines read by self.readline(). self.lineno is the 0-based ordinal of the last line read, up to a maximum of one greater than the number of lines in the file. self.ateof is true if and only if the final "" line has been read, at which point self.lineno stops incrementing, and further calls to readline() continue to return "". """ lineno = 0 ateof = 0 def readline(self): if self.ateof: return "" s = file.readline(self) # Next line works too. # s = super(CountedInput, self).readline() self.lineno += 1 if s == "": self.ateof = 1 return s f = file(name=test_support.TESTFN, mode='w') lines = ['a\n', 'b\n', 'c\n'] try: f.writelines(lines) f.close() f = CountedInput(test_support.TESTFN) for (i, expected) in zip(range(1, 5) + [4], lines + 2 * [""]): got = f.readline() self.assertEqual(expected, got) self.assertEqual(f.lineno, i) self.assertEqual(f.ateof, (i > len(lines))) f.close() finally: try: f.close() except: pass test_support.unlink(test_support.TESTFN) def test_keywords(self): # Testing keyword args to basic type constructors ... self.assertEqual(int(x=1), 1) self.assertEqual(float(x=2), 2.0) self.assertEqual(long(x=3), 3L) self.assertEqual(complex(imag=42, real=666), complex(666, 42)) self.assertEqual(str(object=500), '500') self.assertEqual(unicode(string='abc', errors='strict'), u'abc') self.assertEqual(tuple(sequence=range(3)), (0, 1, 2)) self.assertEqual(list(sequence=(0, 1, 2)), range(3)) # note: as of Python 2.3, dict() no longer has an "items" keyword arg for constructor in (int, float, long, complex, str, unicode, tuple, list, file): try: constructor(bogus_keyword_arg=1) except TypeError: pass else: self.fail("expected TypeError from bogus keyword argument to %r" % constructor) def test_str_subclass_as_dict_key(self): # Testing a str subclass used as dict key .. class cistr(str): """Sublcass of str that computes __eq__ case-insensitively. Also computes a hash code of the string in canonical form. """ def __init__(self, value): self.canonical = value.lower() self.hashcode = hash(self.canonical) def __eq__(self, other): if not isinstance(other, cistr): other = cistr(other) return self.canonical == other.canonical def __hash__(self): return self.hashcode self.assertEqual(cistr('ABC'), 'abc') self.assertEqual('aBc', cistr('ABC')) self.assertEqual(str(cistr('ABC')), 'ABC') d = {cistr('one'): 1, cistr('two'): 2, cistr('tHree'): 3} self.assertEqual(d[cistr('one')], 1) self.assertEqual(d[cistr('tWo')], 2) self.assertEqual(d[cistr('THrEE')], 3) self.assertIn(cistr('ONe'), d) self.assertEqual(d.get(cistr('thrEE')), 3) def test_classic_comparisons(self): # Testing classic comparisons... class classic: pass for base in (classic, int, object): class C(base): def __init__(self, value): self.value = int(value) def __cmp__(self, other): if isinstance(other, C): return cmp(self.value, other.value) if isinstance(other, int) or isinstance(other, long): return cmp(self.value, other) return NotImplemented __hash__ = None # Silence Py3k warning c1 = C(1) c2 = C(2) c3 = C(3) self.assertEqual(c1, 1) c = {1: c1, 2: c2, 3: c3} for x in 1, 2, 3: for y in 1, 2, 3: self.assertTrue(cmp(c[x], c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) for op in "<", "<=", "==", "!=", ">", ">=": self.assertTrue(eval("c[x] %s c[y]" % op) == eval("x %s y" % op), "x=%d, y=%d" % (x, y)) self.assertTrue(cmp(c[x], y) == cmp(x, y), "x=%d, y=%d" % (x, y)) self.assertTrue(cmp(x, c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y)) def test_rich_comparisons(self): # Testing rich comparisons... class Z(complex): pass z = Z(1) self.assertEqual(z, 1+0j) self.assertEqual(1+0j, z) class ZZ(complex): def __eq__(self, other): try: return abs(self - other) <= 1e-6 except: return NotImplemented __hash__ = None # Silence Py3k warning zz = ZZ(1.0000003) self.assertEqual(zz, 1+0j) self.assertEqual(1+0j, zz) class classic: pass for base in (classic, int, object, list): class C(base): def __init__(self, value): self.value = int(value) def __cmp__(self_, other): self.fail("shouldn't call __cmp__") __hash__ = None # Silence Py3k warning def __eq__(self, other): if isinstance(other, C): return self.value == other.value if isinstance(other, int) or isinstance(other, long): return self.value == other return NotImplemented def __ne__(self, other): if isinstance(other, C): return self.value != other.value if isinstance(other, int) or isinstance(other, long): return self.value != other return NotImplemented def __lt__(self, other): if isinstance(other, C): return self.value < other.value if isinstance(other, int) or isinstance(other, long): return self.value < other return NotImplemented def __le__(self, other): if isinstance(other, C): return self.value <= other.value if isinstance(other, int) or isinstance(other, long): return self.value <= other return NotImplemented def __gt__(self, other): if isinstance(other, C): return self.value > other.value if isinstance(other, int) or isinstance(other, long): return self.value > other return NotImplemented def __ge__(self, other): if isinstance(other, C): return self.value >= other.value if isinstance(other, int) or isinstance(other, long): return self.value >= other return NotImplemented c1 = C(1) c2 = C(2) c3 = C(3) self.assertEqual(c1, 1) c = {1: c1, 2: c2, 3: c3} for x in 1, 2, 3: for y in 1, 2, 3: for op in "<", "<=", "==", "!=", ">", ">=": self.assertTrue(eval("c[x] %s c[y]" % op) == eval("x %s y" % op), "x=%d, y=%d" % (x, y)) self.assertTrue(eval("c[x] %s y" % op) == eval("x %s y" % op), "x=%d, y=%d" % (x, y)) self.assertTrue(eval("x %s c[y]" % op) == eval("x %s y" % op), "x=%d, y=%d" % (x, y)) def test_coercions(self): # Testing coercions... class I(int): pass coerce(I(0), 0) coerce(0, I(0)) class L(long): pass coerce(L(0), 0) coerce(L(0), 0L) coerce(0, L(0)) coerce(0L, L(0)) class F(float): pass coerce(F(0), 0) coerce(F(0), 0L) coerce(F(0), 0.) coerce(0, F(0)) coerce(0L, F(0)) coerce(0., F(0)) class C(complex): pass coerce(C(0), 0) coerce(C(0), 0L) coerce(C(0), 0.) coerce(C(0), 0j) coerce(0, C(0)) coerce(0L, C(0)) coerce(0., C(0)) coerce(0j, C(0)) def test_descrdoc(self): # Testing descriptor doc strings... def check(descr, what): self.assertEqual(descr.__doc__, what) check(file.closed, "True if the file is closed") # getset descriptor check(file.name, "file name") # member descriptor def test_doc_descriptor(self): # Testing __doc__ descriptor... # SF bug 542984 class DocDescr(object): def __get__(self, object, otype): if object: object = object.__class__.__name__ + ' instance' if otype: otype = otype.__name__ return 'object=%s; type=%s' % (object, otype) class OldClass: __doc__ = DocDescr() class NewClass(object): __doc__ = DocDescr() self.assertEqual(OldClass.__doc__, 'object=None; type=OldClass') self.assertEqual(OldClass().__doc__, 'object=OldClass instance; type=OldClass') self.assertEqual(NewClass.__doc__, 'object=None; type=NewClass') self.assertEqual(NewClass().__doc__, 'object=NewClass instance; type=NewClass') def test_set_class(self): # Testing __class__ assignment... class C(object): pass class D(object): pass class E(object): pass class F(D, E): pass for cls in C, D, E, F: for cls2 in C, D, E, F: x = cls() x.__class__ = cls2 self.assertTrue(x.__class__ is cls2) x.__class__ = cls self.assertTrue(x.__class__ is cls) def cant(x, C): try: x.__class__ = C except TypeError: pass else: self.fail("shouldn't allow %r.__class__ = %r" % (x, C)) try: delattr(x, "__class__") except (TypeError, AttributeError): pass else: self.fail("shouldn't allow del %r.__class__" % x) cant(C(), list) cant(list(), C) cant(C(), 1) cant(C(), object) cant(object(), list) cant(list(), object) class Int(int): __slots__ = [] cant(2, Int) cant(Int(), int) cant(True, int) cant(2, bool) o = object() cant(o, type(1)) cant(o, type(None)) del o class G(object): __slots__ = ["a", "b"] class H(object): __slots__ = ["b", "a"] try: unicode except NameError: class I(object): __slots__ = ["a", "b"] else: class I(object): __slots__ = [unicode("a"), unicode("b")] class J(object): __slots__ = ["c", "b"] class K(object): __slots__ = ["a", "b", "d"] class L(H): __slots__ = ["e"] class M(I): __slots__ = ["e"] class N(J): __slots__ = ["__weakref__"] class P(J): __slots__ = ["__dict__"] class Q(J): pass class R(J): __slots__ = ["__dict__", "__weakref__"] if test_support.check_impl_detail(pypy=False): lst = ((G, H), (G, I), (I, H), (Q, R), (R, Q)) else: # Not supported in pypy: changing the __class__ of an object # to another __class__ that just happens to have the same slots. # If needed, we can add the feature, but what we'll likely do # then is to allow mostly any __class__ assignment, even if the # classes have different __slots__, because we it's easier. lst = ((Q, R), (R, Q)) for cls, cls2 in lst: x = cls() x.a = 1 x.__class__ = cls2 self.assertTrue(x.__class__ is cls2, "assigning %r as __class__ for %r silently failed" % (cls2, x)) self.assertEqual(x.a, 1) x.__class__ = cls self.assertTrue(x.__class__ is cls, "assigning %r as __class__ for %r silently failed" % (cls, x)) self.assertEqual(x.a, 1) for cls in G, J, K, L, M, N, P, R, list, Int: for cls2 in G, J, K, L, M, N, P, R, list, Int: if cls is cls2: continue cant(cls(), cls2) # Issue5283: when __class__ changes in __del__, the wrong # type gets DECREF'd. class O(object): def __del__(self): pass class A(object): def __del__(self): self.__class__ = O l = [A() for x in range(100)] del l def test_set_dict(self): # Testing __dict__ assignment... class C(object): pass a = C() a.__dict__ = {'b': 1} self.assertEqual(a.b, 1) def cant(x, dict): try: x.__dict__ = dict except (AttributeError, TypeError): pass else: self.fail("shouldn't allow %r.__dict__ = %r" % (x, dict)) cant(a, None) cant(a, []) cant(a, 1) del a.__dict__ # Deleting __dict__ is allowed class Base(object): pass def verify_dict_readonly(x): """ x has to be an instance of a class inheriting from Base. """ cant(x, {}) try: del x.__dict__ except (AttributeError, TypeError): pass else: self.fail("shouldn't allow del %r.__dict__" % x) dict_descr = Base.__dict__["__dict__"] try: dict_descr.__set__(x, {}) except (AttributeError, TypeError): pass else: self.fail("dict_descr allowed access to %r's dict" % x) # Classes don't allow __dict__ assignment and have readonly dicts class Meta1(type, Base): pass class Meta2(Base, type): pass class D(object): __metaclass__ = Meta1 class E(object): __metaclass__ = Meta2 for cls in C, D, E: verify_dict_readonly(cls) class_dict = cls.__dict__ try: class_dict["spam"] = "eggs" except TypeError: pass else: if test_support.check_impl_detail(pypy=False): self.fail("%r's __dict__ can be modified" % cls) # Modules also disallow __dict__ assignment class Module1(types.ModuleType, Base): pass class Module2(Base, types.ModuleType): pass for ModuleType in Module1, Module2: mod = ModuleType("spam") verify_dict_readonly(mod) mod.__dict__["spam"] = "eggs" # Exception's __dict__ can be replaced, but not deleted # (at least not any more than regular exception's __dict__ can # be deleted; on CPython it is not the case, whereas on PyPy they # can, just like any other new-style instance's __dict__.) def can_delete_dict(e): try: del e.__dict__ except (TypeError, AttributeError): return False else: return True class Exception1(Exception, Base): pass class Exception2(Base, Exception): pass for ExceptionType in Exception, Exception1, Exception2: e = ExceptionType() e.__dict__ = {"a": 1} self.assertEqual(e.a, 1) self.assertEqual(can_delete_dict(e), can_delete_dict(ValueError())) def test_pickles(self): # Testing pickling and copying new-style classes and objects... import pickle, cPickle def sorteditems(d): L = d.items() L.sort() return L global C class C(object): def __init__(self, a, b): super(C, self).__init__() self.a = a self.b = b def __repr__(self): return "C(%r, %r)" % (self.a, self.b) global C1 class C1(list): def __new__(cls, a, b): return super(C1, cls).__new__(cls) def __getnewargs__(self): return (self.a, self.b) def __init__(self, a, b): self.a = a self.b = b def __repr__(self): return "C1(%r, %r)<%r>" % (self.a, self.b, list(self)) global C2 class C2(int): def __new__(cls, a, b, val=0): return super(C2, cls).__new__(cls, val) def __getnewargs__(self): return (self.a, self.b, int(self)) def __init__(self, a, b, val=0): self.a = a self.b = b def __repr__(self): return "C2(%r, %r)<%r>" % (self.a, self.b, int(self)) global C3 class C3(object): def __init__(self, foo): self.foo = foo def __getstate__(self): return self.foo def __setstate__(self, foo): self.foo = foo global C4classic, C4 class C4classic: # classic pass class C4(C4classic, object): # mixed inheritance pass for p in pickle, cPickle: for bin in 0, 1: for cls in C, C1, C2: s = p.dumps(cls, bin) cls2 = p.loads(s) self.assertTrue(cls2 is cls) a = C1(1, 2); a.append(42); a.append(24) b = C2("hello", "world", 42) s = p.dumps((a, b), bin) x, y = p.loads(s) self.assertEqual(x.__class__, a.__class__) self.assertEqual(sorteditems(x.__dict__), sorteditems(a.__dict__)) self.assertEqual(y.__class__, b.__class__) self.assertEqual(sorteditems(y.__dict__), sorteditems(b.__dict__)) self.assertEqual(repr(x), repr(a)) self.assertEqual(repr(y), repr(b)) # Test for __getstate__ and __setstate__ on new style class u = C3(42) s = p.dumps(u, bin) v = p.loads(s) self.assertEqual(u.__class__, v.__class__) self.assertEqual(u.foo, v.foo) # Test for picklability of hybrid class u = C4() u.foo = 42 s = p.dumps(u, bin) v = p.loads(s) self.assertEqual(u.__class__, v.__class__) self.assertEqual(u.foo, v.foo) # Testing copy.deepcopy() import copy for cls in C, C1, C2: cls2 = copy.deepcopy(cls) self.assertTrue(cls2 is cls) a = C1(1, 2); a.append(42); a.append(24) b = C2("hello", "world", 42) x, y = copy.deepcopy((a, b)) self.assertEqual(x.__class__, a.__class__) self.assertEqual(sorteditems(x.__dict__), sorteditems(a.__dict__)) self.assertEqual(y.__class__, b.__class__) self.assertEqual(sorteditems(y.__dict__), sorteditems(b.__dict__)) self.assertEqual(repr(x), repr(a)) self.assertEqual(repr(y), repr(b)) def test_pickle_slots(self): # Testing pickling of classes with __slots__ ... import pickle, cPickle # Pickling of classes with __slots__ but without __getstate__ should fail global B, C, D, E class B(object): pass for base in [object, B]: class C(base): __slots__ = ['a'] class D(C): pass try: pickle.dumps(C()) except TypeError: pass else: self.fail("should fail: pickle C instance - %s" % base) try: cPickle.dumps(C()) except TypeError: pass else: self.fail("should fail: cPickle C instance - %s" % base) try: pickle.dumps(C()) except TypeError: pass else: self.fail("should fail: pickle D instance - %s" % base) try: cPickle.dumps(D()) except TypeError: pass else: self.fail("should fail: cPickle D instance - %s" % base) # Give C a nice generic __getstate__ and __setstate__ class C(base): __slots__ = ['a'] def __getstate__(self): try: d = self.__dict__.copy() except AttributeError: d = {} for cls in self.__class__.__mro__: for sn in cls.__dict__.get('__slots__', ()): try: d[sn] = getattr(self, sn) except AttributeError: pass return d def __setstate__(self, d): for k, v in d.items(): setattr(self, k, v) class D(C): pass # Now it should work x = C() y = pickle.loads(pickle.dumps(x)) self.assertEqual(hasattr(y, 'a'), 0) y = cPickle.loads(cPickle.dumps(x)) self.assertEqual(hasattr(y, 'a'), 0) x.a = 42 y = pickle.loads(pickle.dumps(x)) self.assertEqual(y.a, 42) y = cPickle.loads(cPickle.dumps(x)) self.assertEqual(y.a, 42) x = D() x.a = 42 x.b = 100 y = pickle.loads(pickle.dumps(x)) self.assertEqual(y.a + y.b, 142) y = cPickle.loads(cPickle.dumps(x)) self.assertEqual(y.a + y.b, 142) # A subclass that adds a slot should also work class E(C): __slots__ = ['b'] x = E() x.a = 42 x.b = "foo" y = pickle.loads(pickle.dumps(x)) self.assertEqual(y.a, x.a) self.assertEqual(y.b, x.b) y = cPickle.loads(cPickle.dumps(x)) self.assertEqual(y.a, x.a) self.assertEqual(y.b, x.b) def test_binary_operator_override(self): # Testing overrides of binary operations... class I(int): def __repr__(self): return "I(%r)" % int(self) def __add__(self, other): return I(int(self) + int(other)) __radd__ = __add__ def __pow__(self, other, mod=None): if mod is None: return I(pow(int(self), int(other))) else: return I(pow(int(self), int(other), int(mod))) def __rpow__(self, other, mod=None): if mod is None: return I(pow(int(other), int(self), mod)) else: return I(pow(int(other), int(self), int(mod))) self.assertEqual(repr(I(1) + I(2)), "I(3)") self.assertEqual(repr(I(1) + 2), "I(3)") self.assertEqual(repr(1 + I(2)), "I(3)") self.assertEqual(repr(I(2) ** I(3)), "I(8)") self.assertEqual(repr(2 ** I(3)), "I(8)") self.assertEqual(repr(I(2) ** 3), "I(8)") self.assertEqual(repr(pow(I(2), I(3), I(5))), "I(3)") class S(str): def __eq__(self, other): return self.lower() == other.lower() __hash__ = None # Silence Py3k warning def test_subclass_propagation(self): # Testing propagation of slot functions to subclasses... class A(object): pass class B(A): pass class C(A): pass class D(B, C): pass d = D() orig_hash = hash(d) # related to id(d) in platform-dependent ways A.__hash__ = lambda self: 42 self.assertEqual(hash(d), 42) C.__hash__ = lambda self: 314 self.assertEqual(hash(d), 314) B.__hash__ = lambda self: 144 self.assertEqual(hash(d), 144) D.__hash__ = lambda self: 100 self.assertEqual(hash(d), 100) D.__hash__ = None self.assertRaises(TypeError, hash, d) del D.__hash__ self.assertEqual(hash(d), 144) B.__hash__ = None self.assertRaises(TypeError, hash, d) del B.__hash__ self.assertEqual(hash(d), 314) C.__hash__ = None self.assertRaises(TypeError, hash, d) del C.__hash__ self.assertEqual(hash(d), 42) A.__hash__ = None self.assertRaises(TypeError, hash, d) del A.__hash__ self.assertEqual(hash(d), orig_hash) d.foo = 42 d.bar = 42 self.assertEqual(d.foo, 42) self.assertEqual(d.bar, 42) def __getattribute__(self, name): if name == "foo": return 24 return object.__getattribute__(self, name) A.__getattribute__ = __getattribute__ self.assertEqual(d.foo, 24) self.assertEqual(d.bar, 42) def __getattr__(self, name): if name in ("spam", "foo", "bar"): return "hello" raise AttributeError, name B.__getattr__ = __getattr__ self.assertEqual(d.spam, "hello") self.assertEqual(d.foo, 24) self.assertEqual(d.bar, 42) del A.__getattribute__ self.assertEqual(d.foo, 42) del d.foo self.assertEqual(d.foo, "hello") self.assertEqual(d.bar, 42) del B.__getattr__ try: d.foo except AttributeError: pass else: self.fail("d.foo should be undefined now") # Test a nasty bug in recurse_down_subclasses() class A(object): pass class B(A): pass del B test_support.gc_collect() A.__setitem__ = lambda *a: None # crash def test_buffer_inheritance(self): # Testing that buffer interface is inherited ... import binascii # SF bug [#470040] ParseTuple t# vs subclasses. class MyStr(str): pass base = 'abc' m = MyStr(base) # b2a_hex uses the buffer interface to get its argument's value, via # PyArg_ParseTuple 't#' code. self.assertEqual(binascii.b2a_hex(m), binascii.b2a_hex(base)) # It's not clear that unicode will continue to support the character # buffer interface, and this test will fail if that's taken away. class MyUni(unicode): pass base = u'abc' m = MyUni(base) self.assertEqual(binascii.b2a_hex(m), binascii.b2a_hex(base)) class MyInt(int): pass m = MyInt(42) try: binascii.b2a_hex(m) self.fail('subclass of int should not have a buffer interface') except TypeError: pass def test_str_of_str_subclass(self): # Testing __str__ defined in subclass of str ... import binascii import cStringIO class octetstring(str): def __str__(self): return binascii.b2a_hex(self) def __repr__(self): return self + " repr" o = octetstring('A') self.assertEqual(type(o), octetstring) self.assertEqual(type(str(o)), str) self.assertEqual(type(repr(o)), str) self.assertEqual(ord(o), 0x41) self.assertEqual(str(o), '41') self.assertEqual(repr(o), 'A repr') self.assertEqual(o.__str__(), '41') self.assertEqual(o.__repr__(), 'A repr') capture = cStringIO.StringIO() # Calling str() or not exercises different internal paths. print >> capture, o print >> capture, str(o) self.assertEqual(capture.getvalue(), '41\n41\n') capture.close() def test_keyword_arguments(self): # Testing keyword arguments to __init__, __call__... def f(a): return a self.assertEqual(f.__call__(a=42), 42) a = [] list.__init__(a, sequence=[0, 1, 2]) self.assertEqual(a, [0, 1, 2]) def test_recursive_call(self): # Testing recursive __call__() by setting to instance of class... class A(object): pass A.__call__ = A() try: A()() except RuntimeError: pass else: self.fail("Recursion limit should have been reached for __call__()") def test_delete_hook(self): # Testing __del__ hook... log = [] class C(object): def __del__(self): log.append(1) c = C() self.assertEqual(log, []) del c test_support.gc_collect() self.assertEqual(log, [1]) class D(object): pass d = D() try: del d[0] except TypeError: pass else: self.fail("invalid del() didn't raise TypeError") def test_hash_inheritance(self): # Testing hash of mutable subclasses... class mydict(dict): pass d = mydict() try: hash(d) except TypeError: pass else: self.fail("hash() of dict subclass should fail") class mylist(list): pass d = mylist() try: hash(d) except TypeError: pass else: self.fail("hash() of list subclass should fail") def test_str_operations(self): try: 'a' + 5 except TypeError: pass else: self.fail("'' + 5 doesn't raise TypeError") try: ''.split('') except ValueError: pass else: self.fail("''.split('') doesn't raise ValueError") try: ''.join([0]) except TypeError: pass else: self.fail("''.join([0]) doesn't raise TypeError") try: ''.rindex('5') except ValueError: pass else: self.fail("''.rindex('5') doesn't raise ValueError") try: '%(n)s' % None except TypeError: pass else: self.fail("'%(n)s' % None doesn't raise TypeError") try: '%(n' % {} except ValueError: pass else: self.fail("'%(n' % {} '' doesn't raise ValueError") try: '%*s' % ('abc') except TypeError: pass else: self.fail("'%*s' % ('abc') doesn't raise TypeError") try: '%*.*s' % ('abc', 5) except TypeError: pass else: self.fail("'%*.*s' % ('abc', 5) doesn't raise TypeError") try: '%s' % (1, 2) except TypeError: pass else: self.fail("'%s' % (1, 2) doesn't raise TypeError") try: '%' % None except ValueError: pass else: self.fail("'%' % None doesn't raise ValueError") self.assertEqual('534253'.isdigit(), 1) self.assertEqual('534253x'.isdigit(), 0) self.assertEqual('%c' % 5, '\x05') self.assertEqual('%c' % '5', '5') def test_deepcopy_recursive(self): # Testing deepcopy of recursive objects... class Node: pass a = Node() b = Node() a.b = b b.a = a z = deepcopy(a) # This blew up before def test_unintialized_modules(self): # Testing uninitialized module objects... from types import ModuleType as M m = M.__new__(M) str(m) self.assertEqual(hasattr(m, "__name__"), 0) self.assertEqual(hasattr(m, "__file__"), 0) self.assertEqual(hasattr(m, "foo"), 0) self.assertFalse(m.__dict__) # None or {} are both reasonable answers m.foo = 1 self.assertEqual(m.__dict__, {"foo": 1}) def test_funny_new(self): # Testing __new__ returning something unexpected... class C(object): def __new__(cls, arg): if isinstance(arg, str): return [1, 2, 3] elif isinstance(arg, int): return object.__new__(D) else: return object.__new__(cls) class D(C): def __init__(self, arg): self.foo = arg self.assertEqual(C("1"), [1, 2, 3]) self.assertEqual(D("1"), [1, 2, 3]) d = D(None) self.assertEqual(d.foo, None) d = C(1) self.assertEqual(isinstance(d, D), True) self.assertEqual(d.foo, 1) d = D(1) self.assertEqual(isinstance(d, D), True) self.assertEqual(d.foo, 1) def test_imul_bug(self): # Testing for __imul__ problems... # SF bug 544647 class C(object): def __imul__(self, other): return (self, other) x = C() y = x y *= 1.0 self.assertEqual(y, (x, 1.0)) y = x y *= 2 self.assertEqual(y, (x, 2)) y = x y *= 3L self.assertEqual(y, (x, 3L)) y = x y *= 1L<<100 self.assertEqual(y, (x, 1L<<100)) y = x y *= None self.assertEqual(y, (x, None)) y = x y *= "foo" self.assertEqual(y, (x, "foo")) def test_copy_setstate(self): # Testing that copy.*copy() correctly uses __setstate__... import copy class C(object): def __init__(self, foo=None): self.foo = foo self.__foo = foo def setfoo(self, foo=None): self.foo = foo def getfoo(self): return self.__foo def __getstate__(self): return [self.foo] def __setstate__(self_, lst): self.assertEqual(len(lst), 1) self_.__foo = self_.foo = lst[0] a = C(42) a.setfoo(24) self.assertEqual(a.foo, 24) self.assertEqual(a.getfoo(), 42) b = copy.copy(a) self.assertEqual(b.foo, 24) self.assertEqual(b.getfoo(), 24) b = copy.deepcopy(a) self.assertEqual(b.foo, 24) self.assertEqual(b.getfoo(), 24) def test_slices(self): # Testing cases with slices and overridden __getitem__ ... # Strings self.assertEqual("hello"[:4], "hell") self.assertEqual("hello"[slice(4)], "hell") self.assertEqual(str.__getitem__("hello", slice(4)), "hell") class S(str): def __getitem__(self, x): return str.__getitem__(self, x) self.assertEqual(S("hello")[:4], "hell") self.assertEqual(S("hello")[slice(4)], "hell") self.assertEqual(S("hello").__getitem__(slice(4)), "hell") # Tuples self.assertEqual((1,2,3)[:2], (1,2)) self.assertEqual((1,2,3)[slice(2)], (1,2)) self.assertEqual(tuple.__getitem__((1,2,3), slice(2)), (1,2)) class T(tuple): def __getitem__(self, x): return tuple.__getitem__(self, x) self.assertEqual(T((1,2,3))[:2], (1,2)) self.assertEqual(T((1,2,3))[slice(2)], (1,2)) self.assertEqual(T((1,2,3)).__getitem__(slice(2)), (1,2)) # Lists self.assertEqual([1,2,3][:2], [1,2]) self.assertEqual([1,2,3][slice(2)], [1,2]) self.assertEqual(list.__getitem__([1,2,3], slice(2)), [1,2]) class L(list): def __getitem__(self, x): return list.__getitem__(self, x) self.assertEqual(L([1,2,3])[:2], [1,2]) self.assertEqual(L([1,2,3])[slice(2)], [1,2]) self.assertEqual(L([1,2,3]).__getitem__(slice(2)), [1,2]) # Now do lists and __setitem__ a = L([1,2,3]) a[slice(1, 3)] = [3,2] self.assertEqual(a, [1,3,2]) a[slice(0, 2, 1)] = [3,1] self.assertEqual(a, [3,1,2]) a.__setitem__(slice(1, 3), [2,1]) self.assertEqual(a, [3,2,1]) a.__setitem__(slice(0, 2, 1), [2,3]) self.assertEqual(a, [2,3,1]) def test_subtype_resurrection(self): # Testing resurrection of new-style instance... class C(object): container = [] def __del__(self): # resurrect the instance C.container.append(self) c = C() c.attr = 42 # The most interesting thing here is whether this blows up, due to # flawed GC tracking logic in typeobject.c's call_finalizer() (a 2.2.1 # bug). del c # If that didn't blow up, it's also interesting to see whether clearing # the last container slot works: that will attempt to delete c again, # which will cause c to get appended back to the container again # "during" the del. (On non-CPython implementations, however, __del__ # is typically not called again.) test_support.gc_collect() self.assertEqual(len(C.container), 1) del C.container[-1] if test_support.check_impl_detail(): test_support.gc_collect() self.assertEqual(len(C.container), 1) self.assertEqual(C.container[-1].attr, 42) # Make c mortal again, so that the test framework with -l doesn't report # it as a leak. del C.__del__ def test_slots_trash(self): # Testing slot trash... # Deallocating deeply nested slotted trash caused stack overflows class trash(object): __slots__ = ['x'] def __init__(self, x): self.x = x o = None for i in xrange(50000): o = trash(o) del o def test_slots_multiple_inheritance(self): # SF bug 575229, multiple inheritance w/ slots dumps core class A(object): __slots__=() class B(object): pass class C(A,B) : __slots__=() if test_support.check_impl_detail(): self.assertEqual(C.__basicsize__, B.__basicsize__) self.assertTrue(hasattr(C, '__dict__')) self.assertTrue(hasattr(C, '__weakref__')) C().x = 2 def test_rmul(self): # Testing correct invocation of __rmul__... # SF patch 592646 class C(object): def __mul__(self, other): return "mul" def __rmul__(self, other): return "rmul" a = C() self.assertEqual(a*2, "mul") self.assertEqual(a*2.2, "mul") self.assertEqual(2*a, "rmul") self.assertEqual(2.2*a, "rmul") def test_ipow(self): # Testing correct invocation of __ipow__... # [SF bug 620179] class C(object): def __ipow__(self, other): pass a = C() a **= 2 def test_mutable_bases(self): # Testing mutable bases... # stuff that should work: class C(object): pass class C2(object): def __getattribute__(self, attr): if attr == 'a': return 2 else: return super(C2, self).__getattribute__(attr) def meth(self): return 1 class D(C): pass class E(D): pass d = D() e = E() D.__bases__ = (C,) D.__bases__ = (C2,) self.assertEqual(d.meth(), 1) self.assertEqual(e.meth(), 1) self.assertEqual(d.a, 2) self.assertEqual(e.a, 2) self.assertEqual(C2.__subclasses__(), [D]) try: del D.__bases__ except (TypeError, AttributeError): pass else: self.fail("shouldn't be able to delete .__bases__") try: D.__bases__ = () except TypeError, msg: if str(msg) == "a new-style class can't have only classic bases": self.fail("wrong error message for .__bases__ = ()") else: self.fail("shouldn't be able to set .__bases__ to ()") try: D.__bases__ = (D,) except TypeError: pass else: # actually, we'll have crashed by here... self.fail("shouldn't be able to create inheritance cycles") try: D.__bases__ = (C, C) except TypeError: pass else: self.fail("didn't detect repeated base classes") try: D.__bases__ = (E,) except TypeError: pass else: self.fail("shouldn't be able to create inheritance cycles") # let's throw a classic class into the mix: class Classic: def meth2(self): return 3 D.__bases__ = (C, Classic) self.assertEqual(d.meth2(), 3) self.assertEqual(e.meth2(), 3) try: d.a except AttributeError: pass else: self.fail("attribute should have vanished") try: D.__bases__ = (Classic,) except TypeError: pass else: self.fail("new-style class must have a new-style base") def test_builtin_bases(self): # Make sure all the builtin types can have their base queried without # segfaulting. See issue #5787. builtin_types = [tp for tp in __builtin__.__dict__.itervalues() if isinstance(tp, type)] for tp in builtin_types: object.__getattribute__(tp, "__bases__") if tp is not object: self.assertEqual(len(tp.__bases__), 1, tp) class L(list): pass class C(object): pass class D(C): pass try: L.__bases__ = (dict,) except TypeError: pass else: self.fail("shouldn't turn list subclass into dict subclass") try: list.__bases__ = (dict,) except TypeError: pass else: self.fail("shouldn't be able to assign to list.__bases__") try: D.__bases__ = (C, list) except TypeError: pass else: assert 0, "best_base calculation found wanting" def test_mutable_bases_with_failing_mro(self): # Testing mutable bases with failing mro... class WorkOnce(type): def __new__(self, name, bases, ns): self.flag = 0 return super(WorkOnce, self).__new__(WorkOnce, name, bases, ns) def mro(self): if self.flag > 0: raise RuntimeError, "bozo" else: self.flag += 1 return type.mro(self) class WorkAlways(type): def mro(self): # this is here to make sure that .mro()s aren't called # with an exception set (which was possible at one point). # An error message will be printed in a debug build. # What's a good way to test for this? return type.mro(self) class C(object): pass class C2(object): pass class D(C): pass class E(D): pass class F(D): __metaclass__ = WorkOnce class G(D): __metaclass__ = WorkAlways # Immediate subclasses have their mro's adjusted in alphabetical # order, so E's will get adjusted before adjusting F's fails. We # check here that E's gets restored. E_mro_before = E.__mro__ D_mro_before = D.__mro__ try: D.__bases__ = (C2,) except RuntimeError: self.assertEqual(E.__mro__, E_mro_before) self.assertEqual(D.__mro__, D_mro_before) else: self.fail("exception not propagated") def test_mutable_bases_catch_mro_conflict(self): # Testing mutable bases catch mro conflict... class A(object): pass class B(object): pass class C(A, B): pass class D(A, B): pass class E(C, D): pass try: C.__bases__ = (B, A) except TypeError: pass else: self.fail("didn't catch MRO conflict") def test_mutable_names(self): # Testing mutable names... class C(object): pass # C.__module__ could be 'test_descr' or '__main__' mod = C.__module__ C.__name__ = 'D' self.assertEqual((C.__module__, C.__name__), (mod, 'D')) C.__name__ = 'D.E' self.assertEqual((C.__module__, C.__name__), (mod, 'D.E')) def test_subclass_right_op(self): # Testing correct dispatch of subclass overloading __r<op>__... # This code tests various cases where right-dispatch of a subclass # should be preferred over left-dispatch of a base class. # Case 1: subclass of int; this tests code in abstract.c::binary_op1() class B(int): def __floordiv__(self, other): return "B.__floordiv__" def __rfloordiv__(self, other): return "B.__rfloordiv__" self.assertEqual(B(1) // 1, "B.__floordiv__") self.assertEqual(1 // B(1), "B.__rfloordiv__") # Case 2: subclass of object; this is just the baseline for case 3 class C(object): def __floordiv__(self, other): return "C.__floordiv__" def __rfloordiv__(self, other): return "C.__rfloordiv__" self.assertEqual(C() // 1, "C.__floordiv__") self.assertEqual(1 // C(), "C.__rfloordiv__") # Case 3: subclass of new-style class; here it gets interesting class D(C): def __floordiv__(self, other): return "D.__floordiv__" def __rfloordiv__(self, other): return "D.__rfloordiv__" self.assertEqual(D() // C(), "D.__floordiv__") self.assertEqual(C() // D(), "D.__rfloordiv__") # Case 4: this didn't work right in 2.2.2 and 2.3a1 class E(C): pass self.assertEqual(E.__rfloordiv__, C.__rfloordiv__) self.assertEqual(E() // 1, "C.__floordiv__") self.assertEqual(1 // E(), "C.__rfloordiv__") self.assertEqual(E() // C(), "C.__floordiv__") self.assertEqual(C() // E(), "C.__floordiv__") # This one would fail @test_support.impl_detail("testing an internal kind of method object") def test_meth_class_get(self): # Testing __get__ method of METH_CLASS C methods... # Full coverage of descrobject.c::classmethod_get() # Baseline arg = [1, 2, 3] res = {1: None, 2: None, 3: None} self.assertEqual(dict.fromkeys(arg), res) self.assertEqual({}.fromkeys(arg), res) # Now get the descriptor descr = dict.__dict__["fromkeys"] # More baseline using the descriptor directly self.assertEqual(descr.__get__(None, dict)(arg), res) self.assertEqual(descr.__get__({})(arg), res) # Now check various error cases try: descr.__get__(None, None) except TypeError: pass else: self.fail("shouldn't have allowed descr.__get__(None, None)") try: descr.__get__(42) except TypeError: pass else: self.fail("shouldn't have allowed descr.__get__(42)") try: descr.__get__(None, 42) except TypeError: pass else: self.fail("shouldn't have allowed descr.__get__(None, 42)") try: descr.__get__(None, int) except TypeError: pass else: self.fail("shouldn't have allowed descr.__get__(None, int)") def test_isinst_isclass(self): # Testing proxy isinstance() and isclass()... class Proxy(object): def __init__(self, obj): self.__obj = obj def __getattribute__(self, name): if name.startswith("_Proxy__"): return object.__getattribute__(self, name) else: return getattr(self.__obj, name) # Test with a classic class class C: pass a = C() pa = Proxy(a) self.assertIsInstance(a, C) # Baseline self.assertIsInstance(pa, C) # Test # Test with a classic subclass class D(C): pass a = D() pa = Proxy(a) self.assertIsInstance(a, C) # Baseline self.assertIsInstance(pa, C) # Test # Test with a new-style class class C(object): pass a = C() pa = Proxy(a) self.assertIsInstance(a, C) # Baseline self.assertIsInstance(pa, C) # Test # Test with a new-style subclass class D(C): pass a = D() pa = Proxy(a) self.assertIsInstance(a, C) # Baseline self.assertIsInstance(pa, C) # Test def test_proxy_super(self): # Testing super() for a proxy object... class Proxy(object): def __init__(self, obj): self.__obj = obj def __getattribute__(self, name): if name.startswith("_Proxy__"): return object.__getattribute__(self, name) else: return getattr(self.__obj, name) class B(object): def f(self): return "B.f" class C(B): def f(self): return super(C, self).f() + "->C.f" obj = C() p = Proxy(obj) self.assertEqual(C.__dict__["f"](p), "B.f->C.f") def test_carloverre(self): # Testing prohibition of Carlo Verre's hack... try: object.__setattr__(str, "foo", 42) except TypeError: pass else: self.fail("Carlo Verre __setattr__ succeeded!") try: object.__delattr__(str, "lower") except TypeError: pass else: self.fail("Carlo Verre __delattr__ succeeded!") def test_weakref_segfault(self): # Testing weakref segfault... # SF 742911 import weakref class Provoker: def __init__(self, referrent): self.ref = weakref.ref(referrent) def __del__(self): x = self.ref() class Oops(object): pass o = Oops() o.whatever = Provoker(o) del o def test_wrapper_segfault(self): # SF 927248: deeply nested wrappers could cause stack overflow f = lambda:None for i in xrange(1000000): f = f.__call__ f = None def test_file_fault(self): # Testing sys.stdout is changed in getattr... test_stdout = sys.stdout class StdoutGuard: def __getattr__(self, attr): sys.stdout = sys.__stdout__ raise RuntimeError("Premature access to sys.stdout.%s" % attr) sys.stdout = StdoutGuard() try: print "Oops!" except RuntimeError: pass finally: sys.stdout = test_stdout def test_vicious_descriptor_nonsense(self): # Testing vicious_descriptor_nonsense... # A potential segfault spotted by Thomas Wouters in mail to # python-dev 2003-04-17, turned into an example & fixed by Michael # Hudson just less than four months later... class Evil(object): def __hash__(self): return hash('attr') def __eq__(self, other): del C.attr return 0 class Descr(object): def __get__(self, ob, type=None): return 1 class C(object): attr = Descr() c = C() c.__dict__[Evil()] = 0 self.assertEqual(c.attr, 1) # this makes a crash more likely: test_support.gc_collect() self.assertEqual(hasattr(c, 'attr'), False) def test_init(self): # SF 1155938 class Foo(object): def __init__(self): return 10 try: Foo() except TypeError: pass else: self.fail("did not test __init__() for None return") def test_method_wrapper(self): # Testing method-wrapper objects... # <type 'method-wrapper'> did not support any reflection before 2.5 l = [] self.assertEqual(l.__add__, l.__add__) self.assertEqual(l.__add__, [].__add__) self.assertTrue(l.__add__ != [5].__add__) self.assertTrue(l.__add__ != l.__mul__) self.assertTrue(l.__add__.__name__ == '__add__') self.assertTrue(l.__add__.__self__ is l) if hasattr(l.__add__, '__objclass__'): # CPython self.assertTrue(l.__add__.__objclass__ is list) else: # PyPy self.assertTrue(l.__add__.im_class is list) self.assertEqual(l.__add__.__doc__, list.__add__.__doc__) try: hash(l.__add__) except TypeError: pass else: self.fail("no TypeError from hash([].__add__)") t = () t += (7,) self.assertEqual(t.__add__, (7,).__add__) self.assertEqual(hash(t.__add__), hash((7,).__add__)) def test_not_implemented(self): # Testing NotImplemented... # all binary methods should be able to return a NotImplemented import operator def specialmethod(self, other): return NotImplemented def check(expr, x, y): try: exec expr in {'x': x, 'y': y, 'operator': operator} except TypeError: pass else: self.fail("no TypeError from %r" % (expr,)) N1 = sys.maxint + 1L # might trigger OverflowErrors instead of # TypeErrors N2 = sys.maxint # if sizeof(int) < sizeof(long), might trigger # ValueErrors instead of TypeErrors for metaclass in [type, types.ClassType]: for name, expr, iexpr in [ ('__add__', 'x + y', 'x += y'), ('__sub__', 'x - y', 'x -= y'), ('__mul__', 'x * y', 'x *= y'), ('__truediv__', 'operator.truediv(x, y)', None), ('__floordiv__', 'operator.floordiv(x, y)', None), ('__div__', 'x / y', 'x /= y'), ('__mod__', 'x % y', 'x %= y'), ('__divmod__', 'divmod(x, y)', None), ('__pow__', 'x ** y', 'x **= y'), ('__lshift__', 'x << y', 'x <<= y'), ('__rshift__', 'x >> y', 'x >>= y'), ('__and__', 'x & y', 'x &= y'), ('__or__', 'x | y', 'x |= y'), ('__xor__', 'x ^ y', 'x ^= y'), ('__coerce__', 'coerce(x, y)', None)]: if name == '__coerce__': rname = name else: rname = '__r' + name[2:] A = metaclass('A', (), {name: specialmethod}) B = metaclass('B', (), {rname: specialmethod}) a = A() b = B() check(expr, a, a) check(expr, a, b) check(expr, b, a) check(expr, b, b) check(expr, a, N1) check(expr, a, N2) check(expr, N1, b) check(expr, N2, b) if iexpr: check(iexpr, a, a) check(iexpr, a, b) check(iexpr, b, a) check(iexpr, b, b) check(iexpr, a, N1) check(iexpr, a, N2) iname = '__i' + name[2:] C = metaclass('C', (), {iname: specialmethod}) c = C() check(iexpr, c, a) check(iexpr, c, b) check(iexpr, c, N1) check(iexpr, c, N2) def test_assign_slice(self): # ceval.c's assign_slice used to check for # tp->tp_as_sequence->sq_slice instead of # tp->tp_as_sequence->sq_ass_slice class C(object): def __setslice__(self, start, stop, value): self.value = value c = C() c[1:2] = 3 self.assertEqual(c.value, 3) def test_set_and_no_get(self): # See # http://mail.python.org/pipermail/python-dev/2010-January/095637.html class Descr(object): def __init__(self, name): self.name = name def __set__(self, obj, value): obj.__dict__[self.name] = value descr = Descr("a") class X(object): a = descr x = X() self.assertIs(x.a, descr) x.a = 42 self.assertEqual(x.a, 42) # Also check type_getattro for correctness. class Meta(type): pass class X(object): __metaclass__ = Meta X.a = 42 Meta.a = Descr("a") self.assertEqual(X.a, 42) def test_getattr_hooks(self): # issue 4230 class Descriptor(object): counter = 0 def __get__(self, obj, objtype=None): def getter(name): self.counter += 1 raise AttributeError(name) return getter descr = Descriptor() class A(object): __getattribute__ = descr class B(object): __getattr__ = descr class C(object): __getattribute__ = descr __getattr__ = descr self.assertRaises(AttributeError, getattr, A(), "attr") self.assertEqual(descr.counter, 1) self.assertRaises(AttributeError, getattr, B(), "attr") self.assertEqual(descr.counter, 2) self.assertRaises(AttributeError, getattr, C(), "attr") self.assertEqual(descr.counter, 4) import gc class EvilGetattribute(object): # This used to segfault def __getattr__(self, name): raise AttributeError(name) def __getattribute__(self, name): del EvilGetattribute.__getattr__ for i in range(5): gc.collect() raise AttributeError(name) self.assertRaises(AttributeError, getattr, EvilGetattribute(), "attr") def test_abstractmethods(self): # type pretends not to have __abstractmethods__. self.assertRaises(AttributeError, getattr, type, "__abstractmethods__") class meta(type): pass self.assertRaises(AttributeError, getattr, meta, "__abstractmethods__") class X(object): pass with self.assertRaises(AttributeError): del X.__abstractmethods__ def test_proxy_call(self): class FakeStr(object): __class__ = str fake_str = FakeStr() # isinstance() reads __class__ on new style classes self.assertTrue(isinstance(fake_str, str)) # call a method descriptor with self.assertRaises(TypeError): str.split(fake_str) # call a slot wrapper descriptor try: r = str.__add__(fake_str, "abc") except TypeError: pass else: self.assertEqual(r, NotImplemented) def test_repr_as_str(self): # Issue #11603: crash or infinite loop when rebinding __str__ as # __repr__. class Foo(object): pass Foo.__repr__ = Foo.__str__ foo = Foo() # Behavior will change in CPython 2.7.4. # PyPy already does the right thing here. self.assertRaises(RuntimeError, str, foo) self.assertRaises(RuntimeError, repr, foo) class DictProxyTests(unittest.TestCase): def setUp(self): class C(object): def meth(self): pass self.C = C def test_repr(self): if test_support.check_impl_detail(): self.assertIn('dict_proxy({', repr(vars(self.C))) self.assertIn("'meth':", repr(vars(self.C))) def test_iter_keys(self): # Testing dict-proxy iterkeys... keys = [ key for key in self.C.__dict__.iterkeys() ] keys.sort() self.assertEqual(keys, ['__dict__', '__doc__', '__module__', '__weakref__', 'meth']) def test_iter_values(self): # Testing dict-proxy itervalues... values = [ values for values in self.C.__dict__.itervalues() ] self.assertEqual(len(values), 5) def test_iter_items(self): # Testing dict-proxy iteritems... keys = [ key for (key, value) in self.C.__dict__.iteritems() ] keys.sort() self.assertEqual(keys, ['__dict__', '__doc__', '__module__', '__weakref__', 'meth']) def test_dict_type_with_metaclass(self): # Testing type of __dict__ when __metaclass__ set... class B(object): pass class M(type): pass class C: # In 2.3a1, C.__dict__ was a real dict rather than a dict proxy __metaclass__ = M self.assertEqual(type(C.__dict__), type(B.__dict__)) class PTypesLongInitTest(unittest.TestCase): # This is in its own TestCase so that it can be run before any other tests. def test_pytype_long_ready(self): # Testing SF bug 551412 ... # This dumps core when SF bug 551412 isn't fixed -- # but only when test_descr.py is run separately. # (That can't be helped -- as soon as PyType_Ready() # is called for PyLong_Type, the bug is gone.) class UserLong(object): def __pow__(self, *args): pass try: pow(0L, UserLong(), 0L) except: pass # Another segfault only when run early # (before PyType_Ready(tuple) is called) type.mro(tuple) def test_main(): deprecations = [(r'complex divmod\(\), // and % are deprecated$', DeprecationWarning)] if sys.py3kwarning: deprecations += [ ("classic (int|long) division", DeprecationWarning), ("coerce.. not supported", DeprecationWarning), (".+__(get|set|del)slice__ has been removed", DeprecationWarning)] with test_support.check_warnings(*deprecations): # Run all local test cases, with PTypesLongInitTest first. test_support.run_unittest(PTypesLongInitTest, OperatorsTest, ClassPropertiesAndMethods, DictProxyTests) if __name__ == "__main__": test_main()
bsd-3-clause
3,209,045,106,295,119,400
33.004261
92
0.479413
false
ClaudiaSaxer/PlasoScaffolder
src/plasoscaffolder/model/sql_query_model.py
1
1280
# -*- coding: utf-8 -*- """The SQL query model class.""" from plasoscaffolder.model import sql_query_column_model_data from plasoscaffolder.model import sql_query_column_model_timestamp class SQLQueryModel(object): """A SQL query model.""" def __init__( self, query: str, name: str, columns: [sql_query_column_model_data.SQLColumnModelData], timestamp_columns: [ sql_query_column_model_timestamp.SQLColumnModelTimestamp], needs_customizing: bool, amount_events: int ): """ initializes the SQL query model. Args: columns ([sql_query_column_model_data.SQLColumnModelData]): list of columns for the Query timestamp_columns ([ sql_query_column_model_timestamp.SQLColumnModelTimestamp]): list of columns which are timestamp events name (str): The name of the Query. query (str): The SQL query. needs_customizing (bool): if the event for the query needs customizing amount_events (int): amount of events as result of the query """ super().__init__() self.name = name self.query = query self.columns = columns self.needs_customizing = needs_customizing self.timestamp_columns = timestamp_columns self.amount_events = amount_events
apache-2.0
-3,229,932,155,820,182,500
33.594595
77
0.673438
false
Eldinnie/ptbtest
examples/test_echobot2.py
1
3680
from __future__ import absolute_import import unittest from telegram.ext import CommandHandler from telegram.ext import Filters from telegram.ext import MessageHandler from telegram.ext import Updater from ptbtest import ChatGenerator from ptbtest import MessageGenerator from ptbtest import Mockbot from ptbtest import UserGenerator """ This is an example to show how the ptbtest suite can be used. This example follows the echobot2 example at: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot2.py """ class TestEchobot2(unittest.TestCase): def setUp(self): # For use within the tests we nee some stuff. Starting with a Mockbot self.bot = Mockbot() # Some generators for users and chats self.ug = UserGenerator() self.cg = ChatGenerator() # And a Messagegenerator and updater (for use with the bot.) self.mg = MessageGenerator(self.bot) self.updater = Updater(bot=self.bot) def test_help(self): # this tests the help handler. So first insert the handler def help(bot, update): update.message.reply_text('Help!') # Then register the handler with he updater's dispatcher and start polling self.updater.dispatcher.add_handler(CommandHandler("help", help)) self.updater.start_polling() # We want to simulate a message. Since we don't care wich user sends it we let the MessageGenerator # create random ones update = self.mg.get_message(text="/help") # We insert the update with the bot so the updater can retrieve it. self.bot.insertUpdate(update) # sent_messages is the list with calls to the bot's outbound actions. Since we hope the message we inserted # only triggered one sendMessage action it's length should be 1. self.assertEqual(len(self.bot.sent_messages), 1) sent = self.bot.sent_messages[0] self.assertEqual(sent['method'], "sendMessage") self.assertEqual(sent['text'], "Help!") # Always stop the updater at the end of a testcase so it won't hang. self.updater.stop() def test_start(self): def start(bot, update): update.message.reply_text('Hi!') self.updater.dispatcher.add_handler(CommandHandler("start", start)) self.updater.start_polling() # Here you can see how we would handle having our own user and chat user = self.ug.get_user(first_name="Test", last_name="The Bot") chat = self.cg.get_chat(user=user) update = self.mg.get_message(user=user, chat=chat, text="/start") self.bot.insertUpdate(update) self.assertEqual(len(self.bot.sent_messages), 1) sent = self.bot.sent_messages[0] self.assertEqual(sent['method'], "sendMessage") self.assertEqual(sent['text'], "Hi!") self.updater.stop() def test_echo(self): def echo(bot, update): update.message.reply_text(update.message.text) self.updater.dispatcher.add_handler(MessageHandler(Filters.text, echo)) self.updater.start_polling() update = self.mg.get_message(text="first message") update2 = self.mg.get_message(text="second message") self.bot.insertUpdate(update) self.bot.insertUpdate(update2) self.assertEqual(len(self.bot.sent_messages), 2) sent = self.bot.sent_messages self.assertEqual(sent[0]['method'], "sendMessage") self.assertEqual(sent[0]['text'], "first message") self.assertEqual(sent[1]['text'], "second message") self.updater.stop() if __name__ == '__main__': unittest.main()
gpl-3.0
-2,721,112,711,893,849,600
40.348315
115
0.667663
false
joausaga/ideascaly
tests/test_api.py
1
10169
import os import unittest from tests.config import IdeascalyTestCase from ideascaly.models import Idea, Vote, Comment, Campaign, Author """Unit tests""" class IdeascalyAPITests(IdeascalyTestCase): # --- # Testing variables # --- campaign_id = 28416 idea_id_votes = 137010 idea_id_comments = 137010 idea_id_attachment = 139717 title_idea = "From the TestCase of IdeaScaly" text_idea = "Hello from IdeaScaly!" text_comment = "From the TestCase of IdeaScaly!" comment_id = 773330 member_id = 691840 member_email = "[email protected]" member_name = "example" member_name_d = "donald" member_email_d = "[email protected]" member_id_ideas = 119840 member_id_votes = 119793 filename = str(os.path.join(os.path.dirname(__file__), 'pic.jpg')) # ---- # Test cases related with community actions # ---- def testget_all_ideas(self): result = self.api.get_all_ideas() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_all_votes_ideas(self): result = self.api.get_all_votes_ideas() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Vote)) def testget_all_votes_comments(self): result = self.api.get_all_votes_comments() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Vote)) def testget_all_comments(self): result = self.api.get_all_comments() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Comment)) def testget_all_members(self): result = self.api.get_all_members() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Author)) # ---- # Test cases related with campaign actions # ---- def testget_campaigns(self): result = self.api.get_campaigns() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Campaign)) def testget_active_ideas(self): result = self.api.get_active_ideas() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_archived_ideas(self): result = self.api.get_archived_ideas() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_ideas_campaign(self): result = self.api.get_ideas_campaign(self.campaign_id) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) # ---- # Test cases related with idea actions # ---- def testget_ideas_in_progress(self): result = self.api.get_ideas_in_progress() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_ideas_in_progress_pagination(self): result = self.api.get_ideas_in_progress(page_number=0, page_size=25, order_key='date-down') self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_ideas_in_progress_campaign(self): result = self.api.get_ideas_in_progress(campaign_id=self.campaign_id) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_ideas_complete(self): result = self.api.get_ideas_complete() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_ideas_in_review(self): result = self.api.get_ideas_in_review() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_votes_idea(self): result = self.api.get_votes_idea(ideaId=self.idea_id_votes) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Vote)) def testget_comments_idea(self): result = self.api.get_comments_idea(ideaId=self.idea_id_comments) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Comment)) def testget_idea_details(self): result = self.api.get_idea_details(self.idea_id_comments) self.assertTrue(isinstance(result, Idea)) def testget_top_ideas(self): result = self.api.get_top_ideas() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_recent_ideas(self): result = self.api.get_recent_ideas() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_hot_ideas(self): result = self.api.get_hot_ideas() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testcreate_and_delete_idea(self): result = self.api.create_idea(title=self.title_idea, text=self.text_idea, campaignId=self.campaign_id) self.assertTrue(isinstance(result, Idea)) result = self.api.delete_idea(ideaId=result.id) self.assertTrue(isinstance(result, Idea)) def testvote_up_idea(self): result = self.api.vote_up_idea(ideaId=self.idea_id_comments) self.assertTrue(isinstance(result, Vote)) def testvote_down_idea(self): result = self.api.vote_down_idea(ideaId=self.idea_id_votes) self.assertTrue(isinstance(result, Vote)) def testadd_comment_idea(self): result = self.api.comment_idea(ideaId=self.idea_id_comments, text=self.text_comment) self.assertTrue(isinstance(result, Comment)) def testattach_file_idea(self): result = self.api.attach_file_to_idea(filename=self.filename,ideaId=self.idea_id_attachment) self.assertTrue(isinstance(result, Idea)) # ---- # Test cases related with comment actions # ---- def testadd_and_delete_comment_comment(self): result = self.api.comment_comment(commentId=self.comment_id, text=self.text_comment) self.assertTrue(isinstance(result, Comment)) result = self.api.delete_comment(commentId=result.id) self.assertTrue(isinstance(result, Comment)) def testget_votes_comment(self): result = self.api.get_votes_comment(commentId=self.comment_id) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Vote)) def testget_votes_comments(self): result = self.api.get_votes_comments() self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Vote)) def testget_comment(self): result = self.api.get_comment(commentId=self.comment_id) self.assertEqual(type(result), Comment) def testget_all_comments_pagination(self): result = self.api.get_all_comments(page_number=0, page_size=25) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Comment)) # ----- # Test cases related with member actions # ----- def testcreate_new_member(self): result = self.api.create_new_member(name="me", email="[email protected]") self.assertTrue(isinstance(result, Author)) def testcreate_new_member_silent(self): result = self.api.create_new_member(name="Pato Donald", email="[email protected]", silent=True) self.assertTrue(isinstance(result, Author)) def testget_member_info_by_id(self): result = self.api.get_member_info_by_id(memberId=self.member_id) self.assertTrue(isinstance(result, Author)) self.assertEqual(result.email,self.member_email) def testget_member_info_by_name(self): result = self.api.get_member_info_by_name(name=self.member_name_d) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Author)) self.assertEqual(result[0].email,self.member_email_d) def testget_member_info_by_email(self): result = self.api.get_member_info_by_email(email=self.member_email) self.assertTrue(isinstance(result, Author)) self.assertEqual(result.name,self.member_name) def testget_member_ideas(self): result = self.api.get_member_ideas(memberId=self.member_id_ideas) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_member_ideas_pagination(self): result = self.api.get_member_ideas(memberId=self.member_id_ideas, page_number=0, page_size=25) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Idea)) def testget_member_comments_votes(self): result = self.api.get_votes_comments_member(memberId=self.member_id_votes) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Vote)) def testget_member_ideas_votes(self): result = self.api.get_votes_ideas_member(memberId=self.member_id_votes) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Vote)) def testget_member_comments(self): result = self.api.get_comments_member(memberId=self.member_id_ideas) self.assertEqual(type(result), type([])) if len(result) > 0: self.assertTrue(isinstance(result[0], Comment)) def testattach_image_member_avatar(self): result = self.api.attach_avatar_to_member(filename=self.filename, memberId=self.member_id_votes) self.assertTrue('url' in result.keys()) if __name__ == '__main__': unittest.main()
mit
-5,910,061,119,133,144,000
39.193676
110
0.653358
false
jastarex/DeepLearningCourseCodes
01_TF_basics_and_linear_regression/tensorflow_basic.py
1
8932
# coding: utf-8 # # TensorFlow基础 # In this tutorial, we are going to learn some basics in TensorFlow. # ## Session # Session is a class for running TensorFlow operations. A Session object encapsulates the environment in which Operation objects are executed, and Tensor objects are evaluated. In this tutorial, we will use a session to print out the value of tensor. Session can be used as follows: # In[1]: import tensorflow as tf a = tf.constant(100) with tf.Session() as sess: print sess.run(a) #syntactic sugar print a.eval() # or sess = tf.Session() print sess.run(a) # print a.eval() # this will print out an error # ## Interactive session # Interactive session is a TensorFlow session for use in interactive contexts, such as a shell. The only difference with a regular Session is that an Interactive session installs itself as the default session on construction. The methods [Tensor.eval()](https://www.tensorflow.org/versions/r0.11/api_docs/python/framework.html#Tensor) and [Operation.run()](https://www.tensorflow.org/versions/r0.11/api_docs/python/framework.html#Operation) will use that session to run ops.This is convenient in interactive shells and IPython notebooks, as it avoids having to pass an explicit Session object to run ops. # In[2]: sess = tf.InteractiveSession() print a.eval() # simple usage # ## Constants # We can use the `help` function to get an annotation about any function. Just type `help(tf.consant)` on the below cell and run it. # It will print out `constant(value, dtype=None, shape=None, name='Const')` at the top. Value of tensor constant can be scalar, matrix or tensor (more than 2-dimensional matrix). Also, you can get a shape of tensor by running [tensor.get_shape()](https://www.tensorflow.org/versions/r0.11/api_docs/python/framework.html#Tensor)`.as_list()`. # # * tensor.get_shape() # * tensor.get_shape().as_list() # In[3]: a = tf.constant([[1, 2, 3], [4, 5, 6]], dtype=tf.float32, name='a') print a.eval() print "shape: ", a.get_shape(), ",type: ", type(a.get_shape()) print "shape: ", a.get_shape().as_list(), ",type: ", type(a.get_shape().as_list()) # this is more useful # ## Basic functions # There are some basic functions we need to know. Those functions will be used in next tutorial **3. feed_forward_neural_network**. # * tf.argmax # * tf.reduce_sum # * tf.equal # * tf.random_normal # #### tf.argmax # `tf.argmax(input, dimension, name=None)` returns the index with the largest value across dimensions of a tensor. # # In[4]: a = tf.constant([[1, 6, 5], [2, 3, 4]]) print a.eval() print "argmax over axis 0" print tf.argmax(a, 0).eval() print "argmax over axis 1" print tf.argmax(a, 1).eval() # #### tf.reduce_sum # `tf.reduce_sum(input_tensor, reduction_indices=None, keep_dims=False, name=None)` computes the sum of elements across dimensions of a tensor. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in reduction_indices. If `keep_dims` is true, the reduced dimensions are retained with length 1. If `reduction_indices` has no entries, all dimensions are reduced, and a tensor with a single element is returned # In[5]: a = tf.constant([[1, 1, 1], [2, 2, 2]]) print a.eval() print "reduce_sum over entire matrix" print tf.reduce_sum(a).eval() print "reduce_sum over axis 0" print tf.reduce_sum(a, 0).eval() print "reduce_sum over axis 0 + keep dimensions" print tf.reduce_sum(a, 0, keep_dims=True).eval() print "reduce_sum over axis 1" print tf.reduce_sum(a, 1).eval() print "reduce_sum over axis 1 + keep dimensions" print tf.reduce_sum(a, 1, keep_dims=True).eval() # #### tf.equal # `tf.equal(x, y, name=None)` returns the truth value of `(x == y)` element-wise. Note that `tf.equal` supports broadcasting. For more about broadcasting, please see [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html). # In[6]: a = tf.constant([[1, 0, 0], [0, 1, 1]]) print a.eval() print "Equal to 1?" print tf.equal(a, 1).eval() print "Not equal to 1?" print tf.not_equal(a, 1).eval() # #### tf.random_normal # `tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)` outputs random values from a normal distribution. # # In[7]: normal = tf.random_normal([3], stddev=0.1) print normal.eval() # ## Variables # When we train a model, we use variables to hold and update parameters. Variables are in-memory buffers containing tensors. They must be explicitly initialized and can be saved to disk during and after training. we can later restore saved values to exercise or analyze the model. # # * tf.Variable # * tf.Tensor.name # * tf.all_variables # # #### tf.Variable # `tf.Variable(initial_value=None, trainable=True, name=None, variable_def=None, dtype=None)` creates a new variable with value `initial_value`. # The new variable is added to the graph collections listed in collections, which defaults to `[GraphKeys.VARIABLES]`. If `trainable` is true, the variable is also added to the graph collection `GraphKeys.TRAINABLE_VARIABLES`. # In[8]: # variable will be initialized with normal distribution var = tf.Variable(tf.random_normal([3], stddev=0.1), name='var') print var.name tf.initialize_all_variables().run() print var.eval() # #### tf.Tensor.name # We can call `tf.Variable` and give the same name `my_var` more than once as seen below. Note that `var3.name` prints out `my_var_1:0` instead of `my_var:0`. This is because TensorFlow doesn't allow user to create variables with the same name. In this case, TensorFlow adds `'_1'` to the original name instead of printing out an error message. Note that you should be careful not to call `tf.Variable` giving same name more than once, because it will cause a fatal problem when you save and restore the variables. # In[9]: var2 = tf.Variable(tf.random_normal([2, 3], stddev=0.1), name='my_var') var3 = tf.Variable(tf.random_normal([2, 3], stddev=0.1), name='my_var') print var2.name print var3.name # #### tf.all_variables # Using `tf.all_variables()`, we can get the names of all existing variables as follows: # In[10]: for var in tf.all_variables(): print var.name # ## Sharing variables # TensorFlow provides several classes and operations that you can use to create variables contingent on certain conditions. # * tf.get_variable # * tf.variable_scope # * reuse_variables # #### tf.get_variable # `tf.get_variable(name, shape=None, dtype=None, initializer=None, trainable=True)` is used to get or create a variable instead of a direct call to `tf.Variable`. It uses an initializer instead of passing the value directly, as in `tf.Variable`. An initializer is a function that takes the shape and provides a tensor with that shape. Here are some initializers available in TensorFlow: # # * `tf.constant_initializer(value)` initializes everything to the provided value, # * `tf.random_uniform_initializer(a, b)` initializes uniformly from [a, b], # * `tf.random_normal_initializer(mean, stddev)` initializes from the normal distribution with the given mean and standard deviation. # In[11]: my_initializer = tf.random_normal_initializer(mean=0, stddev=0.1) v = tf.get_variable('v', shape=[2, 3], initializer=my_initializer) tf.initialize_all_variables().run() print v.eval() # #### tf.variable_scope # `tf.variable_scope(scope_name)` manages namespaces for names passed to `tf.get_variable`. # In[12]: with tf.variable_scope('layer1'): w = tf.get_variable('v', shape=[2, 3], initializer=my_initializer) print w.name with tf.variable_scope('layer2'): w = tf.get_variable('v', shape=[2, 3], initializer=my_initializer) print w.name # #### reuse_variables # Note that you should run the cell above only once. If you run the code above more than once, an error message will be printed out: `"ValueError: Variable layer1/v already exists, disallowed."`. This is because we used `tf.get_variable` above, and this function doesn't allow creating variables with the existing names. We can solve this problem by using `scope.reuse_variables()` to get preivously created variables instead of creating new ones. # In[13]: with tf.variable_scope('layer1', reuse=True): w = tf.get_variable('v') # Unlike above, we don't need to specify shape and initializer print w.name # or with tf.variable_scope('layer1') as scope: scope.reuse_variables() w = tf.get_variable('v') print w.name # ## Place holder # TensorFlow provides a placeholder operation that must be fed with data on execution. If you want to get more details about placeholder, please see [here](https://www.tensorflow.org/versions/r0.11/api_docs/python/io_ops.html#placeholder). # In[14]: x = tf.placeholder(tf.int16) y = tf.placeholder(tf.int16) add = tf.add(x, y) mul = tf.mul(x, y) # Launch default graph. print "2 + 3 = %d" % sess.run(add, feed_dict={x: 2, y: 3}) print "3 x 4 = %d" % sess.run(mul, feed_dict={x: 3, y: 4})
apache-2.0
-5,786,797,328,990,342,000
39.035874
604
0.716174
false
raphaelvalentin/Utils
functions/system.py
1
3297
import re, time, os, shutil, string from subprocess import Popen, PIPE, STDOUT from random import randint, seed __all__ = ['find', 'removedirs', 'source', 'tempfile', 'copy', 'rm', 'template, template_dir'] def find(path='.', regex='*', ctime=0): r = [] regex = str(regex).strip() if regex == '*': regex = '' now = time.time() for filename in os.listdir(path): try: if re.search(regex, filename): tmtime = os.path.getmtime(os.path.join(path, filename)) if ctime>0 and int((now-tmtime)/3600/24) > ctime: r.append(os.path.join(path, filename)) elif ctime<0 and int((now-tmtime)/3600/24) < ctime: r.append(os.path.join(path, filename)) elif ctime==0: r.append(os.path.join(path, filename)) except: pass return r def rm(*files): # for i, file in enumerate(files): # try: # os.system('/bin/rm -rf %s > /dev/null 2>&1'%file) # except: # pass # more pythonic for src in files: try: if os.path.isdir(src): shutil.rmtree(src) else: os.remove(src) except OSError as e: print('%s not removed. Error: %s'%(src, e)) def removedirs(*args): print 'Deprecated: use rm' rm(*args) def source(filename): cmd = "source {filename}; env".format(filename=filename) p = Popen(cmd, executable='/bin/tcsh', stdout=PIPE, stderr=STDOUT, shell=True, env=os.environ) stdout = p.communicate()[0].splitlines() for line in stdout: if re.search('[0-9a-zA-Z_-]+=\S+', line): key, value = line.split("=", 1) os.environ[key] = value def copy(src, dest, force=False): try: if force and os.path.isdir(dest): # not good for speed rm(dest) shutil.copytree(src, dest) except OSError as e: # if src is not a directory if e.errno == errno.ENOTDIR: shutil.copy(src, dest) else: print('%s not copied. Error: %s'%(src, e)) def template(src, dest, substitute={}): with open(src) as f: s = string.Template(f.read()) o = s.safe_substitute(substitute) with open(dest, 'w') as g: g.write(o) def template_dir(src, dest, substitute={}): if src<>dest: copy(src, dest, force=True) for root, subdirs, files in os.walk(dest): file_path = os.path.join(dest, filename) s = template(file_path, file_path, substitute) class tempfile: letters = "ABCDEFGHIJLKMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" tempdir = '/tmp/' seed() @staticmethod def randstr(n=10): return "".join(tempfile.letters[randint(0,len(tempfile.letters)-1)] for i in xrange(n)) @staticmethod def mkdtemp(prefix='', suffix=''): n = 7 i = 0 while 1: try: path = os.path.join(tempfile.tempdir, prefix + tempfile.randstr(n) + suffix) os.mkdir(path) return path except OSError: i = i + 1 if i%10==0: n = n + 1 if n > 12: raise OSError('cannot create a temporary directory')
gpl-2.0
-3,907,913,281,986,276,000
29.813084
98
0.544738
false
rlouf/patterns-of-segregation
bin/plot_gini.py
1
2527
"""plot_gini.py Plot the Gini of the income distribution as a function of the number of households in cities. """ from __future__ import division import csv import numpy as np import itertools from matplotlib import pylab as plt # # Parameters and functions # income_bins = [1000,12500,17500,22500,27500,32500,37500,42500,47500,55000,70000,90000,115000,135000,175000,300000] # Puerto-rican cities are excluded from the analysis PR_cities = ['7442','0060','6360','4840'] # # Read data # ## List of MSA msa = {} with open('data/names/msa.csv', 'r') as source: reader = csv.reader(source, delimiter='\t') reader.next() for rows in reader: if rows[0] not in PR_cities: msa[rows[0]] = rows[1] # # Compute gini for all msa # gini = [] households = [] for n, city in enumerate(msa): print "Compute Gini index for %s (%s/%s)"%(msa[city], n+1, len(msa)) ## Import households income data = {} with open('data/income/msa/%s/income.csv'%city, 'r') as source: reader = csv.reader(source, delimiter='\t') reader.next() for rows in reader: num_cat = len(rows[1:]) data[rows[0]] = {c:int(h) for c,h in enumerate(rows[1:])} # Sum over all areal units incomes = {cat:sum([data[au][cat] for au in data]) for cat in range(num_cat)} ## Compute the Gini index # See Dixon, P. M.; Weiner, J.; Mitchell-Olds, T.; and Woodley, R. # "Bootstrapping the Gini Coefficient of Inequality." Ecology 68, 1548-1551, 1987. g = 0 pop = 0 for a,b in itertools.permutations(incomes, 2): g += incomes[a]*incomes[b]*abs(income_bins[a]-income_bins[b]) pop = sum([incomes[a] for a in incomes]) average = sum([incomes[a]*income_bins[a] for a in incomes])/pop gini.append((1/(2*pop**2*average))*g) households.append(pop) # # Plot # fig = plt.figure(figsize=(12,8)) ax = fig.add_subplot(111) ax.plot(households, gini, 'o', color='black', mec='black') ax.set_xlabel(r'$H$', fontsize=30) ax.set_ylabel(r'$Gini$', fontsize=30) ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) ax.spines['left'].set_position(('outward', 10)) # outward by 10 points ax.spines['bottom'].set_position(('outward', 10)) # outward by 10 points ax.spines['left'].set_smart_bounds(True) ax.spines['bottom'].set_smart_bounds(True) ax.yaxis.set_ticks_position('left') ax.xaxis.set_ticks_position('bottom') ax.set_xscale('log') plt.savefig('figures/paper/si/gini_income.pdf', bbox_inches='tight') plt.show()
bsd-3-clause
4,102,064,560,333,777,400
27.393258
114
0.651761
false
Jajcus/pyxmpp
pyxmpp/jabber/muccore.py
1
27807
# # (C) Copyright 2003-2010 Jacek Konieczny <[email protected]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # """Jabber Multi-User Chat implementation. Normative reference: - `JEP 45 <http://www.jabber.org/jeps/jep-0045.html>`__ """ __docformat__="restructuredtext en" import libxml2 from pyxmpp.utils import to_utf8,from_utf8 from pyxmpp.xmlextra import common_doc, common_root, common_ns, get_node_ns_uri from pyxmpp.presence import Presence from pyxmpp.iq import Iq from pyxmpp.jid import JID from pyxmpp import xmlextra from pyxmpp.objects import StanzaPayloadWrapperObject from pyxmpp.xmlextra import xml_element_iter MUC_NS="http://jabber.org/protocol/muc" MUC_USER_NS=MUC_NS+"#user" MUC_ADMIN_NS=MUC_NS+"#admin" MUC_OWNER_NS=MUC_NS+"#owner" affiliations=("admin","member","none","outcast","owner") roles=("moderator","none","participant","visitor") class MucXBase(StanzaPayloadWrapperObject): """ Base class for MUC-specific stanza payload - wrapper around an XML element. :Ivariables: - `xmlnode`: the wrapped XML node """ element="x" ns=None def __init__(self, xmlnode=None, copy=True, parent=None): """ Copy MucXBase object or create a new one, possibly based on or wrapping an XML node. :Parameters: - `xmlnode`: is the object to copy or an XML node to wrap. - `copy`: when `True` a copy of the XML node provided will be included in `self`, the node will be copied otherwise. - `parent`: parent node for the created/copied XML element. :Types: - `xmlnode`: `MucXBase` or `libxml2.xmlNode` - `copy`: `bool` - `parent`: `libxml2.xmlNode` """ if self.ns==None: raise RuntimeError,"Pure virtual class called" self.xmlnode=None self.borrowed=False if isinstance(xmlnode,libxml2.xmlNode): if copy: self.xmlnode=xmlnode.docCopyNode(common_doc,1) common_root.addChild(self.xmlnode) else: self.xmlnode=xmlnode self.borrowed=True if copy: ns=xmlnode.ns() xmlextra.replace_ns(self.xmlnode, ns, common_ns) elif isinstance(xmlnode,MucXBase): if not copy: raise TypeError, "MucXBase may only be copied" self.xmlnode=xmlnode.xmlnode.docCopyNode(common_doc,1) common_root.addChild(self.xmlnode) elif xmlnode is not None: raise TypeError, "Bad MucX constructor argument" else: if parent: self.xmlnode=parent.newChild(None,self.element,None) self.borrowed=True else: self.xmlnode=common_root.newChild(None,self.element,None) ns=self.xmlnode.newNs(self.ns,None) self.xmlnode.setNs(ns) def __del__(self): if self.xmlnode: self.free() def free(self): """ Unlink and free the XML node owned by `self`. """ if not self.borrowed: self.xmlnode.unlinkNode() self.xmlnode.freeNode() self.xmlnode=None def free_borrowed(self): """ Detach the XML node borrowed by `self`. """ self.xmlnode=None def xpath_eval(self,expr): """ Evaluate XPath expression in context of `self.xmlnode`. :Parameters: - `expr`: the XPath expression :Types: - `expr`: `unicode` :return: the result of the expression evaluation. :returntype: list of `libxml2.xmlNode` """ ctxt = common_doc.xpathNewContext() ctxt.setContextNode(self.xmlnode) ctxt.xpathRegisterNs("muc",self.ns.getContent()) ret=ctxt.xpathEval(to_utf8(expr)) ctxt.xpathFreeContext() return ret def serialize(self): """ Serialize `self` as XML. :return: serialized `self.xmlnode`. :returntype: `str` """ return self.xmlnode.serialize() class MucX(MucXBase): """ Wrapper for http://www.jabber.org/protocol/muc namespaced stanza payload "x" elements. """ ns=MUC_NS def __init__(self, xmlnode=None, copy=True, parent=None): MucXBase.__init__(self,xmlnode=xmlnode, copy=copy, parent=parent) def set_history(self, parameters): """ Set history parameters. Types: - `parameters`: `HistoryParameters` """ for child in xml_element_iter(self.xmlnode.children): if get_node_ns_uri(child) == MUC_NS and child.name == "history": child.unlinkNode() child.freeNode() break if parameters.maxchars and parameters.maxchars < 0: raise ValueError, "History parameter maxchars must be positive" if parameters.maxstanzas and parameters.maxstanzas < 0: raise ValueError, "History parameter maxstanzas must be positive" if parameters.maxseconds and parameters.maxseconds < 0: raise ValueError, "History parameter maxseconds must be positive" hnode=self.xmlnode.newChild(self.xmlnode.ns(), "history", None) if parameters.maxchars is not None: hnode.setProp("maxchars", str(parameters.maxchars)) if parameters.maxstanzas is not None: hnode.setProp("maxstanzas", str(parameters.maxstanzas)) if parameters.maxseconds is not None: hnode.setProp("maxseconds", str(parameters.maxseconds)) if parameters.since is not None: hnode.setProp("since", parameters.since.strftime("%Y-%m-%dT%H:%M:%SZ")) def get_history(self): """Return history parameters carried by the stanza. :returntype: `HistoryParameters`""" for child in xml_element_iter(self.xmlnode.children): if get_node_ns_uri(child) == MUC_NS and child.name == "history": maxchars = from_utf8(child.prop("maxchars")) if maxchars is not None: maxchars = int(maxchars) maxstanzas = from_utf8(child.prop("maxstanzas")) if maxstanzas is not None: maxstanzas = int(maxstanzas) maxseconds = from_utf8(child.prop("maxseconds")) if maxseconds is not None: maxseconds = int(maxseconds) # TODO: since -- requires parsing of Jabber dateTime profile since = None return HistoryParameters(maxchars, maxstanzas, maxseconds, since) def set_password(self, password): """Set password for the MUC request. :Parameters: - `password`: password :Types: - `password`: `unicode`""" for child in xml_element_iter(self.xmlnode.children): if get_node_ns_uri(child) == MUC_NS and child.name == "password": child.unlinkNode() child.freeNode() break if password is not None: self.xmlnode.newTextChild(self.xmlnode.ns(), "password", to_utf8(password)) def get_password(self): """Get password from the MUC request. :returntype: `unicode` """ for child in xml_element_iter(self.xmlnode.children): if get_node_ns_uri(child) == MUC_NS and child.name == "password": return from_utf8(child.getContent()) return None class HistoryParameters(object): """Provides parameters for MUC history management :Ivariables: - `maxchars`: limit of the total number of characters in history. - `maxstanzas`: limit of the total number of messages in history. - `seconds`: send only messages received in the last `seconds` seconds. - `since`: Send only the messages received since the dateTime (UTC) specified. :Types: - `maxchars`: `int` - `maxstanzas`: `int` - `seconds`: `int` - `since`: `datetime.datetime` """ def __init__(self, maxchars = None, maxstanzas = None, maxseconds = None, since = None): """Initializes a `HistoryParameters` object. :Parameters: - `maxchars`: limit of the total number of characters in history. - `maxstanzas`: limit of the total number of messages in history. - `maxseconds`: send only messages received in the last `seconds` seconds. - `since`: Send only the messages received since the dateTime specified. :Types: - `maxchars`: `int` - `maxstanzas`: `int` - `maxseconds`: `int` - `since`: `datetime.datetime` """ self.maxchars = maxchars self.maxstanzas = maxstanzas self.maxseconds = maxseconds self.since = since class MucItemBase(object): """ Base class for <status/> and <item/> element wrappers. """ def __init__(self): if self.__class__ is MucItemBase: raise RuntimeError,"Abstract class called" class MucItem(MucItemBase): """ MUC <item/> element -- describes a room occupant. :Ivariables: - `affiliation`: affiliation of the user. - `role`: role of the user. - `jid`: JID of the user. - `nick`: nickname of the user. - `actor`: actor modyfying the user data. - `reason`: reason of change of the user data. :Types: - `affiliation`: `str` - `role`: `str` - `jid`: `JID` - `nick`: `unicode` - `actor`: `JID` - `reason`: `unicode` """ def __init__(self,xmlnode_or_affiliation,role=None,jid=None,nick=None,actor=None,reason=None): """ Initialize a `MucItem` object. :Parameters: - `xmlnode_or_affiliation`: XML node to be pased or the affiliation of the user being described. - `role`: role of the user. - `jid`: JID of the user. - `nick`: nickname of the user. - `actor`: actor modyfying the user data. - `reason`: reason of change of the user data. :Types: - `xmlnode_or_affiliation`: `libxml2.xmlNode` or `str` - `role`: `str` - `jid`: `JID` - `nick`: `unicode` - `actor`: `JID` - `reason`: `unicode` """ self.jid,self.nick,self.actor,self.affiliation,self.reason,self.role=(None,)*6 MucItemBase.__init__(self) if isinstance(xmlnode_or_affiliation,libxml2.xmlNode): self.__from_xmlnode(xmlnode_or_affiliation) else: self.__init(xmlnode_or_affiliation,role,jid,nick,actor,reason) def __init(self,affiliation,role,jid=None,nick=None,actor=None,reason=None): """Initialize a `MucItem` object from a set of attributes. :Parameters: - `affiliation`: affiliation of the user. - `role`: role of the user. - `jid`: JID of the user. - `nick`: nickname of the user. - `actor`: actor modyfying the user data. - `reason`: reason of change of the user data. :Types: - `affiliation`: `str` - `role`: `str` - `jid`: `JID` - `nick`: `unicode` - `actor`: `JID` - `reason`: `unicode` """ if not affiliation: affiliation=None elif affiliation not in affiliations: raise ValueError,"Bad affiliation" self.affiliation=affiliation if not role: role=None elif role not in roles: raise ValueError,"Bad role" self.role=role if jid: self.jid=JID(jid) else: self.jid=None if actor: self.actor=JID(actor) else: self.actor=None self.nick=nick self.reason=reason def __from_xmlnode(self, xmlnode): """Initialize a `MucItem` object from an XML node. :Parameters: - `xmlnode`: the XML node. :Types: - `xmlnode`: `libxml2.xmlNode` """ actor=None reason=None n=xmlnode.children while n: ns=n.ns() if ns and ns.getContent()!=MUC_USER_NS: continue if n.name=="actor": actor=n.getContent() if n.name=="reason": reason=n.getContent() n=n.next self.__init( from_utf8(xmlnode.prop("affiliation")), from_utf8(xmlnode.prop("role")), from_utf8(xmlnode.prop("jid")), from_utf8(xmlnode.prop("nick")), from_utf8(actor), from_utf8(reason), ); def as_xml(self,parent): """ Create XML representation of `self`. :Parameters: - `parent`: the element to which the created node should be linked to. :Types: - `parent`: `libxml2.xmlNode` :return: an XML node. :returntype: `libxml2.xmlNode` """ n=parent.newChild(None,"item",None) if self.actor: n.newTextChild(None,"actor",to_utf8(self.actor)) if self.reason: n.newTextChild(None,"reason",to_utf8(self.reason)) n.setProp("affiliation",to_utf8(self.affiliation)) if self.role: n.setProp("role",to_utf8(self.role)) if self.jid: n.setProp("jid",to_utf8(self.jid.as_unicode())) if self.nick: n.setProp("nick",to_utf8(self.nick)) return n class MucStatus(MucItemBase): """ MUC <item/> element - describes special meaning of a stanza :Ivariables: - `code`: staus code, as defined in JEP 45 :Types: - `code`: `int` """ def __init__(self,xmlnode_or_code): """Initialize a `MucStatus` element. :Parameters: - `xmlnode_or_code`: XML node to parse or a status code. :Types: - `xmlnode_or_code`: `libxml2.xmlNode` or `int` """ self.code=None MucItemBase.__init__(self) if isinstance(xmlnode_or_code,libxml2.xmlNode): self.__from_xmlnode(xmlnode_or_code) else: self.__init(xmlnode_or_code) def __init(self,code): """Initialize a `MucStatus` element from a status code. :Parameters: - `code`: the status code. :Types: - `code`: `int` """ code=int(code) if code<0 or code>999: raise ValueError,"Bad status code" self.code=code def __from_xmlnode(self, xmlnode): """Initialize a `MucStatus` element from an XML node. :Parameters: - `xmlnode`: XML node to parse. :Types: - `xmlnode`: `libxml2.xmlNode` """ self.code=int(xmlnode.prop("code")) def as_xml(self,parent): """ Create XML representation of `self`. :Parameters: - `parent`: the element to which the created node should be linked to. :Types: - `parent`: `libxml2.xmlNode` :return: an XML node. :returntype: `libxml2.xmlNode` """ n=parent.newChild(None,"status",None) n.setProp("code","%03i" % (self.code,)) return n class MucUserX(MucXBase): """ Wrapper for http://www.jabber.org/protocol/muc#user namespaced stanza payload "x" elements and usually containing information about a room user. :Ivariables: - `xmlnode`: wrapped XML node :Types: - `xmlnode`: `libxml2.xmlNode` """ ns=MUC_USER_NS def get_items(self): """Get a list of objects describing the content of `self`. :return: the list of objects. :returntype: `list` of `MucItemBase` (`MucItem` and/or `MucStatus`) """ if not self.xmlnode.children: return [] ret=[] n=self.xmlnode.children while n: ns=n.ns() if ns and ns.getContent()!=self.ns: pass elif n.name=="item": ret.append(MucItem(n)) elif n.name=="status": ret.append(MucStatus(n)) # FIXME: alt,decline,invite,password n=n.next return ret def clear(self): """ Clear the content of `self.xmlnode` removing all <item/>, <status/>, etc. """ if not self.xmlnode.children: return n=self.xmlnode.children while n: ns=n.ns() if ns and ns.getContent()!=MUC_USER_NS: pass else: n.unlinkNode() n.freeNode() n=n.next def add_item(self,item): """Add an item to `self`. :Parameters: - `item`: the item to add. :Types: - `item`: `MucItemBase` """ if not isinstance(item,MucItemBase): raise TypeError,"Bad item type for muc#user" item.as_xml(self.xmlnode) class MucOwnerX(MucXBase): """ Wrapper for http://www.jabber.org/protocol/muc#owner namespaced stanza payload "x" elements and usually containing information about a room user. :Ivariables: - `xmlnode`: wrapped XML node. :Types: - `xmlnode`: `libxml2.xmlNode` """ # FIXME: implement pass class MucAdminQuery(MucUserX): """ Wrapper for http://www.jabber.org/protocol/muc#admin namespaced IQ stanza payload "query" elements and usually describing administrative actions or their results. Not implemented yet. """ ns=MUC_ADMIN_NS element="query" class MucStanzaExt: """ Base class for MUC specific stanza extensions. Used together with one of stanza classes (Iq, Message or Presence). """ def __init__(self): """Initialize a `MucStanzaExt` derived object.""" if self.__class__ is MucStanzaExt: raise RuntimeError,"Abstract class called" self.xmlnode=None self.muc_child=None def get_muc_child(self): """ Get the MUC specific payload element. :return: the object describing the stanza payload in MUC namespace. :returntype: `MucX` or `MucUserX` or `MucAdminQuery` or `MucOwnerX` """ if self.muc_child: return self.muc_child if not self.xmlnode.children: return None n=self.xmlnode.children while n: if n.name not in ("x","query"): n=n.next continue ns=n.ns() if not ns: n=n.next continue ns_uri=ns.getContent() if (n.name,ns_uri)==("x",MUC_NS): self.muc_child=MucX(n) return self.muc_child if (n.name,ns_uri)==("x",MUC_USER_NS): self.muc_child=MucUserX(n) return self.muc_child if (n.name,ns_uri)==("query",MUC_ADMIN_NS): self.muc_child=MucAdminQuery(n) return self.muc_child if (n.name,ns_uri)==("query",MUC_OWNER_NS): self.muc_child=MucOwnerX(n) return self.muc_child n=n.next def clear_muc_child(self): """ Remove the MUC specific stanza payload element. """ if self.muc_child: self.muc_child.free_borrowed() self.muc_child=None if not self.xmlnode.children: return n=self.xmlnode.children while n: if n.name not in ("x","query"): n=n.next continue ns=n.ns() if not ns: n=n.next continue ns_uri=ns.getContent() if ns_uri in (MUC_NS,MUC_USER_NS,MUC_ADMIN_NS,MUC_OWNER_NS): n.unlinkNode() n.freeNode() n=n.next def make_muc_userinfo(self): """ Create <x xmlns="...muc#user"/> element in the stanza. :return: the element created. :returntype: `MucUserX` """ self.clear_muc_child() self.muc_child=MucUserX(parent=self.xmlnode) return self.muc_child def make_muc_admin_quey(self): """ Create <query xmlns="...muc#admin"/> element in the stanza. :return: the element created. :returntype: `MucAdminQuery` """ self.clear_muc_child() self.muc_child=MucAdminQuery(parent=self.xmlnode) return self.muc_child def muc_free(self): """ Free MUC specific data. """ if self.muc_child: self.muc_child.free_borrowed() class MucPresence(Presence,MucStanzaExt): """ Extend `Presence` with MUC related interface. """ def __init__(self, xmlnode=None,from_jid=None,to_jid=None,stanza_type=None,stanza_id=None, show=None,status=None,priority=0,error=None,error_cond=None): """Initialize a `MucPresence` object. :Parameters: - `xmlnode`: XML node to_jid be wrapped into the `MucPresence` object or other Presence object to be copied. If not given then new presence stanza is created using following parameters. - `from_jid`: sender JID. - `to_jid`: recipient JID. - `stanza_type`: staza type: one of: None, "available", "unavailable", "subscribe", "subscribed", "unsubscribe", "unsubscribed" or "error". "available" is automaticaly changed to_jid None. - `stanza_id`: stanza id -- value of stanza's "id" attribute - `show`: "show" field of presence stanza. One of: None, "away", "xa", "dnd", "chat". - `status`: descriptive text for the presence stanza. - `priority`: presence priority. - `error_cond`: error condition name. Ignored if `stanza_type` is not "error" :Types: - `xmlnode`: `unicode` or `libxml2.xmlNode` or `pyxmpp.stanza.Stanza` - `from_jid`: `JID` - `to_jid`: `JID` - `stanza_type`: `unicode` - `stanza_id`: `unicode` - `show`: `unicode` - `status`: `unicode` - `priority`: `unicode` - `error_cond`: `unicode`""" MucStanzaExt.__init__(self) Presence.__init__(self,xmlnode,from_jid=from_jid,to_jid=to_jid, stanza_type=stanza_type,stanza_id=stanza_id, show=show,status=status,priority=priority, error=error,error_cond=error_cond) def copy(self): """ Return a copy of `self`. """ return MucPresence(self) def make_join_request(self, password = None, history_maxchars = None, history_maxstanzas = None, history_seconds = None, history_since = None): """ Make the presence stanza a MUC room join request. :Parameters: - `password`: password to the room. - `history_maxchars`: limit of the total number of characters in history. - `history_maxstanzas`: limit of the total number of messages in history. - `history_seconds`: send only messages received in the last `seconds` seconds. - `history_since`: Send only the messages received since the dateTime specified (UTC). :Types: - `password`: `unicode` - `history_maxchars`: `int` - `history_maxstanzas`: `int` - `history_seconds`: `int` - `history_since`: `datetime.datetime` """ self.clear_muc_child() self.muc_child=MucX(parent=self.xmlnode) if (history_maxchars is not None or history_maxstanzas is not None or history_seconds is not None or history_since is not None): history = HistoryParameters(history_maxchars, history_maxstanzas, history_seconds, history_since) self.muc_child.set_history(history) if password is not None: self.muc_child.set_password(password) def get_join_info(self): """If `self` is a MUC room join request return the information contained. :return: the join request details or `None`. :returntype: `MucX` """ x=self.get_muc_child() if not x: return None if not isinstance(x,MucX): return None return x def free(self): """Free the data associated with this `MucPresence` object.""" self.muc_free() Presence.free(self) class MucIq(Iq,MucStanzaExt): """ Extend `Iq` with MUC related interface. """ def __init__(self,xmlnode=None,from_jid=None,to_jid=None,stanza_type=None,stanza_id=None, error=None,error_cond=None): """Initialize an `Iq` object. :Parameters: - `xmlnode`: XML node to_jid be wrapped into the `Iq` object or other Iq object to be copied. If not given then new presence stanza is created using following parameters. - `from_jid`: sender JID. - `to_jid`: recipient JID. - `stanza_type`: staza type: one of: "get", "set", "result" or "error". - `stanza_id`: stanza id -- value of stanza's "id" attribute. If not given, then unique for the session value is generated. - `error_cond`: error condition name. Ignored if `stanza_type` is not "error". :Types: - `xmlnode`: `unicode` or `libxml2.xmlNode` or `Iq` - `from_jid`: `JID` - `to_jid`: `JID` - `stanza_type`: `unicode` - `stanza_id`: `unicode` - `error_cond`: `unicode`""" MucStanzaExt.__init__(self) Iq.__init__(self,xmlnode,from_jid=from_jid,to_jid=to_jid, stanza_type=stanza_type,stanza_id=stanza_id, error=error,error_cond=error_cond) def copy(self): """ Return a copy of `self`. """ return MucIq(self) def make_kick_request(self,nick,reason): """ Make the iq stanza a MUC room participant kick request. :Parameters: - `nick`: nickname of user to kick. - `reason`: reason of the kick. :Types: - `nick`: `unicode` - `reason`: `unicode` :return: object describing the kick request details. :returntype: `MucItem` """ self.clear_muc_child() self.muc_child=MucAdminQuery(parent=self.xmlnode) item=MucItem("none","none",nick=nick,reason=reason) self.muc_child.add_item(item) return self.muc_child def free(self): """Free the data associated with this `MucIq` object.""" self.muc_free() Iq.free(self) # vi: sts=4 et sw=4
lgpl-2.1
7,984,173,956,908,392,000
33.035496
98
0.559104
false
mozilla/zamboni
mkt/site/monitors.py
1
8772
import os import socket import StringIO import tempfile import time import traceback from django.conf import settings import commonware.log import elasticsearch import requests from cache_nuggets.lib import memoize from PIL import Image from lib.crypto import packaged, receipt from lib.crypto.packaged import SigningError as PackageSigningError from lib.crypto.receipt import SigningError from mkt.site.storage_utils import local_storage monitor_log = commonware.log.getLogger('z.monitor') def memcache(): memcache = getattr(settings, 'CACHES', {}).get('default') memcache_results = [] status = '' if memcache and 'memcache' in memcache['BACKEND']: hosts = memcache['LOCATION'] using_twemproxy = False if not isinstance(hosts, (tuple, list)): hosts = [hosts] for host in hosts: ip, port = host.split(':') if ip == '127.0.0.1': using_twemproxy = True try: s = socket.socket() s.connect((ip, int(port))) except Exception, e: result = False status = 'Failed to connect to memcached (%s): %s' % (host, e) monitor_log.critical(status) else: result = True finally: s.close() memcache_results.append((ip, port, result)) if (not using_twemproxy and len(hosts) > 1 and len(memcache_results) < 2): # If the number of requested hosts is greater than 1, but less # than 2 replied, raise an error. status = ('2+ memcache servers are required.' '%s available') % len(memcache_results) monitor_log.warning(status) # If we are in debug mode, don't worry about checking for memcache. elif settings.DEBUG: return status, [] if not memcache_results: status = 'Memcache is not configured' monitor_log.info(status) return status, memcache_results def libraries(): # Check Libraries and versions libraries_results = [] status = '' try: Image.new('RGB', (16, 16)).save(StringIO.StringIO(), 'JPEG') libraries_results.append(('PIL+JPEG', True, 'Got it!')) except Exception, e: msg = "Failed to create a jpeg image: %s" % e libraries_results.append(('PIL+JPEG', False, msg)) try: import M2Crypto # NOQA libraries_results.append(('M2Crypto', True, 'Got it!')) except ImportError: libraries_results.append(('M2Crypto', False, 'Failed to import')) if settings.SPIDERMONKEY: if os.access(settings.SPIDERMONKEY, os.R_OK): libraries_results.append(('Spidermonkey is ready!', True, None)) # TODO: see if it works? else: msg = "You said spidermonkey was at (%s)" % settings.SPIDERMONKEY libraries_results.append(('Spidermonkey', False, msg)) # If settings are debug and spidermonkey is empty, # thorw this error. elif settings.DEBUG and not settings.SPIDERMONKEY: msg = 'SPIDERMONKEY is empty' libraries_results.append(('Spidermonkey', True, msg)) else: msg = "Please set SPIDERMONKEY in your settings file." libraries_results.append(('Spidermonkey', False, msg)) missing_libs = [l for l, s, m in libraries_results if not s] if missing_libs: status = 'missing libs: %s' % ",".join(missing_libs) return status, libraries_results def elastic(): es = elasticsearch.Elasticsearch(hosts=settings.ES_HOSTS) elastic_results = None status = '' try: health = es.cluster.health() if health['status'] == 'red': status = 'ES is red' elastic_results = health except elasticsearch.ElasticsearchException: monitor_log.exception('Failed to communicate with ES') elastic_results = {'error': traceback.format_exc()} status = 'traceback' return status, elastic_results def path(): # Check file paths / permissions rw = (settings.TMP_PATH, settings.NETAPP_STORAGE, settings.UPLOADS_PATH, settings.ADDONS_PATH, settings.GUARDED_ADDONS_PATH, settings.ADDON_ICONS_PATH, settings.WEBSITE_ICONS_PATH, settings.PREVIEWS_PATH, settings.REVIEWER_ATTACHMENTS_PATH,) r = [os.path.join(settings.ROOT, 'locale')] filepaths = [(path, os.R_OK | os.W_OK, "We want read + write") for path in rw] filepaths += [(path, os.R_OK, "We want read") for path in r] filepath_results = [] filepath_status = True for path, perms, notes in filepaths: path_exists = os.path.exists(path) path_perms = os.access(path, perms) filepath_status = filepath_status and path_exists and path_perms filepath_results.append((path, path_exists, path_perms, notes)) key_exists = os.path.exists(settings.WEBAPPS_RECEIPT_KEY) key_perms = os.access(settings.WEBAPPS_RECEIPT_KEY, os.R_OK) filepath_status = filepath_status and key_exists and key_perms filepath_results.append(('settings.WEBAPPS_RECEIPT_KEY', key_exists, key_perms, 'We want read')) status = filepath_status status = '' if not filepath_status: status = 'check main status page for broken perms' return status, filepath_results # The signer check actually asks the signing server to sign something. Do this # once per nagios check, once per web head might be a bit much. The memoize # slows it down a bit, by caching the result for 15 seconds. @memoize('monitors-signer', time=15) def receipt_signer(): destination = getattr(settings, 'SIGNING_SERVER', None) if not destination: return '', 'Signer is not configured.' # Just send some test data into the signer. now = int(time.time()) not_valid = (settings.SITE_URL + '/not-valid') data = {'detail': not_valid, 'exp': now + 3600, 'iat': now, 'iss': settings.SITE_URL, 'product': {'storedata': 'id=1', 'url': u'http://not-valid.com'}, 'nbf': now, 'typ': 'purchase-receipt', 'reissue': not_valid, 'user': {'type': 'directed-identifier', 'value': u'something-not-valid'}, 'verify': not_valid } try: result = receipt.sign(data) except SigningError as err: msg = 'Error on signing (%s): %s' % (destination, err) return msg, msg try: cert, rest = receipt.crack(result) except Exception as err: msg = 'Error on cracking receipt (%s): %s' % (destination, err) return msg, msg # Check that the certs used to sign the receipts are not about to expire. limit = now + (60 * 60 * 24) # One day. if cert['exp'] < limit: msg = 'Cert will expire soon (%s)' % destination return msg, msg cert_err_msg = 'Error on checking public cert (%s): %s' location = cert['iss'] try: resp = requests.get(location, timeout=5, stream=False) except Exception as err: msg = cert_err_msg % (location, err) return msg, msg if not resp.ok: msg = cert_err_msg % (location, resp.reason) return msg, msg cert_json = resp.json() if not cert_json or 'jwk' not in cert_json: msg = cert_err_msg % (location, 'Not valid JSON/JWK') return msg, msg return '', 'Signer working and up to date' # Like the receipt signer above this asks the packaged app signing # service to sign one for us. @memoize('monitors-package-signer', time=60) def package_signer(): destination = getattr(settings, 'SIGNED_APPS_SERVER', None) if not destination: return '', 'Signer is not configured.' app_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'nagios_check_packaged_app.zip') signed_path = tempfile.mktemp() try: packaged.sign_app(local_storage.open(app_path), signed_path, None, False, local=True) return '', 'Package signer working' except PackageSigningError, e: msg = 'Error on package signing (%s): %s' % (destination, e) return msg, msg finally: local_storage.delete(signed_path) # Not called settings to avoid conflict with django.conf.settings. def settings_check(): required = ['APP_PURCHASE_KEY', 'APP_PURCHASE_TYP', 'APP_PURCHASE_AUD', 'APP_PURCHASE_SECRET'] for key in required: if not getattr(settings, key): msg = 'Missing required value %s' % key return msg, msg return '', 'Required settings ok'
bsd-3-clause
7,330,923,754,298,873,000
33.265625
78
0.609097
false
sschiau/swift
utils/gyb_syntax_support/NodeSerializationCodes.py
1
7368
from Node import error SYNTAX_NODE_SERIALIZATION_CODES = { # 0 is 'Token'. Needs to be defined manually # 1 is 'Unknown'. Needs to be defined manually 'UnknownDecl': 2, 'TypealiasDecl': 3, 'AssociatedtypeDecl': 4, 'IfConfigDecl': 5, 'PoundErrorDecl': 6, 'PoundWarningDecl': 7, 'PoundSourceLocation': 8, 'ClassDecl': 9, 'StructDecl': 10, 'ProtocolDecl': 11, 'ExtensionDecl': 12, 'FunctionDecl': 13, 'InitializerDecl': 14, 'DeinitializerDecl': 15, 'SubscriptDecl': 16, 'ImportDecl': 17, 'AccessorDecl': 18, 'VariableDecl': 19, 'EnumCaseDecl': 20, 'EnumDecl': 21, 'OperatorDecl': 22, 'PrecedenceGroupDecl': 23, 'UnknownExpr': 24, 'InOutExpr': 25, 'PoundColumnExpr': 26, 'TryExpr': 27, 'IdentifierExpr': 28, 'SuperRefExpr': 29, 'NilLiteralExpr': 30, 'DiscardAssignmentExpr': 31, 'AssignmentExpr': 32, 'SequenceExpr': 33, 'PoundLineExpr': 34, 'PoundFileExpr': 35, 'PoundFunctionExpr': 36, 'PoundDsohandleExpr': 37, 'SymbolicReferenceExpr': 38, 'PrefixOperatorExpr': 39, 'BinaryOperatorExpr': 40, 'ArrowExpr': 41, 'FloatLiteralExpr': 42, 'TupleExpr': 43, 'ArrayExpr': 44, 'DictionaryExpr': 45, 'ImplicitMemberExpr': 46, 'IntegerLiteralExpr': 47, 'StringLiteralExpr': 48, 'BooleanLiteralExpr': 49, 'TernaryExpr': 50, 'MemberAccessExpr': 51, 'DotSelfExpr': 52, 'IsExpr': 53, 'AsExpr': 54, 'TypeExpr': 55, 'ClosureExpr': 56, 'UnresolvedPatternExpr': 57, 'FunctionCallExpr': 58, 'SubscriptExpr': 59, 'OptionalChainingExpr': 60, 'ForcedValueExpr': 61, 'PostfixUnaryExpr': 62, 'SpecializeExpr': 63, 'KeyPathExpr': 65, 'KeyPathBaseExpr': 66, 'ObjcKeyPathExpr': 67, 'ObjcSelectorExpr': 68, 'EditorPlaceholderExpr': 69, 'ObjectLiteralExpr': 70, 'UnknownStmt': 71, 'ContinueStmt': 72, 'WhileStmt': 73, 'DeferStmt': 74, 'ExpressionStmt': 75, 'RepeatWhileStmt': 76, 'GuardStmt': 77, 'ForInStmt': 78, 'SwitchStmt': 79, 'DoStmt': 80, 'ReturnStmt': 81, 'FallthroughStmt': 82, 'BreakStmt': 83, 'DeclarationStmt': 84, 'ThrowStmt': 85, 'IfStmt': 86, 'Decl': 87, 'Expr': 88, 'Stmt': 89, 'Type': 90, 'Pattern': 91, 'CodeBlockItem': 92, 'CodeBlock': 93, 'DeclNameArgument': 94, 'DeclNameArguments': 95, 'FunctionCallArgument': 96, 'TupleElement': 97, 'ArrayElement': 98, 'DictionaryElement': 99, 'ClosureCaptureItem': 100, 'ClosureCaptureSignature': 101, 'ClosureParam': 102, 'ClosureSignature': 103, 'StringSegment': 104, 'ExpressionSegment': 105, 'ObjcNamePiece': 106, 'TypeInitializerClause': 107, 'ParameterClause': 108, 'ReturnClause': 109, 'FunctionSignature': 110, 'IfConfigClause': 111, 'PoundSourceLocationArgs': 112, 'DeclModifier': 113, 'InheritedType': 114, 'TypeInheritanceClause': 115, 'MemberDeclBlock': 116, 'MemberDeclListItem': 117, 'SourceFile': 118, 'InitializerClause': 119, 'FunctionParameter': 120, 'AccessLevelModifier': 121, 'AccessPathComponent': 122, 'AccessorParameter': 123, 'AccessorBlock': 124, 'PatternBinding': 125, 'EnumCaseElement': 126, 'OperatorPrecedenceAndTypes': 127, 'PrecedenceGroupRelation': 128, 'PrecedenceGroupNameElement': 129, 'PrecedenceGroupAssignment': 130, 'PrecedenceGroupAssociativity': 131, 'Attribute': 132, 'LabeledSpecializeEntry': 133, 'ImplementsAttributeArguments': 134, 'ObjCSelectorPiece': 135, 'WhereClause': 136, 'ConditionElement': 137, 'AvailabilityCondition': 138, 'MatchingPatternCondition': 139, 'OptionalBindingCondition': 140, 'ElseIfContinuation': 141, 'ElseBlock': 142, 'SwitchCase': 143, 'SwitchDefaultLabel': 144, 'CaseItem': 145, 'SwitchCaseLabel': 146, 'CatchClause': 147, 'GenericWhereClause': 148, 'SameTypeRequirement': 149, 'GenericParameter': 150, 'GenericParameterClause': 151, 'ConformanceRequirement': 152, 'CompositionTypeElement': 153, 'TupleTypeElement': 154, 'GenericArgument': 155, 'GenericArgumentClause': 156, 'TypeAnnotation': 157, 'TuplePatternElement': 158, 'AvailabilityArgument': 159, 'AvailabilityLabeledArgument': 160, 'AvailabilityVersionRestriction': 161, 'VersionTuple': 162, 'CodeBlockItemList': 163, 'FunctionCallArgumentList': 164, 'TupleElementList': 165, 'ArrayElementList': 166, 'DictionaryElementList': 167, 'StringLiteralSegments': 168, 'DeclNameArgumentList': 169, 'ExprList': 170, 'ClosureCaptureItemList': 171, 'ClosureParamList': 172, 'ObjcName': 173, 'FunctionParameterList': 174, 'IfConfigClauseList': 175, 'InheritedTypeList': 176, 'MemberDeclList': 177, 'ModifierList': 178, 'AccessPath': 179, 'AccessorList': 180, 'PatternBindingList': 181, 'EnumCaseElementList': 182, 'PrecedenceGroupAttributeList': 183, 'PrecedenceGroupNameList': 184, 'TokenList': 185, 'NonEmptyTokenList': 186, 'AttributeList': 187, 'SpecializeAttributeSpecList': 188, 'ObjCSelector': 189, 'SwitchCaseList': 190, 'CatchClauseList': 191, 'CaseItemList': 192, 'ConditionElementList': 193, 'GenericRequirementList': 194, 'GenericParameterList': 195, 'CompositionTypeElementList': 196, 'TupleTypeElementList': 197, 'GenericArgumentList': 198, 'TuplePatternElementList': 199, 'AvailabilitySpecList': 200, 'UnknownPattern': 201, 'EnumCasePattern': 202, 'IsTypePattern': 203, 'OptionalPattern': 204, 'IdentifierPattern': 205, 'AsTypePattern': 206, 'TuplePattern': 207, 'WildcardPattern': 208, 'ExpressionPattern': 209, 'ValueBindingPattern': 210, 'UnknownType': 211, 'SimpleTypeIdentifier': 212, 'MemberTypeIdentifier': 213, 'ClassRestrictionType': 214, 'ArrayType': 215, 'DictionaryType': 216, 'MetatypeType': 217, 'OptionalType': 218, 'ImplicitlyUnwrappedOptionalType': 219, 'CompositionType': 220, 'TupleType': 221, 'FunctionType': 222, 'AttributedType': 223, 'YieldStmt': 224, 'YieldList': 225, 'IdentifierList': 226, 'NamedAttributeStringArgument': 227, 'DeclName': 228, 'PoundAssertStmt': 229, 'SomeType': 230, 'CustomAttribute': 231, 'GenericRequirement': 232, 'LayoutRequirement': 233, 'LayoutConstraint': 234, 'OpaqueReturnTypeOfAttributeArguments': 235, } def verify_syntax_node_serialization_codes(nodes, serialization_codes): # Verify that all nodes have serialization codes for node in nodes: if not node.is_base() and node.syntax_kind not in serialization_codes: error('Node %s has no serialization code' % node.syntax_kind) # Verify that no serialization code is used twice used_codes = set() for serialization_code in serialization_codes.values(): if serialization_code in used_codes: error("Serialization code %d used twice" % serialization_code) used_codes.add(serialization_code) def get_serialization_code(syntax_kind): return SYNTAX_NODE_SERIALIZATION_CODES[syntax_kind]
apache-2.0
-6,272,852,061,248,524,000
27.55814
78
0.649159
false
Azure/azure-sdk-for-python
sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_operations.py
1
28513
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class ApiOperationOperations: """ApiOperationOperations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config def list_by_api( self, resource_group_name: str, service_name: str, api_id: str, filter: Optional[str] = None, top: Optional[int] = None, skip: Optional[int] = None, tags: Optional[str] = None, **kwargs ) -> AsyncIterable["_models.OperationCollection"]: """Lists a collection of the operations for the specified API. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str :param api_id: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param filter: | Field | Usage | Supported operators | Supported functions |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. :type filter: str :param top: Number of records to return. :type top: int :param skip: Number of records to skip. :type skip: int :param tags: Include tags in the response. :type tags: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationCollection or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.OperationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_by_api.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) if tags is not None: query_parameters['tags'] = self._serialize.query("tags", tags, 'str') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): deserialized = self._deserialize('OperationCollection', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations'} # type: ignore async def get_entity_tag( self, resource_group_name: str, service_name: str, api_id: str, operation_id: str, **kwargs ) -> bool: """Gets the entity state (Etag) version of the API operation specified by its identifier. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str :param api_id: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param operation_id: Operation identifier within an API. Must be unique in the current API Management service instance. :type operation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-01" accept = "application/json" # Construct URL url = self.get_entity_tag.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.head(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) if cls: return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore async def get( self, resource_group_name: str, service_name: str, api_id: str, operation_id: str, **kwargs ) -> "_models.OperationContract": """Gets the details of the API Operation specified by its identifier. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str :param api_id: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param operation_id: Operation identifier within an API. Must be unique in the current API Management service instance. :type operation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationContract, or the result of cls(response) :rtype: ~azure.mgmt.apimanagement.models.OperationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationContract"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) deserialized = self._deserialize('OperationContract', pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore async def create_or_update( self, resource_group_name: str, service_name: str, api_id: str, operation_id: str, parameters: "_models.OperationContract", if_match: Optional[str] = None, **kwargs ) -> "_models.OperationContract": """Creates a new operation in the API or updates an existing one. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str :param api_id: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param operation_id: Operation identifier within an API. Must be unique in the current API Management service instance. :type operation_id: str :param parameters: Create parameters. :type parameters: ~azure.mgmt.apimanagement.models.OperationContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when updating an entity. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationContract, or the result of cls(response) :rtype: ~azure.mgmt.apimanagement.models.OperationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationContract"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] if if_match is not None: header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'OperationContract') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 200: response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) deserialized = self._deserialize('OperationContract', pipeline_response) if response.status_code == 201: response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) deserialized = self._deserialize('OperationContract', pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore async def update( self, resource_group_name: str, service_name: str, api_id: str, operation_id: str, if_match: str, parameters: "_models.OperationUpdateContract", **kwargs ) -> "_models.OperationContract": """Updates the details of the operation in the API specified by its identifier. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str :param api_id: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param operation_id: Operation identifier within an API. Must be unique in the current API Management service instance. :type operation_id: str :param if_match: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: API Operation Update parameters. :type parameters: ~azure.mgmt.apimanagement.models.OperationUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationContract, or the result of cls(response) :rtype: ~azure.mgmt.apimanagement.models.OperationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationContract"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'OperationUpdateContract') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) deserialized = self._deserialize('OperationContract', pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore async def delete( self, resource_group_name: str, service_name: str, api_id: str, operation_id: str, if_match: str, **kwargs ) -> None: """Deletes the specified operation in the API. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str :param api_id: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param operation_id: Operation identifier within an API. Must be unique in the current API Management service instance. :type operation_id: str :param if_match: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-01" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), 'apiId': self._serialize.url("api_id", api_id, 'str', max_length=256, min_length=1, pattern=r'^[^*#&+:<>?]+$'), 'operationId': self._serialize.url("operation_id", operation_id, 'str', max_length=80, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore
mit
6,949,265,218,176,873,000
52.295327
219
0.63792
false
richarddzh/markdown-latex-tools
md2tex/md2tex.py
1
6180
''' md2tex.py - author: Richard Dong - description: Convert markdown to latex ''' from __future__ import print_function import re import io import sys import argparse import markdown class State: NORMAL = 0 RAW = 1 class Handler: def __init__(self): self.vars = dict() self.state = State.NORMAL self._begin_latex = re.compile(r'^<!-- latex\s*$') self._set_vars = re.compile(r'^<!-- set(\s+\w+="[^"]+")+\s*-->$') self._var_pair = re.compile(r'(\w+)="([^"]+)"') self._escape = re.compile(r'(&|%|\$|_|\{|\})') self._inline_math = re.compile(r'\$\$(.+?)\$\$') self._cite = re.compile(r'\[(cite|ref)@\s*([A-Za-z0-9:]+(\s*,\s*[A-Za-z0-9:]+)*)\]') self._bold = re.compile(r'\*\*(?!\s)(.+?)\*\*') def convert_text(self, text): if len(text) == 0 or text.isspace(): return '' m = self._inline_math.split(text) s = '' for i in range(len(m)): if len(m[i]) == 0 or m[i].isspace(): continue if i % 2 == 0: text = self.convert_text_no_math(m[i]) else: text = '$' + m[i] + '$' s = s + text return s def convert_text_no_math(self, text): if len(text) == 0 or text.isspace(): return '' m = self._bold.split(text) s = '' for i in range(len(m)): if len(m[i]) == 0 or m[i].isspace(): continue if i % 2 == 0: text = self.convert_text_no_bold(m[i]) else: text = '\\textbf{' + self.convert_text_no_bold(m[i]) + '}' s = s + text return s def convert_text_no_bold(self, text): text = self._escape.sub(r'\\\1', text) text = text.replace(r'\\', r'\textbackslash{}') text = self._cite.sub(r'\\\1{\2}', text) return text def print_label(self): if 'label' in self.vars: print('\\label{%s}' % self.vars.pop('label', 'nolabel')) def get_float_style(self): fl = self.vars.pop('float', '!ht') if fl == '!h' or fl == 'h!': fl = '!ht' return fl def on_begin_table(self): caption = self.convert_text(self.vars.pop('caption', '')) print('\\begin{table}[%s]' % self.get_float_style()) print('\\caption{%s}' % caption) self.print_label() print('\\centering\\begin{tabular}{%s}\\hline' % self.vars.pop('columns', 'c')) def on_end_table(self): print('\\hline\\end{tabular}') print('\\end{table}') def on_text(self, text): print(self.convert_text(text)) def on_comment(self, comment): if self._begin_latex.match(comment): self.state = State.RAW elif self.state == State.RAW and '-->' in comment: self.state = State.NORMAL elif self.state == State.RAW: print(comment) elif self._set_vars.match(comment): for (k, v) in self._var_pair.findall(comment): self.vars[k] = v def on_title(self, **arg): level = arg['level'] title = self.convert_text(arg['title']) if level == 1: print('\\chapter{%s}' % title) else: print('\\%ssection{%s}' % ('sub' * (level - 2), title)) def on_image(self, **arg): url = arg['url'] caption = self.convert_text(arg['caption']) style = self.vars.pop('style', 'figure') url = self.vars.pop('url', url) width = self.vars.pop('width', '0.5') endline = self.vars.pop('endline', '') if style == 'figure': print('\\begin{figure}[%s]' % self.get_float_style()) print('\\centering\\includegraphics[width=%s\\linewidth]{%s}\\caption{%s}' % (width, url, caption)) self.print_label() print('\\end{figure}') elif style == 'subfloat': print('\\subfloat[%s]{\\includegraphics[width=%s\\linewidth]{%s}' % (caption, width, url)) self.print_label(); print('}%s' % endline) elif style == 'raw': print('\\includegraphics[width=%s\\linewidth]{%s}%s' % (width, url, endline)) def on_table_line(self): print('\\hline') def on_table_row(self, row): row = [self.convert_text(x) for x in row] print(' & '.join(row) + ' \\\\') def on_begin_equation(self): print('\\begin{equation}') self.print_label() def on_end_equation(self): print('\\end{equation}') def on_equation(self, equ): print(equ) def on_begin_list(self, sym): if sym[0].isdigit(): print('\\begin{enumerate}') else: print('\\begin{itemize}') def on_end_list(self, sym): if sym[0].isdigit(): print('\\end{enumerate}') else: print('\\end{itemize}') def on_list_item(self, sym): print('\\item ', end='') def on_include(self, filename): print('\\input{%s.tex}' % filename) def on_begin_code(self, lang): params = list() if lang and not lang.isspace(): params.append('language=%s' % lang) caption = self.convert_text(self.vars.pop('caption', '')) if caption and not caption.isspace(): params.append('caption={%s}' % caption) params = ','.join(params) if params and not params.isspace(): params = '[' + params + ']' if lang == 'algorithm': self.vars['lang'] = 'algorithm' print('\\begin{algorithm}[%s]' % self.get_float_style()) print('\\caption{%s}' % caption) self.print_label() print('\\setstretch{1.3}') print('\\SetKwProg{Fn}{function}{}{end}') else: print('\\begin{lstlisting}' + params) def on_end_code(self): lang = self.vars.pop('lang', '') if lang == 'algorithm': print('\\end{algorithm}') else: print('\\end{lstlisting}') def on_code(self, code): print(code) parser = argparse.ArgumentParser(description='convert markdown to latex.') parser.add_argument('-c', dest='encoding', help='file encoding', default='utf8') parser.add_argument('-o', dest='output', help='output file') parser.add_argument('file', nargs='*', help='input files') args = parser.parse_args() if args.output is not None: sys.stdout = io.open(args.output, mode='wt', encoding=args.encoding) for f in args.file: p = markdown.Parser() p.handler = Handler() with io.open(f, mode='rt', encoding=args.encoding) as fi: for line in fi: p.parse_line(line) p.parse_line('') if not args.file: p = markdown.Parser() p.handler = Handler() for line in sys.stdin: p.parse_line(line) p.parse_line('')
gpl-2.0
-6,809,639,259,904,145,000
28.2891
105
0.571683
false
Benocs/core
src/daemon/core/misc/ipaddr.py
1
15121
# # CORE # # Copyright (c)2010-2012 the Boeing Company. # See the LICENSE.BOEING file included in this distribution. # # author: Tom Goff <[email protected]> # # Copyright (c) 2014 Benocs GmbH # # author: Robert Wuttke <[email protected]> # # See the LICENSE file included in this distribution. # ''' ipaddr.py: helper objects for dealing with IPv4/v6 addresses. ''' import socket import struct import random import ipaddress from core.constants import * from core.misc.netid import NetIDNodeMap from core.misc.netid import NetIDSubnetMap AF_INET = socket.AF_INET AF_INET6 = socket.AF_INET6 class MacAddr(object): def __init__(self, addr): self.addr = addr def __str__(self): return ":".join([("%02x" % x) for x in self.addr]) def tolinklocal(self): ''' Convert the MAC address to a IPv6 link-local address, using EUI 48 to EUI 64 conversion process per RFC 5342. ''' if not self.addr: return IPAddr.fromstring("::") tmp = struct.unpack("!Q", '\x00\x00' + self.addr)[0] nic = int(tmp) & 0x000000FFFFFF oui = int(tmp) & 0xFFFFFF000000 # toggle U/L bit oui ^= 0x020000000000 # append EUI-48 octets oui = (oui << 16) | 0xFFFE000000 return IPAddr(AF_INET6, struct.pack("!QQ", 0xfe80 << 48, oui | nic)) @classmethod def fromstring(cls, s): addr = "".join([chr(int(x, 16)) for x in s.split(":")]) return cls(addr) @classmethod def random(cls): tmp = random.randint(0, 0xFFFFFF) tmp |= 0x00163E << 24 # use the Xen OID 00:16:3E tmpbytes = struct.pack("!Q", tmp) return cls(tmpbytes[2:]) class IPAddr(object): def __init__(self, af, addr): # check if (af, addr) is valid tmp = None try: if af == AF_INET: tmp = ipaddress.IPv4Address(addr) elif af == AF_INET6: tmp = ipaddress.IPv6Address(addr) else: raise ValueError("invalid af/addr") except: raise ValueError("invalid af/addr: \"%s\", \"%s\"" % (str(af), str(addr))) self.af = af self.addr = tmp if af == AF_INET: # assume a /32 as default prefix length self.prefixlen = 32 else: # assume a /128 as default prefix length self.prefixlen = 128 def set_prefixlen(self, prefixlen): if not isinstance(prefixlen, int): raise ValueError('prefixlen needs to be a number') self.prefixlen = prefixlen def get_prefixlen(self): return self.prefixlen def isIPv4(self): return self.af == AF_INET def isIPv6(self): return self.af == AF_INET6 def __repr__(self): return '%s/%d' % (self.addr.compressed, self.prefixlen) def __str__(self): return self.addr.compressed def __eq__(self, other): try: return self.addr == other.addr except: return False def __add__(self, other): if not self.__class__ == other.__class__ and not isinstance(other, int): raise ValueError if isinstance(other, IPAddr): if self.addr.version == 4: return IPAddr(AF_INET, str(ipaddress.IPv4Address(self.addr + other.addr))) elif self.addr.version == 6: return IPAddr(AF_INET6, str(ipaddress.IPv6Address(self.addr + other.addr))) elif isinstance(other, ipaddress.IPv4Address): return IPAddr(AF_INET, str(ipaddress.IPv4Address(self.addr + other))) elif isinstance(other, ipaddress.IPv6Address): return IPAddr(AF_INET6, str(ipaddress.IPv6Address(self.addr + other))) elif isinstance(other, int): return self.__class__(self.addr + other) else: return NotImplemented def __sub__(self, other): try: tmp = -int(other.addr) except: return NotImplemented return self.__add__(tmp) def __le__(self, other): return self.addr.__le__(other.addr) def __lt__(self, other): return self.addr.__lt__(other.addr) @classmethod def fromstring(cls, s): for af in AF_INET, AF_INET6: try: return cls(af, socket.inet_pton(af, s)) except Exception as e: pass raise e @staticmethod def toint(s): ''' convert IPv4 string to 32-bit integer ''' return int(self.addr) class IPv4Addr(IPAddr): def __init__(self, addr): super().__init__(AF_INET, addr) class IPv6Addr(IPAddr): def __init__(self, addr): super().__init__(AF_INET6, addr) class IPPrefix(object): def __init__(self, af, prefixstr): "prefixstr format: address/prefixlen" self.af = af if self.af == AF_INET: self.addrlen = 32 self.prefix = ipaddress.IPv4Network(prefixstr, strict = False) elif self.af == AF_INET6: self.prefix = ipaddress.IPv6Network(prefixstr, strict = False) self.addrlen = 128 else: raise ValueError("invalid address family: '%s'" % self.af) tmp = prefixstr.split("/") if len(tmp) > 2: raise ValueError("invalid prefix: '%s'" % prefixstr) if len(tmp) == 2: self.prefixlen = int(tmp[1]) else: self.prefixlen = self.addrlen def __str__(self): return str(self.prefix) def __eq__(self, other): try: return other.af == self.af and \ other.prefixlen == self.prefixlen and \ other.prefix == self.prefix except: return False def addr(self, hostid): tmp = int(hostid) if (tmp == 1 or tmp == 0 or tmp == -1) and self.addrlen == self.prefixlen: return IPAddr(self.af, self.prefix) if tmp == 0 or \ tmp > (1 << (self.addrlen - self.prefixlen)) - 1 or \ (self.af == AF_INET and tmp == (1 << (self.addrlen - self.prefixlen)) - 1): raise ValueError("invalid hostid for prefix %s: %s" % (str(self), str(hostid))) addr = IPAddr(self.af, int(self.prefix.network_address) + int(hostid)) return addr def minaddr(self): if self.af == AF_INET: return IPv4Addr(self.prefix.network_address + 1) elif self.af == AF_INET6: return IPv6Addr(self.prefix.network_address + 1) else: raise ValueError("invalid address family: '%s'" % self.af) def maxaddr(self): if self.af == AF_INET: return IPv4Addr(self.prefix.broadcast_address - 1) elif self.af == AF_INET6: return IPv6Addr(self.prefix.broadcast_address - 1) else: raise ValueError("invalid address family: '%s'" % self.af) def numaddr(self): return self.prefix.num_addresses - 2 def prefixstr(self): return '%s' % self.prefix def netmaskstr(self): return '%s' % self.prefix.netmask class IPv4Prefix(IPPrefix): def __init__(self, prefixstr): IPPrefix.__init__(self, AF_INET, prefixstr) class IPv6Prefix(IPPrefix): def __init__(self, prefixstr): IPPrefix.__init__(self, AF_INET6, prefixstr) def isIPAddress(af, addrstr): if af == AF_INET and isinstance(addrstr, IPv4Addr): return True if af == AF_INET6 and isinstance(addrstr, IPv6Addr): return True if isinstance(addrstr, IPAddr): return True try: (ip, sep, mask) = addrstr.partition('/') tmp = socket.inet_pton(af, ip) return True except: return False def isIPv4Address(addrstr): if isinstance(addrstr, IPv4Addr): return True if isinstance(addrstr, IPAddr): addrstr = str(addrstr) return isIPAddress(AF_INET, addrstr) def isIPv6Address(addrstr): if isinstance(addrstr, IPv6Addr): return True if isinstance(addrstr, IPAddr): addrstr = str(addrstr) return isIPAddress(AF_INET6, addrstr) class Interface(): @staticmethod def cfg_sanitation_checks(ipversion): interface_net = 'ipv%d_interface_net' % ipversion interface_net_per_netid = 'ipv%d_interface_net_per_netid' % ipversion interface_net_per_ptp_link = 'ipv%d_interface_net_per_ptp_link' % \ ipversion interface_net_per_brdcst_link = 'ipv%d_interface_net_per_brdcst_link' %\ ipversion if not 'ipaddrs' in CONFIGS or \ not interface_net in CONFIGS['ipaddrs'] or \ not len(CONFIGS['ipaddrs'][interface_net].split('/')) == 2 or \ not interface_net_per_netid in CONFIGS['ipaddrs'] or \ not interface_net_per_ptp_link in CONFIGS['ipaddrs'] or \ not interface_net_per_brdcst_link in CONFIGS['ipaddrs']: raise ValueError('Could not read ipaddrs.conf') @staticmethod def getInterfaceNet(ipversion): Interface.cfg_sanitation_checks(ipversion=ipversion) interface_net = 'ipv%d_interface_net' % ipversion interface_net_per_netid = 'ipv%d_interface_net_per_netid' % ipversion if ipversion == 4: ipprefix_cls = IPv4Prefix elif ipversion == 6: ipprefix_cls = IPv6Prefix else: raise ValueError('IP version is neither 4 nor 6: %s' % str(ipversion)) global_interface_prefix_str = CONFIGS['ipaddrs'][interface_net] global_prefixbase, global_prefixlen = global_interface_prefix_str.split('/') try: global_prefixlen = int(global_prefixlen) except ValueError: raise ValueError('Could not parse %s from ipaddrs.conf' % interface_net) global_interface_prefix = ipprefix_cls(global_interface_prefix_str) return global_interface_prefix @staticmethod def getInterfaceNet_per_net(sessionid, netid, ipversion): Interface.cfg_sanitation_checks(ipversion=ipversion) interface_net = 'ipv%d_interface_net' % ipversion interface_net_per_netid = 'ipv%d_interface_net_per_netid' % ipversion if ipversion == 4: ipprefix_cls = IPv4Prefix elif ipversion == 6: ipprefix_cls = IPv6Prefix else: raise ValueError('IP version is neither 4 nor 6: %s' % str(ipversion)) # local means per netid (e.g., AS) try: local_prefixlen = int(CONFIGS['ipaddrs'][interface_net_per_netid]) except ValueError: raise ValueError('Could not parse %s from ipaddrs.conf' % interface_net_per_netid) global_interface_prefix = Interface.getInterfaceNet(ipversion) global_prefixbase, global_prefixlen = str(global_interface_prefix).split('/') subnet_id = NetIDSubnetMap.register_netid(sessionid, netid, ipversion) baseprefix = ipprefix_cls('%s/%d' % (global_prefixbase, local_prefixlen)) target_network_baseaddr = baseprefix.minaddr() + ((subnet_id) * (baseprefix.numaddr() + 2)) target_network_prefix = ipprefix_cls('%s/%d' % (target_network_baseaddr, local_prefixlen)) return target_network_prefix class Loopback(): @staticmethod def cfg_sanitation_checks(ipversion): loopback_net = 'ipv%d_loopback_net' % ipversion loopback_net_per_netid = 'ipv%d_loopback_net_per_netid' % ipversion if not 'ipaddrs' in CONFIGS or \ not loopback_net in CONFIGS['ipaddrs'] or \ not len(CONFIGS['ipaddrs'][loopback_net].split('/')) == 2 or \ not loopback_net_per_netid in CONFIGS['ipaddrs']: raise ValueError('Could not read ipaddrs.conf') @staticmethod def getLoopbackNet(ipversion): Loopback.cfg_sanitation_checks(ipversion=ipversion) loopback_net = 'ipv%d_loopback_net' % ipversion loopback_net_per_netid = 'ipv%d_loopback_net_per_netid' % ipversion if ipversion == 4: ipprefix_cls = IPv4Prefix elif ipversion == 6: ipprefix_cls = IPv6Prefix else: raise ValueError('IP version is neither 4 nor 6: %s' % str(ipversion)) global_loopback_prefix_str = CONFIGS['ipaddrs'][loopback_net] global_prefixbase, global_prefixlen = global_loopback_prefix_str.split('/') try: global_prefixlen = int(global_prefixlen) except ValueError: raise ValueError('Could not parse %s from ipaddrs.conf' % loopback_net) global_loopback_prefix = ipprefix_cls(global_loopback_prefix_str) return global_loopback_prefix @staticmethod def getLoopbackNet_per_net(sessionid, netid, ipversion): Loopback.cfg_sanitation_checks(ipversion=ipversion) loopback_net = 'ipv%d_loopback_net' % ipversion loopback_net_per_netid = 'ipv%d_loopback_net_per_netid' % ipversion if ipversion == 4: ipprefix_cls = IPv4Prefix elif ipversion == 6: ipprefix_cls = IPv6Prefix else: raise ValueError('IP version is neither 4 nor 6: %s' % str(ipversion)) # local means per netid (e.g., AS) try: local_prefixlen = int(CONFIGS['ipaddrs'][loopback_net_per_netid]) except ValueError: raise ValueError('Could not parse %s from ipaddrs.conf' % loopback_net_per_netid) global_loopback_prefix = Loopback.getLoopbackNet(ipversion) global_prefixbase, global_prefixlen = str(global_loopback_prefix).split('/') subnet_id = NetIDSubnetMap.register_netid(sessionid, netid, ipversion) baseprefix = ipprefix_cls('%s/%d' % (global_prefixbase, local_prefixlen)) target_network_baseaddr = baseprefix.minaddr() + ((subnet_id) * (baseprefix.numaddr() + 2)) target_network_prefix = ipprefix_cls('%s/%d' % (target_network_baseaddr, local_prefixlen)) return target_network_prefix @staticmethod def getLoopback(node, ipversion): Loopback.cfg_sanitation_checks(ipversion=ipversion) if hasattr(node, 'netid') and not node.netid is None: netid = node.netid else: # TODO: netid 0 is invalid - instead use first unused ASN node.warn('[LOOPBACK] no ASN found. falling back to default (0)') netid = 0 target_network_prefix = Loopback.getLoopbackNet_per_net( node.session.sessionid, netid, ipversion) nodeid = NetIDNodeMap.register_node(node.session.sessionid, node.nodeid(), netid) addr = target_network_prefix.addr(nodeid) #node.info('[LOOPBACK] generated addr for node: %s: %s' % (node.name, str(addr))) return addr @staticmethod def getLoopbackIPv4(node): return Loopback.getLoopback(node, ipversion=4) @staticmethod def getLoopbackIPv6(node): return Loopback.getLoopback(node, ipversion=6)
bsd-3-clause
3,767,200,738,145,645,600
33.056306
99
0.595596
false
twestbrookunh/paladin-plugins
core/main.py
1
13912
#! /usr/bin/env python3 """ The MIT License Copyright (c) 2017 by Anthony Westbrook, University of New Hampshire <[email protected]> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ # Core module is responsible for plugin interopability, as well as standard API import pkgutil import importlib import plugins import pprint import re import sys from core.filestore import FileStore class PluginDef: """ Plugin definition to be populated by each plugin via its plugin_init method at load time """ def __init__(self, module): # Plugin fields self.module = module self.name = "" self.description = "" self.version_major = 0 self.version_minor = 0 self.version_revision = 0 self.dependencies = list() # Callbacks self.callback_args = None self.callback_init = None self.callback_main = None class SamEntry: """ Store data per individual SAM entry """ FIELD_QNAME = 0 FIELD_FLAG = 1 FIELD_RNAME = 2 FIELD_POS = 3 FIELD_MAPQ = 4 FIELD_CIGAR = 5 FIELD_RNEXT = 6 FIELD_PNEXT = 7 FIELD_TLEN = 8 FIELD_SEQ = 9 FIELD_QUAL = 10 def __init__(self): self.query = "" self.flag = 0 self.reference = "" self.pos = 0 self.mapqual = 0 self.cigar = "" self.nextref = "" self.nextpos = 0 self.length = 0 self.sequence = "" self.readqual = 0 self.frame = "" @staticmethod def get_entries(filename, quality): """ Public API for obtaining SAM data (will handle caching internally) """ # Check if in cache if not (filename, quality) in SamEntry._entries: cache = SamEntry.populate_entries(filename, quality) SamEntry._entries[(filename, quality)] = cache return SamEntry._entries[(filename, quality)] @staticmethod def populate_entries(filename, quality): """ Store SAM entries filtered for the requested quality """ ret_entries = dict() # Open SAM file with open(filename, "r") as handle: for line in handle: fields = line.rstrip().split("\t") # Skip header and malformed lines if line.startswith("@"): continue if len(fields) < 11: continue # Filter for minimum quality if fields[SamEntry.FIELD_RNAME] == "*" and quality != -1: continue if quality != -1 and int(fields[SamEntry.FIELD_MAPQ]) < quality: continue # Remove PALADIN frame header since best scoring frame may change between alignments header_match = re.search("(.*?:.*?:.*?:)(.*)", fields[SamEntry.FIELD_QNAME]) entry = SamEntry() entry.query = header_match.group(2) entry.flag = int(fields[SamEntry.FIELD_FLAG]) # Fill in entry information if mapped if entry.is_mapped: entry.reference = fields[SamEntry.FIELD_RNAME] entry.pos = SamEntry.get_sam_int(fields[SamEntry.FIELD_POS]) entry.mapqual = SamEntry.get_sam_int(fields[SamEntry.FIELD_MAPQ]) entry.cigar = fields[SamEntry.FIELD_CIGAR] entry.nextref = fields[SamEntry.FIELD_RNEXT] entry.nextpos = fields[SamEntry.FIELD_PNEXT] entry.length = SamEntry.get_sam_int(fields[SamEntry.FIELD_TLEN]) entry.sequence = fields[SamEntry.FIELD_SEQ] entry.readqual = SamEntry.get_sam_int(fields[SamEntry.FIELD_QUAL]) entry.frame = header_match.group(1) # Each read can have multiple non-linear/chimeric hits - store as tuple for ease of processing read_base = header_match.group(2) hit_idx = 0 while (read_base, hit_idx) in ret_entries: hit_idx += 1 ret_entries[(read_base, hit_idx)] = entry return ret_entries @staticmethod def get_sam_int(val): if val.isdigit(): return int(val) return 0 def is_mapped(self): return self.flag & 0x04 > 0 _entries = dict() class PaladinEntry: """ PALADIN UniProt entry """ FIELD_COUNT = 0 FIELD_ABUNDANCE = 1 FIELD_QUALAVG = 2 FIELD_QUALMAX = 3 FIELD_KB = 4 FIELD_ID = 5 FIELD_SPECIES = 6 FIELD_PROTEIN = 7 FIELD_ONTOLOGY = 11 TYPE_UNKNOWN = 0 TYPE_UNIPROT_EXACT = 1 TYPE_UNIPROT_GROUP = 2 TYPE_CUSTOM = 3 def __init__(self): self.type = PaladinEntry.TYPE_UNKNOWN self.id = "Unknown" self.kb = "Unknown" self.count = 0 self.abundance = 0.0 self.quality_avg = 0.0 self.quality_max = 0 self.species_id = "Unknown" self.species_full = "Unknown" self.protein = "Unknown" self.ontology = list() @staticmethod def get_entries(filename, quality, pattern=None): """ Public API for obtaining UniProt report data (will handle caching internally) """ # Check if in cache if not (filename, quality, pattern) in PaladinEntry._entries: cache = PaladinEntry.populate_entries(filename, quality, pattern) PaladinEntry._entries[(filename, quality, pattern)] = cache return PaladinEntry._entries[(filename, quality, pattern)] @staticmethod def populate_entries(filename, quality, pattern): """ Cache this UniProt report data for the requested quality """ ret_entries = dict() # Open UniProt report, skip header with open(filename, "r") as handle: handle.readline() for line in handle: fields = line.rstrip().split("\t") # Filter for minimum quality if float(fields[PaladinEntry.FIELD_QUALMAX]) < quality: continue entry = PaladinEntry() entry.count = int(fields[PaladinEntry.FIELD_COUNT]) entry.abundance = float(fields[PaladinEntry.FIELD_ABUNDANCE]) entry.qual_avg = float(fields[PaladinEntry.FIELD_QUALAVG]) entry.qual_max = int(fields[PaladinEntry.FIELD_QUALMAX]) entry.kb = fields[PaladinEntry.FIELD_KB] if len(fields) > 10: # Existence of fields indicates a successful UniProt parse by PALADIN if "_9" in entry.kb: entry.type = PaladinEntry.TYPE_UNIPROT_GROUP else: entry.type = PaladinEntry.TYPE_UNIPROT_EXACT entry.species_id = entry.kb.split("_")[1] entry.species_full = fields[PaladinEntry.FIELD_SPECIES] entry.id = fields[PaladinEntry.FIELD_ID] entry.protein = fields[PaladinEntry.FIELD_PROTEIN] entry.ontology = [term.strip() for term in fields[PaladinEntry.FIELD_ONTOLOGY].split(";")] else: # Check for custom match if pattern: match = re.search(pattern, entry.kb) if match: entry.type = PaladinEntry.TYPE_CUSTOM entry.species_id = match.group(1) entry.species_full = match.group(1) ret_entries[fields[PaladinEntry.FIELD_KB]] = entry return ret_entries _entries = dict() # Plugins internal to core, and loaded external modules internal_plugins = dict() plugin_modules = dict() # Standard output and error buffers output_stdout = list() output_stderr = list() console_stdout = False console_stderr = True def connect_plugins(debug): """ Search for all modules in the plugin package (directory), import each and run plugin_connect method """ # Initialize File Store FileStore.init("pp-", "~/.paladin-plugins", ".", 30) # Add internal core plugins internal_plugins["flush"] = render_output internal_plugins["write"] = render_output # Import all external plugin modules in package (using full path) for importer, module, package in pkgutil.iter_modules(plugins.__path__): try: module_handle = importlib.import_module("{0}.{1}".format(plugins.__name__, module)) if "plugin_connect" in dir(module_handle): plugin_modules[module] = PluginDef(module_handle) except Exception as exception: if debug: raise exception else: send_output("Error loading \"{0}.py\", skipping...".format(module), "stderr") # Connect to all external plugins for plugin in plugin_modules: plugin_modules[plugin].module.plugin_connect(plugin_modules[plugin]) def args_plugins(plugins): """ Run argument parsing for each plugin """ for plugin in plugins: plugin_modules[plugin].callback_args() def init_plugins(plugins): """ _initialize plugins being used in this session """ init_queue = set() init_history = set() # Scan for plugins and dependencies for plugin in plugins: if plugin not in plugin_modules and plugin not in internal_plugins: if plugin in plugins.modules_disabled: print("Disabled plugin: {0}".format(plugin)) else: print("Unknown plugin: {0}".format(plugin)) return False # _initialize external plugins if plugin in plugin_modules: # Look for dependencies init_queue.update(plugin_modules[plugin].dependencies) init_queue.add(plugin) # _initialize for plugin in init_queue: if plugin_modules[plugin].callback_init: if plugin not in init_history: plugin_modules[plugin].callback_init() init_history.add(plugin) return True #def exec_pipeline(pipeline): # """ Execute requested plugin pipeline """ # for task in pipeline: # if task[0] in internal_plugins: # # Internal plugin # internal_plugins[task[0]](task[1].strip("\"")) # else: # # External plugin # if plugin_modules[task[0]].callback_main: # plugin_modules[task[0]].callback_main(task[1]) def exec_pipeline(pipeline): """ Execute requested plugin pipeline """ for task in pipeline: if task[0] in internal_plugins: # Internal plugin internal_plugins[task[0]](task[1].strip("\"")) elif task[0] in plugin_modules: # External plugin plugin = plugin_modules[task[0]] # Process arguments (this may sys.exit if help mode) if plugin.callback_args: args = plugin.callback_args(task[1]) # Process dependencies and initialization for dependency in [plugin_modules[x] for x in plugin.dependencies]: if dependency.callback_init: dependency.callback_init() if plugin.callback_init: plugin.callback_init() # Execute if plugin.callback_main: plugin.callback_main(args) else: # Invalid plugin send_output("Invalid plugin \"{0}\"".format(task[0]), "stderr") sys.exit(1) def render_output(filename="", target="stdout"): """ The flush internal plugin handles rendering output (to stdout or file) """ if target == "stdout": render_text = "".join(output_stdout) del output_stdout[:] if target == "stderr": render_text = "".join(output_stderr) del output_stderr[:] if not filename: std_target = sys.stdout if target == "stdout" else sys.stderr print(render_text, flush=True, file=std_target) else: with open(filename, "w") as handle: handle.write(render_text) def send_output(output_text, target="stdout", suffix="\n"): """ API - Record output into the appropriate buffer """ new_content = "{0}{1}".format(output_text, suffix) if target == "stdout": if console_stdout: print(new_content, end="", flush=True) else: output_stdout.append(new_content) else: if console_stderr: print(new_content, end="", flush=True, file=sys.stderr) else: output_stderr.append(new_content) def getInteger(val): """ API - Return value if string is integer (allows negatives) """ try: return int(val) except: return None def debugPrint(obj): """ API - Debugging """ pp = pprint.PrettyPrinter(indent=4) pp.pprint(obj)
mit
-8,417,711,024,441,444,000
33.098039
111
0.592869
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/_load_balancer_outbound_rules_operations.py
1
8796
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class LoadBalancerOutboundRulesOperations(object): """LoadBalancerOutboundRulesOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~azure.mgmt.network.v2018_10_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = _models def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config def list( self, resource_group_name, # type: str load_balancer_name, # type: str **kwargs # type: Any ): # type: (...) -> Iterable["_models.LoadBalancerOutboundRuleListResult"] """Gets all the outbound rules in a load balancer. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param load_balancer_name: The name of the load balancer. :type load_balancer_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LoadBalancerOutboundRuleListResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2018_10_01.models.LoadBalancerOutboundRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerOutboundRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): deserialized = self._deserialize('LoadBalancerOutboundRuleListResult', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules'} # type: ignore def get( self, resource_group_name, # type: str load_balancer_name, # type: str outbound_rule_name, # type: str **kwargs # type: Any ): # type: (...) -> "_models.OutboundRule" """Gets the specified load balancer outbound rule. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param load_balancer_name: The name of the load balancer. :type load_balancer_name: str :param outbound_rule_name: The name of the outbound rule. :type outbound_rule_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OutboundRule, or the result of cls(response) :rtype: ~azure.mgmt.network.v2018_10_01.models.OutboundRule :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), 'outboundRuleName': self._serialize.url("outbound_rule_name", outbound_rule_name, 'str'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('OutboundRule', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}'} # type: ignore
mit
3,591,065,966,637,462,000
46.804348
206
0.64518
false
dhhagan/ACT
ACT/thermo/visualize.py
1
13306
""" Classes and functions used to visualize data for thermo scientific analyzers """ from pandas import Series, DataFrame import pandas as pd import datetime as dt import matplotlib.pyplot as plt import numpy as np from matplotlib import dates as d import os import math import glob import matplotlib import warnings import sys __all__ = ['diurnal_plot','diurnal_plot_single', 'ThermoPlot'] def diurnal_plot(data, dates=[], shaded=False, title="Diurnal Profile of Trace Gases", xlabel="Local Time: East St. Louis, MO"): ''' If plotting the entire DataFrame (data), choose all_data=True, else choose all_data=False and declare the date or dates to plot as a list. `data` should be a pandas core DataFrame with time index and each trace gas concentration as a column returns a single plot for NOx, SO2, and O3 >>> ''' # Check to make sure the data is a valid dataframe if not isinstance(data, pd.DataFrame): print ("data is not a pandas DataFrame, thus this will not end well for you.") exit # If length of dates is zero, plot everything if len(dates) == 0: # Plot everything, yo! pass elif len(dates) == 1: # Plot just this date data = data[dates[0]] elif len(dates) == 2: # Plot between these dates data = data[dates[0]:dates[1]] else: sys.exit("Dates are not properly configured.") # Add columns for time to enable simple diurnal trends to be found data['Time'] = data.index.map(lambda x: x.strftime("%H:%M")) # Group the data by time and grab the statistics grouped = data.groupby('Time').describe().unstack() # set the index to be a str grouped.index = pd.to_datetime(grouped.index.astype(str)) # Plot fig, (ax1, ax2, ax3) = plt.subplots(3, figsize=(10,9), sharex=True) # Set plot titles and labels ax1.set_title(title, fontsize=14) ax1.set_ylabel(r'$\ [NO_x] (ppb)$', fontsize=14, weight='bold') ax2.set_ylabel(r'$\ [SO_2] (ppb)$', fontsize=14) ax3.set_ylabel(r'$\ [O_3] (ppb)$', fontsize=14) ax3.set_xlabel(xlabel, fontsize=14) # Make the ticks invisible on the first and second plots plt.setp( ax1.get_xticklabels(), visible=False) plt.setp( ax2.get_xticklabels(), visible=False) # Set y min to zero just in case: ax1.set_ylim(0,grouped['nox']['mean'].max()*1.05) ax2.set_ylim(0,grouped['so2']['mean'].max()*1.05) ax3.set_ylim(0,grouped['o3']['mean'].max()*1.05) # Plot means ax1.plot(grouped.index, grouped['nox']['mean'],'g', linewidth=2.0) ax2.plot(grouped.index, grouped['so2']['mean'], 'r', linewidth=2.0) ax3.plot(grouped.index, grouped['o3']['mean'], 'b', linewidth=2.0) # If shaded=true, plot trends if shaded == True: ax1.plot(grouped.index, grouped['nox']['75%'],'g') ax1.plot(grouped.index, grouped['nox']['25%'],'g') ax1.set_ylim(0,grouped['nox']['75%'].max()*1.05) ax1.fill_between(grouped.index, grouped['nox']['mean'], grouped['nox']['75%'], alpha=.5, facecolor='green') ax1.fill_between(grouped.index, grouped['nox']['mean'], grouped['nox']['25%'], alpha=.5, facecolor='green') ax2.plot(grouped.index, grouped['so2']['75%'],'r') ax2.plot(grouped.index, grouped['so2']['25%'],'r') ax2.set_ylim(0,grouped['so2']['75%'].max()*1.05) ax2.fill_between(grouped.index, grouped['so2']['mean'], grouped['so2']['75%'], alpha=.5, facecolor='red') ax2.fill_between(grouped.index, grouped['so2']['mean'], grouped['so2']['25%'], alpha=.5, facecolor='red') ax3.plot(grouped.index, grouped['o3']['75%'],'b') ax3.plot(grouped.index, grouped['o3']['25%'],'b') ax3.set_ylim(0,grouped['o3']['75%'].max()*1.05) ax3.fill_between(grouped.index, grouped['o3']['mean'], grouped['o3']['75%'], alpha=.5, facecolor='blue') ax3.fill_between(grouped.index, grouped['o3']['mean'], grouped['o3']['25%'], alpha=.5, facecolor='blue') # Get/Set xticks ticks = ax1.get_xticks() ax3.set_xticks(np.linspace(ticks[0], d.date2num(d.num2date(ticks[-1]) + dt.timedelta(hours=3)), 5)) ax3.set_xticks(np.linspace(ticks[0], d.date2num(d.num2date(ticks[-1]) + dt.timedelta(hours=3)), 25), minor=True) ax3.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%I:%M %p')) # Make the layout tight to get rid of some whitespace plt.tight_layout() plt.show() return (fig, (ax1, ax2, ax3)) def diurnal_plot_single(data, model='', dates=[], shaded=False, color1 = 'blue', title="Diurnal Profile of Trace Gases", xlabel="Local Time: East St. Louis, MO", ylabel=r'$\ [NO_x] (ppb)$'): ''' `data` should be a pandas core DataFrame with time index and each trace gas concentration as a column returns a single plot for one of the three analyzers. >>>diurnal_plot_single(data,model='o3', ylabel='O3', shaded=True, color1='green') ''' # Check to make sure the data is a valid dataframe if not isinstance(data, pd.DataFrame): sys.exit("data is not a pandas DataFrame, thus this will not end well for you.") # Check to make sure the model is valid if model.lower() not in ['nox','so2','o3','sox']: sys.exit("Model is not defined correctly: options are ['nox','so2','sox','o3']") # Set model to predefined variable if model.lower() == 'nox': instr = 'nox' elif model.lower() == 'so2' or model.lower() == 'sox': instr = 'sox' else: instr = 'o3' # If not plotting all the data, truncate the dataframe to include only the needed data if len(dates) == 0: # plot everything pass elif len(dates) == 1: # plot just this date data = data[dates[0]] elif len(dates) == 2: # plot between these dates data = data[dates[0]:dates[1]] else: sys.exit("You have an error with how you defined your dates") # Add columns for time to enable simple diurnal trends to be found data['Time'] = data.index.map(lambda x: x.strftime("%H:%M")) # Group the data by time and grab the statistics grouped = data.groupby('Time').describe().unstack() # set the index to be a str grouped.index = pd.to_datetime(grouped.index.astype(str)) # Plot fig, ax = plt.subplots(1, figsize=(8,4)) # Set plot titles and labels ax.set_title(title, fontsize=14) ax.set_ylabel(ylabel, fontsize=14, weight='bold') ax.set_xlabel(xlabel, fontsize=14) # Set y min to zero just in case: ax.set_ylim(0,grouped[instr]['mean'].max()*1.05) # Plot means ax.plot(grouped.index, grouped[instr]['mean'], color1,linewidth=2.0) # If shaded=true, plot trends if shaded == True: ax.plot(grouped.index, grouped[instr]['75%'],color1) ax.plot(grouped.index, grouped[instr]['25%'],color1) ax.set_ylim(0,grouped[instr]['75%'].max()*1.05) ax.fill_between(grouped.index, grouped[instr]['mean'], grouped[instr]['75%'], alpha=.5, facecolor=color1) ax.fill_between(grouped.index, grouped[instr]['mean'], grouped[instr]['25%'], alpha=.5, facecolor=color1) # Get/Set xticks ticks = ax.get_xticks() ax.set_xticks(np.linspace(ticks[0], d.date2num(d.num2date(ticks[-1]) + dt.timedelta(hours=3)), 5)) ax.set_xticks(np.linspace(ticks[0], d.date2num(d.num2date(ticks[-1]) + dt.timedelta(hours=3)), 25), minor=True) ax.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%I:%M %p')) # Make the layout tight to get rid of some whitespace plt.tight_layout() plt.show() return (fig, ax) class ThermoPlot(): ''' Allows for easy plotting of internal instrument data. Currently supports the following models: - NO, NO2, NOx (42I) - O3 (49I) - SO2 (43I) ''' def __init__(self, data): self.data = data def debug_plot(self, args={}): ''' Plots thermo scientific instrument data for debugging purposes. The top plot contains internal instrument data such as flow rates and temperatures. The bottom plot contains trace gas data for the instrument. instrument must be set to either nox, so2, sox, or o3 >>> nox = ThermoPlot(data) >>> f, (a1, a2, a3) = nox.debug_plot() ''' default_args = { 'xlabel':'Local Time, East St Louis, MO', 'ylabpressure':'Flow (LPM)', 'ylabgas':'Gas Conc. (ppb)', 'ylabtemp':'Temperature (C)', 'title_fontsize':'18', 'labels_fontsize':'14', 'grid':False } # Figure out what model we are trying to plot and set instrument specific default args cols = [i.lower() for i in self.data.columns.values.tolist()] if 'o3' in cols: default_args['instrument'] = 'o3' default_args['title'] = "Debug Plot for " + r'$\ O_{3} $' + ": Model 49I" default_args['color_o3'] = 'blue' elif 'sox' in cols or 'so2' in cols: default_args['instrument'] = 'so2' default_args['title'] = "Debug Plot for " + r'$\ SO_{2} $' + ": Model 43I" default_args['color_so2'] = 'green' elif 'nox' in cols: default_args['instrument'] = 'nox' default_args['title'] = "Debug Plot for " + r'$\ NO_{x} $' + ": Model 42I" default_args['color_no'] = '#FAB923' default_args['color_nox'] = '#FC5603' default_args['color_no2'] = '#FAE823' else: sys.exit("Could not figure out what isntrument this is for") # If kwargs are set, replace the default values for key, val in default_args.iteritems(): if args.has_key(key): default_args[key] = args[key] # Set up Plot and all three axes fig, (ax1, ax3) = plt.subplots(2, figsize=(10,6), sharex=True) ax2 = ax1.twinx() # set up axes labels and titles ax1.set_title(default_args['title'], fontsize=default_args['title_fontsize']) ax1.set_ylabel(default_args['ylabpressure'], fontsize=default_args['labels_fontsize']) ax2.set_ylabel(default_args['ylabtemp'], fontsize=default_args['labels_fontsize']) ax3.set_ylabel(default_args['ylabgas'], fontsize=default_args['labels_fontsize']) ax3.set_xlabel(default_args['xlabel'], fontsize=default_args['labels_fontsize']) # Make the ticks invisible on the first and second plots plt.setp( ax1.get_xticklabels(), visible=False ) # Plot the debug data on the top graph if default_args['instrument'] == 'o3': self.data['bncht'].plot(ax=ax2, label=r'$\ T_{bench}$') self.data['lmpt'].plot(ax=ax2, label=r'$\ T_{lamp}$') self.data['flowa'].plot(ax=ax1, label=r'$\ Q_{A}$', style='--') self.data['flowb'].plot(ax=ax1, label=r'$\ Q_{B}$', style='--') self.data['o3'].plot(ax=ax3, color=default_args['color_o3'], label=r'$\ O_{3}$') elif default_args['instrument'] == 'so2': self.data['intt'].plot(ax=ax2, label=r'$\ T_{internal}$') self.data['rctt'].plot(ax=ax2, label=r'$\ T_{reactor}$') self.data['smplfl'].plot(ax=ax1, label=r'$\ Q_{sample}$', style='--') self.data['so2'].plot(ax=ax3, label=r'$\ SO_2 $', color=default_args['color_so2'], ylim=[0,self.data['so2'].max()*1.05]) else: m = max(self.data['convt'].max(),self.data['intt'].max(),self.data['pmtt'].max()) self.data['convt'].plot(ax=ax2, label=r'$\ T_{converter}$') self.data['intt'].plot(ax=ax2, label=r'$\ T_{internal}$') self.data['rctt'].plot(ax=ax2, label=r'$\ T_{reactor}$') self.data['pmtt'].plot(ax=ax2, label=r'$\ T_{PMT}$') self.data['smplf'].plot(ax=ax1, label=r'$\ Q_{sample}$', style='--') self.data['ozonf'].plot(ax=ax1, label=r'$\ Q_{ozone}$', style='--') self.data['no'].plot(ax=ax3, label=r'$\ NO $', color=default_args['color_no']) self.data['no2'].plot(ax=ax3, label=r'$\ NO_{2}$', color=default_args['color_no2']) self.data['nox'].plot(ax=ax3, label=r'$\ NO_{x}$', color=default_args['color_nox'], ylim=(0,math.ceil(self.data.nox.max()*1.05))) # Legends lines, labels = ax1.get_legend_handles_labels() lines2, labels2 = ax2.get_legend_handles_labels() plt.legend(lines+lines2, labels+labels2, bbox_to_anchor=(1.10, 1), loc=2, borderaxespad=0.) ax3.legend(bbox_to_anchor=(1.10, 1.), loc=2, borderaxespad=0.) # Hide grids? ax1.grid(default_args['grid']) ax2.grid(default_args['grid']) ax3.grid(default_args['grid']) # More of the things.. plt.tight_layout() plt.show() return fig, (ax1, ax2, ax3)
mit
-598,425,282,136,535,900
40.070988
141
0.579964
false
timm/timmnix
pypy3-v5.5.0-linux64/lib-python/3/ctypes/util.py
1
8948
import sys, os import contextlib import subprocess # find_library(name) returns the pathname of a library, or None. if os.name == "nt": def _get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. """ # This function was copied from Lib/distutils/msvccompiler.py prefix = "MSC v." i = sys.version.find(prefix) if i == -1: return 6 i = i + len(prefix) s, rest = sys.version[i:].split(" ", 1) majorVersion = int(s[:-2]) - 6 minorVersion = int(s[2:3]) / 10.0 # I don't think paths are affected by minor version in version 6 if majorVersion == 6: minorVersion = 0 if majorVersion >= 6: return majorVersion + minorVersion # else we don't know what version of the compiler this is return None def find_msvcrt(): """Return the name of the VC runtime dll""" version = _get_build_version() if version is None: # better be safe than sorry return None if version <= 6: clibname = 'msvcrt' else: clibname = 'msvcr%d' % (version * 10) # If python was built with in debug mode import importlib.machinery if '_d.pyd' in importlib.machinery.EXTENSION_SUFFIXES: clibname += 'd' return clibname+'.dll' def find_library(name): if name in ('c', 'm'): return find_msvcrt() # See MSDN for the REAL search order. for directory in os.environ['PATH'].split(os.pathsep): fname = os.path.join(directory, name) if os.path.isfile(fname): return fname if fname.lower().endswith(".dll"): continue fname = fname + ".dll" if os.path.isfile(fname): return fname return None if os.name == "ce": # search path according to MSDN: # - absolute path specified by filename # - The .exe launch directory # - the Windows directory # - ROM dll files (where are they?) # - OEM specified search path: HKLM\Loader\SystemPath def find_library(name): return name if os.name == "posix" and sys.platform == "darwin": from ctypes.macholib.dyld import dyld_find as _dyld_find def find_library(name): possible = ['lib%s.dylib' % name, '%s.dylib' % name, '%s.framework/%s' % (name, name)] for name in possible: try: return _dyld_find(name) except ValueError: continue return None elif os.name == "posix": # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump import re, errno def _findLib_gcc(name): import tempfile expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp() os.close(fdout) cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;' \ 'LANG=C LC_ALL=C $CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: f = os.popen(cmd) try: trace = f.read() finally: rv = f.close() finally: try: os.unlink(ccout) except OSError as e: if e.errno != errno.ENOENT: raise if rv == 10: raise OSError('gcc or cc command not found') res = re.search(expr, trace) if not res: return None return res.group(0) if sys.platform == "sunos5": # use /usr/ccs/bin/dump on solaris def _get_soname(f): if not f: return None cmd = "/usr/ccs/bin/dump -Lpv 2>/dev/null " + f with contextlib.closing(os.popen(cmd)) as f: data = f.read() res = re.search(r'\[.*\]\sSONAME\s+([^\s]+)', data) if not res: return None return res.group(1) else: def _get_soname(f): # assuming GNU binutils / ELF if not f: return None cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \ "objdump -p -j .dynamic 2>/dev/null " + f f = os.popen(cmd) dump = f.read() rv = f.close() if rv == 10: raise OSError('objdump command not found') res = re.search(r'\sSONAME\s+([^\s]+)', dump) if not res: return None return res.group(1) if sys.platform.startswith(("freebsd", "openbsd", "dragonfly")): def _num_version(libname): # "libxyz.so.MAJOR.MINOR" => [ MAJOR, MINOR ] parts = libname.split(".") nums = [] try: while parts: nums.insert(0, int(parts.pop())) except ValueError: pass return nums or [ sys.maxsize ] def find_library(name): ename = re.escape(name) expr = r':-l%s\.\S+ => \S*/(lib%s\.\S+)' % (ename, ename) with contextlib.closing(os.popen('/sbin/ldconfig -r 2>/dev/null')) as f: data = f.read() res = re.findall(expr, data) if not res: return _get_soname(_findLib_gcc(name)) res.sort(key=_num_version) return res[-1] elif sys.platform == "sunos5": def _findLib_crle(name, is64): if not os.path.exists('/usr/bin/crle'): return None if is64: cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null' else: cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null' for line in os.popen(cmd).readlines(): line = line.strip() if line.startswith('Default Library Path (ELF):'): paths = line.split()[4] if not paths: return None for dir in paths.split(":"): libfile = os.path.join(dir, "lib%s.so" % name) if os.path.exists(libfile): return libfile return None def find_library(name, is64 = False): return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name)) else: def _findSoname_ldconfig(name): import struct if struct.calcsize('l') == 4: machine = os.uname().machine + '-32' else: machine = os.uname().machine + '-64' mach_map = { 'x86_64-64': 'libc6,x86-64', 'ppc64-64': 'libc6,64bit', 'sparc64-64': 'libc6,64bit', 's390x-64': 'libc6,64bit', 'ia64-64': 'libc6,IA-64', } abi_type = mach_map.get(machine, 'libc6') # XXX assuming GLIBC's ldconfig (with option -p) regex = os.fsencode( '\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)) try: with subprocess.Popen(['/sbin/ldconfig', '-p'], stdin=subprocess.DEVNULL, stderr=subprocess.DEVNULL, stdout=subprocess.PIPE, env={'LC_ALL': 'C', 'LANG': 'C'}) as p: res = re.search(regex, p.stdout.read()) if res: return os.fsdecode(res.group(1)) except OSError: pass def find_library(name): return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) ################################################################ # test code def test(): from ctypes import cdll if os.name == "nt": print(cdll.msvcrt) print(cdll.load("msvcrt")) print(find_library("msvcrt")) if os.name == "posix": # find and load_version print(find_library("m")) print(find_library("c")) print(find_library("bz2")) # getattr ## print cdll.m ## print cdll.bz2 # load if sys.platform == "darwin": print(cdll.LoadLibrary("libm.dylib")) print(cdll.LoadLibrary("libcrypto.dylib")) print(cdll.LoadLibrary("libSystem.dylib")) print(cdll.LoadLibrary("System.framework/System")) else: print(cdll.LoadLibrary("libm.so")) print(cdll.LoadLibrary("libcrypt.so")) print(find_library("crypt")) if __name__ == "__main__": test()
mit
3,323,634,384,645,102,000
32.639098
118
0.486142
false
ForeverWintr/ImageClassipy
clouds/tests/util/util.py
1
1283
""" Test utils """ import tempfile import PIL import numpy as np from clouds.util.constants import HealthStatus def createXors(tgt): #create test xor images xorIn = [ ((255, 255, 255, 255), HealthStatus.GOOD), ((255, 255, 0, 0), HealthStatus.CLOUDY), ((0, 0, 0, 0), HealthStatus.GOOD), ((0, 0, 255, 255), HealthStatus.CLOUDY), ] xorImages = [] for ar, expected in xorIn: npar = np.array(ar, dtype=np.uint8).reshape(2, 2) image = PIL.Image.fromarray(npar) #pybrain needs a lot of test input. We'll make 20 of each image for i in range(20): path = tempfile.mktemp(suffix=".png", prefix='xor_', dir=tgt) image.save(path) xorImages.append((path, expected)) return xorImages class MockStream(object): def __init__(self, inputQueue): """ A class used as a replacement for stream objects. As data are recieved on the inputQueue, make them available to `readline`. """ self.q = inputQueue def read(self): return [l for l in self.readline()] def readline(self): """ Block until an item appears in the queue. """ return self.q.get() def close(self): pass
mit
-8,206,075,774,888,230,000
24.156863
97
0.58067
false
klahnakoski/jx-sqlite
vendor/mo_logs/__init__.py
1
15837
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Contact: Kyle Lahnakoski ([email protected]) # from __future__ import absolute_import, division, unicode_literals import os import platform import sys from datetime import datetime from mo_dots import Data, FlatList, coalesce, is_data, is_list, listwrap, unwraplist, wrap from mo_future import PY3, is_text, text from mo_logs import constants, exceptions, strings from mo_logs.exceptions import Except, LogItem, suppress_exception from mo_logs.strings import CR, indent _Thread = None if PY3: STDOUT = sys.stdout.buffer else: STDOUT = sys.stdout class Log(object): """ FOR STRUCTURED LOGGING AND EXCEPTION CHAINING """ trace = False main_log = None logging_multi = None profiler = None # simple pypy-friendly profiler error_mode = False # prevent error loops @classmethod def start(cls, settings=None): """ RUN ME FIRST TO SETUP THE THREADED LOGGING http://victorlin.me/2012/08/good-logging-practice-in-python/ log - LIST OF PARAMETERS FOR LOGGER(S) trace - SHOW MORE DETAILS IN EVERY LOG LINE (default False) cprofile - True==ENABLE THE C-PROFILER THAT COMES WITH PYTHON (default False) USE THE LONG FORM TO SET THE FILENAME {"enabled": True, "filename": "cprofile.tab"} profile - True==ENABLE pyLibrary SIMPLE PROFILING (default False) (eg with Profiler("some description"):) USE THE LONG FORM TO SET FILENAME {"enabled": True, "filename": "profile.tab"} constants - UPDATE MODULE CONSTANTS AT STARTUP (PRIMARILY INTENDED TO CHANGE DEBUG STATE) """ global _Thread if not settings: return settings = wrap(settings) Log.stop() cls.settings = settings cls.trace = coalesce(settings.trace, False) if cls.trace: from mo_threads import Thread as _Thread _ = _Thread # ENABLE CPROFILE if settings.cprofile is False: settings.cprofile = {"enabled": False} elif settings.cprofile is True: if isinstance(settings.cprofile, bool): settings.cprofile = {"enabled": True, "filename": "cprofile.tab"} if settings.cprofile.enabled: from mo_threads import profiles profiles.enable_profilers(settings.cprofile.filename) if settings.profile is True or (is_data(settings.profile) and settings.profile.enabled): Log.error("REMOVED 2018-09-02, Activedata revision 3f30ff46f5971776f8ba18") # from mo_logs import profiles # # if isinstance(settings.profile, bool): # profiles.ON = True # settings.profile = {"enabled": True, "filename": "profile.tab"} # # if settings.profile.enabled: # profiles.ON = True if settings.constants: constants.set(settings.constants) logs = coalesce(settings.log, settings.logs) if logs: cls.logging_multi = StructuredLogger_usingMulti() for log in listwrap(logs): Log.add_log(Log.new_instance(log)) from mo_logs.log_usingThread import StructuredLogger_usingThread cls.main_log = StructuredLogger_usingThread(cls.logging_multi) @classmethod def stop(cls): """ DECONSTRUCTS ANY LOGGING, AND RETURNS TO DIRECT-TO-stdout LOGGING EXECUTING MULUTIPLE TIMES IN A ROW IS SAFE, IT HAS NO NET EFFECT, IT STILL LOGS TO stdout :return: NOTHING """ main_log, cls.main_log = cls.main_log, StructuredLogger_usingStream(STDOUT) main_log.stop() @classmethod def new_instance(cls, settings): settings = wrap(settings) if settings["class"]: if settings["class"].startswith("logging.handlers."): from mo_logs.log_usingHandler import StructuredLogger_usingHandler return StructuredLogger_usingHandler(settings) else: with suppress_exception: from mo_logs.log_usingLogger import make_log_from_settings return make_log_from_settings(settings) # OH WELL :( if settings.log_type == "logger": from mo_logs.log_usingLogger import StructuredLogger_usingLogger return StructuredLogger_usingLogger(settings) if settings.log_type == "file" or settings.file: return StructuredLogger_usingFile(settings.file) if settings.log_type == "file" or settings.filename: return StructuredLogger_usingFile(settings.filename) if settings.log_type == "console": from mo_logs.log_usingThreadedStream import StructuredLogger_usingThreadedStream return StructuredLogger_usingThreadedStream(STDOUT) if settings.log_type == "mozlog": from mo_logs.log_usingMozLog import StructuredLogger_usingMozLog return StructuredLogger_usingMozLog(STDOUT, coalesce(settings.app_name, settings.appname)) if settings.log_type == "stream" or settings.stream: from mo_logs.log_usingThreadedStream import StructuredLogger_usingThreadedStream return StructuredLogger_usingThreadedStream(settings.stream) if settings.log_type == "elasticsearch" or settings.stream: from mo_logs.log_usingElasticSearch import StructuredLogger_usingElasticSearch return StructuredLogger_usingElasticSearch(settings) if settings.log_type == "email": from mo_logs.log_usingEmail import StructuredLogger_usingEmail return StructuredLogger_usingEmail(settings) if settings.log_type == "ses": from mo_logs.log_usingSES import StructuredLogger_usingSES return StructuredLogger_usingSES(settings) if settings.log_type.lower() in ["nothing", "none", "null"]: from mo_logs.log_usingNothing import StructuredLogger return StructuredLogger() Log.error("Log type of {{log_type|quote}} is not recognized", log_type=settings.log_type) @classmethod def add_log(cls, log): cls.logging_multi.add_log(log) @classmethod def note( cls, template, default_params={}, stack_depth=0, log_context=None, **more_params ): """ :param template: *string* human readable string with placeholders for parameters :param default_params: *dict* parameters to fill in template :param stack_depth: *int* how many calls you want popped off the stack to report the *true* caller :param log_context: *dict* extra key:value pairs for your convenience :param more_params: *any more parameters (which will overwrite default_params) :return: """ timestamp = datetime.utcnow() if not is_text(template): Log.error("Log.note was expecting a unicode template") Log._annotate( LogItem( context=exceptions.NOTE, format=template, template=template, params=dict(default_params, **more_params) ), timestamp, stack_depth+1 ) @classmethod def unexpected( cls, template, default_params={}, cause=None, stack_depth=0, log_context=None, **more_params ): """ :param template: *string* human readable string with placeholders for parameters :param default_params: *dict* parameters to fill in template :param cause: *Exception* for chaining :param stack_depth: *int* how many calls you want popped off the stack to report the *true* caller :param log_context: *dict* extra key:value pairs for your convenience :param more_params: *any more parameters (which will overwrite default_params) :return: """ timestamp = datetime.utcnow() if not is_text(template): Log.error("Log.warning was expecting a unicode template") if isinstance(default_params, BaseException): cause = default_params default_params = {} if "values" in more_params.keys(): Log.error("Can not handle a logging parameter by name `values`") params = Data(dict(default_params, **more_params)) cause = unwraplist([Except.wrap(c) for c in listwrap(cause)]) trace = exceptions.get_stacktrace(stack_depth + 1) e = Except(exceptions.UNEXPECTED, template=template, params=params, cause=cause, trace=trace) Log._annotate( e, timestamp, stack_depth+1 ) @classmethod def alarm( cls, template, default_params={}, stack_depth=0, log_context=None, **more_params ): """ :param template: *string* human readable string with placeholders for parameters :param default_params: *dict* parameters to fill in template :param stack_depth: *int* how many calls you want popped off the stack to report the *true* caller :param log_context: *dict* extra key:value pairs for your convenience :param more_params: more parameters (which will overwrite default_params) :return: """ timestamp = datetime.utcnow() format = ("*" * 80) + CR + indent(template, prefix="** ").strip() + CR + ("*" * 80) Log._annotate( LogItem( context=exceptions.ALARM, format=format, template=template, params=dict(default_params, **more_params) ), timestamp, stack_depth + 1 ) alert = alarm @classmethod def warning( cls, template, default_params={}, cause=None, stack_depth=0, log_context=None, **more_params ): """ :param template: *string* human readable string with placeholders for parameters :param default_params: *dict* parameters to fill in template :param cause: *Exception* for chaining :param stack_depth: *int* how many calls you want popped off the stack to report the *true* caller :param log_context: *dict* extra key:value pairs for your convenience :param more_params: *any more parameters (which will overwrite default_params) :return: """ timestamp = datetime.utcnow() if not is_text(template): Log.error("Log.warning was expecting a unicode template") if isinstance(default_params, BaseException): cause = default_params default_params = {} if "values" in more_params.keys(): Log.error("Can not handle a logging parameter by name `values`") params = Data(dict(default_params, **more_params)) cause = unwraplist([Except.wrap(c) for c in listwrap(cause)]) trace = exceptions.get_stacktrace(stack_depth + 1) e = Except(exceptions.WARNING, template=template, params=params, cause=cause, trace=trace) Log._annotate( e, timestamp, stack_depth+1 ) @classmethod def error( cls, template, # human readable template default_params={}, # parameters for template cause=None, # pausible cause stack_depth=0, **more_params ): """ raise an exception with a trace for the cause too :param template: *string* human readable string with placeholders for parameters :param default_params: *dict* parameters to fill in template :param cause: *Exception* for chaining :param stack_depth: *int* how many calls you want popped off the stack to report the *true* caller :param log_context: *dict* extra key:value pairs for your convenience :param more_params: *any more parameters (which will overwrite default_params) :return: """ if not is_text(template): sys.stderr.write(str("Log.error was expecting a unicode template")) Log.error("Log.error was expecting a unicode template") if default_params and isinstance(listwrap(default_params)[0], BaseException): cause = default_params default_params = {} params = Data(dict(default_params, **more_params)) add_to_trace = False if cause == None: causes = None elif is_list(cause): causes = [] for c in listwrap(cause): # CAN NOT USE LIST-COMPREHENSION IN PYTHON3 (EXTRA STACK DEPTH FROM THE IN-LINED GENERATOR) causes.append(Except.wrap(c, stack_depth=1)) causes = FlatList(causes) elif isinstance(cause, BaseException): causes = Except.wrap(cause, stack_depth=1) else: causes = None Log.error("can only accept Exception, or list of exceptions") trace = exceptions.get_stacktrace(stack_depth + 1) if add_to_trace: cause[0].trace.extend(trace[1:]) e = Except(context=exceptions.ERROR, template=template, params=params, cause=causes, trace=trace) raise_from_none(e) @classmethod def _annotate( cls, item, timestamp, stack_depth ): """ :param itemt: A LogItemTHE TYPE OF MESSAGE :param stack_depth: FOR TRACKING WHAT LINE THIS CAME FROM :return: """ item.timestamp = timestamp item.machine = machine_metadata item.template = strings.limit(item.template, 10000) item.format = strings.limit(item.format, 10000) if item.format == None: format = text(item) else: format = item.format.replace("{{", "{{params.") if not format.startswith(CR) and format.find(CR) > -1: format = CR + format if cls.trace: log_format = item.format = "{{machine.name}} (pid {{machine.pid}}) - {{timestamp|datetime}} - {{thread.name}} - \"{{location.file}}:{{location.line}}\" - ({{location.method}}) - " + format f = sys._getframe(stack_depth + 1) item.location = { "line": f.f_lineno, "file": text(f.f_code.co_filename), "method": text(f.f_code.co_name) } thread = _Thread.current() item.thread = {"name": thread.name, "id": thread.id} else: log_format = item.format = "{{timestamp|datetime}} - " + format cls.main_log.write(log_format, item.__data__()) def write(self): raise NotImplementedError def _same_frame(frameA, frameB): return (frameA.line, frameA.file) == (frameB.line, frameB.file) # GET THE MACHINE METADATA machine_metadata = wrap({ "pid": os.getpid(), "python": text(platform.python_implementation()), "os": text(platform.system() + platform.release()).strip(), "name": text(platform.node()) }) def raise_from_none(e): raise e if PY3: exec("def raise_from_none(e):\n raise e from None\n", globals(), locals()) from mo_logs.log_usingFile import StructuredLogger_usingFile from mo_logs.log_usingMulti import StructuredLogger_usingMulti from mo_logs.log_usingStream import StructuredLogger_usingStream if not Log.main_log: Log.main_log = StructuredLogger_usingStream(STDOUT)
mpl-2.0
-3,171,591,599,001,485,000
35.916084
200
0.612111
false
inside-track/pemi
pemi/fields.py
1
7300
import decimal import datetime import json from functools import wraps import dateutil import pemi.transforms __all__ = [ 'StringField', 'IntegerField', 'FloatField', 'DateField', 'DateTimeField', 'BooleanField', 'DecimalField', 'JsonField' ] BLANK_DATE_VALUES = ['null', 'none', 'nan', 'nat'] class CoercionError(ValueError): pass class DecimalCoercionError(ValueError): pass def convert_exception(fun): @wraps(fun) def wrapper(self, value): try: coerced = fun(self, value) except Exception as err: raise CoercionError('Unable to coerce value "{}" to {}: {}: {}'.format( value, self.__class__.__name__, err.__class__.__name__, err )) return coerced return wrapper #pylint: disable=too-few-public-methods class Field: ''' A field is a thing that is inherited ''' def __init__(self, name=None, **metadata): self.name = name self.metadata = metadata default_metadata = {'null': None} self.metadata = {**default_metadata, **metadata} self.null = self.metadata['null'] @convert_exception def coerce(self, value): raise NotImplementedError def __str__(self): return '<{} {}>'.format(self.__class__.__name__, self.__dict__.__str__()) def __eq__(self, other): return type(self) is type(other) \ and self.metadata == other.metadata \ and self.name == other.name class StringField(Field): def __init__(self, name=None, **metadata): metadata['null'] = metadata.get('null', '') super().__init__(name=name, **metadata) @convert_exception def coerce(self, value): if pemi.transforms.isblank(value): return self.null return str(value).strip() class IntegerField(Field): def __init__(self, name=None, **metadata): super().__init__(name=name, **metadata) self.coerce_float = self.metadata.get('coerce_float', False) @convert_exception def coerce(self, value): if pemi.transforms.isblank(value): return self.null if self.coerce_float: return int(float(value)) return int(value) class FloatField(Field): @convert_exception def coerce(self, value): if pemi.transforms.isblank(value): return self.null return float(value) class DateField(Field): def __init__(self, name=None, **metadata): super().__init__(name=name, **metadata) self.format = self.metadata.get('format', '%Y-%m-%d') self.infer_format = self.metadata.get('infer_format', False) @convert_exception def coerce(self, value): if hasattr(value, 'strip'): value = value.strip() if pemi.transforms.isblank(value) or ( isinstance(value, str) and value.lower() in BLANK_DATE_VALUES): return self.null return self.parse(value) def parse(self, value): if isinstance(value, datetime.datetime): return value.date() if isinstance(value, datetime.date): return value if not self.infer_format: return datetime.datetime.strptime(value, self.format).date() return dateutil.parser.parse(value).date() class DateTimeField(Field): def __init__(self, name=None, **metadata): super().__init__(name=name, **metadata) self.format = self.metadata.get('format', '%Y-%m-%d %H:%M:%S') self.infer_format = self.metadata.get('infer_format', False) @convert_exception def coerce(self, value): if hasattr(value, 'strip'): value = value.strip() if pemi.transforms.isblank(value) or ( isinstance(value, str) and value.lower() in BLANK_DATE_VALUES): return self.null return self.parse(value) def parse(self, value): if isinstance(value, datetime.datetime): return value if isinstance(value, datetime.date): return datetime.datetime.combine(value, datetime.time.min) if not self.infer_format: return datetime.datetime.strptime(value, self.format) return dateutil.parser.parse(value) class BooleanField(Field): # when defined, the value of unknown_truthiness is used when no matching is found def __init__(self, name=None, **metadata): super().__init__(name=name, **metadata) self.true_values = self.metadata.get( 'true_values', ['t', 'true', 'y', 'yes', 'on', '1'] ) self.false_values = self.metadata.get( 'false_values', ['f', 'false', 'n', 'no', 'off', '0'] ) @convert_exception def coerce(self, value): if hasattr(value, 'strip'): value = value.strip() if isinstance(value, bool): return value if pemi.transforms.isblank(value): return self.null return self.parse(value) def parse(self, value): value = str(value).lower() if value in self.true_values: return True if value in self.false_values: return False if 'unknown_truthiness' in self.metadata: return self.metadata['unknown_truthiness'] raise ValueError('Not a boolean value') class DecimalField(Field): def __init__(self, name=None, **metadata): super().__init__(name=name, **metadata) self.precision = self.metadata.get('precision', 16) self.scale = self.metadata.get('scale', 2) self.truncate_decimal = self.metadata.get('truncate_decimal', False) self.enforce_decimal = self.metadata.get('enforce_decimal', True) @convert_exception def coerce(self, value): if pemi.transforms.isblank(value): return self.null return self.parse(value) def parse(self, value): dec = decimal.Decimal(str(value)) if dec != dec: #pylint: disable=comparison-with-itself return dec if self.truncate_decimal: dec = round(dec, self.scale) if self.enforce_decimal: detected_precision = len(dec.as_tuple().digits) detected_scale = -dec.as_tuple().exponent if detected_precision > self.precision: msg = ('Decimal coercion error for "{}". ' \ + 'Expected precision: {}, Actual precision: {}').format( dec, self.precision, detected_precision ) raise DecimalCoercionError(msg) if detected_scale > self.scale: msg = ('Decimal coercion error for "{}". ' \ + 'Expected scale: {}, Actual scale: {}').format( dec, self.scale, detected_scale ) raise DecimalCoercionError(msg) return dec class JsonField(Field): @convert_exception def coerce(self, value): if pemi.transforms.isblank(value): return self.null try: return json.loads(value) except TypeError: return value #pylint: enable=too-few-public-methods
mit
-8,599,383,492,297,377,000
28.918033
85
0.574521
false
Robpol86/FlashAirMusic
tests/test_convert_transcode.py
1
13863
"""Test functions in module.""" import asyncio import itertools import re import signal from textwrap import dedent import pytest from flash_air_music.configuration import FFMPEG_DEFAULT_BINARY from flash_air_music.convert import transcode from flash_air_music.convert.discover import get_songs, Song from tests import HERE @pytest.mark.skipif(str(FFMPEG_DEFAULT_BINARY is None)) def test_convert_file_success(monkeypatch, tmpdir, caplog): """Test convert_file() with no errors. :param monkeypatch: pytest fixture. :param tmpdir: pytest fixture. :param caplog: pytest extension fixture. """ monkeypatch.setattr(transcode, 'GLOBAL_MUTABLE_CONFIG', {'--ffmpeg-bin': FFMPEG_DEFAULT_BINARY}) monkeypatch.setattr(transcode, 'SLEEP_FOR', 0.1) source_dir = tmpdir.ensure_dir('source') target_dir = tmpdir.ensure_dir('target') HERE.join('1khz_sine_2.mp3').copy(source_dir.join('song1.mp3')) song = Song(str(source_dir.join('song1.mp3')), str(source_dir), str(target_dir)) assert song.needs_action is True # Run. loop = asyncio.get_event_loop() command, exit_status = loop.run_until_complete(transcode.convert_file(song))[1:] messages = [r.message for r in caplog.records if r.name.startswith('flash_air_music')] # Verify. assert exit_status == 0 assert target_dir.join('song1.mp3').check(file=True) assert Song(str(source_dir.join('song1.mp3')), str(source_dir), str(target_dir)).needs_action is False # Verify log. command_str = str(command) assert 'Converting song1.mp3' in messages assert 'Storing metadata in song1.mp3' in messages assert any(command_str in m for m in messages) assert any(re.match(r'^Process \d+ exited 0$', m) for m in messages) @pytest.mark.skipif(str(FFMPEG_DEFAULT_BINARY is None)) @pytest.mark.parametrize('delete', [False, True]) def test_convert_file_failure(monkeypatch, tmpdir, caplog, delete): """Test convert_file() with errors. :param monkeypatch: pytest fixture. :param tmpdir: pytest fixture. :param caplog: pytest extension fixture. :param bool delete: Test removing bad target file. """ ffmpeg = tmpdir.join('ffmpeg') ffmpeg.write(dedent("""\ #!/bin/bash exit 1 """)) ffmpeg.chmod(0o0755) monkeypatch.setattr(transcode, 'GLOBAL_MUTABLE_CONFIG', {'--ffmpeg-bin': str(ffmpeg)}) monkeypatch.setattr(transcode, 'SLEEP_FOR', 0.1) source_dir = tmpdir.ensure_dir('source') target_dir = tmpdir.ensure_dir('target') HERE.join('1khz_sine_2.mp3').copy(source_dir.join('song1.mp3')) if delete: HERE.join('1khz_sine_2.mp3').copy(target_dir.join('song1.mp3')) song = Song(str(source_dir.join('song1.mp3')), str(source_dir), str(target_dir)) assert song.needs_action is True # Run. loop = asyncio.get_event_loop() command, exit_status = loop.run_until_complete(transcode.convert_file(song))[1:] messages = [r.message for r in caplog.records if r.name.startswith('flash_air_music')] # Verify. assert exit_status == 1 assert not target_dir.join('song1.mp3').check(file=True) assert Song(str(source_dir.join('song1.mp3')), str(source_dir), str(target_dir)).needs_action is True # Verify log. command_str = str(command) assert 'Converting song1.mp3' in messages assert 'Storing metadata in song1.mp3' not in messages assert 'Failed to convert song1.mp3! ffmpeg exited 1.' in messages assert any(command_str in m for m in messages) assert any(re.match(r'^Process \d+ exited 1$', m) for m in messages) if delete: assert 'Removing {}'.format(target_dir.join('song1.mp3')) in messages else: assert 'Removing {}'.format(target_dir.join('song1.mp3')) not in messages @pytest.mark.skipif(str(FFMPEG_DEFAULT_BINARY is None)) def test_convert_file_deadlock(monkeypatch, tmpdir, caplog): """Test convert_file() with ffmpeg outputting a lot of data, filling up buffers. :param monkeypatch: pytest fixture. :param tmpdir: pytest fixture. :param caplog: pytest extension fixture. """ ffmpeg = tmpdir.join('ffmpeg') ffmpeg.write(dedent("""\ #!/bin/bash ffmpeg $@ for i in {1..10240}; do echo -n test_stdout$i; done for i in {1..10240}; do echo -n test_stderr$i >&2; done """)) ffmpeg.chmod(0o0755) monkeypatch.setattr(transcode, 'GLOBAL_MUTABLE_CONFIG', {'--ffmpeg-bin': str(ffmpeg)}) source_dir = tmpdir.ensure_dir('source') target_dir = tmpdir.ensure_dir('target') HERE.join('1khz_sine_2.mp3').copy(source_dir.join('song1.mp3')) song = Song(str(source_dir.join('song1.mp3')), str(source_dir), str(target_dir)) # Run. loop = asyncio.get_event_loop() command, exit_status = loop.run_until_complete(transcode.convert_file(song))[1:] messages = [r.message for r in caplog.records if r.name.startswith('flash_air_music')] # Verify. assert exit_status == 0 assert target_dir.join('song1.mp3').check(file=True) assert Song(str(source_dir.join('song1.mp3')), str(source_dir), str(target_dir)).needs_action is False # Verify log. command_str = str(command) assert 'Converting song1.mp3' in messages assert 'Storing metadata in song1.mp3' in messages assert any(command_str in m for m in messages) assert any(re.match(r'^Process \d+ exited 0$', m) for m in messages) assert any(re.match(r'^Process \d+ still running\.\.\.$', m) for m in messages) assert any(m.endswith('test_stdout10240') for m in messages) assert any(m.endswith('test_stderr10240') for m in messages) @pytest.mark.parametrize('exit_signal', [signal.SIGINT, signal.SIGTERM, signal.SIGKILL]) def test_convert_file_timeout(monkeypatch, tmpdir, caplog, exit_signal): """Test convert_file() with a stalled process. :param monkeypatch: pytest fixture. :param tmpdir: pytest fixture. :param caplog: pytest extension fixture. :param int exit_signal: Script exits on this signal. """ ffmpeg = tmpdir.join('ffmpeg') ffmpeg.write(dedent("""\ #!/usr/bin/env python import os, signal, sys, time def exit(signum, _): if int(os.environ['EXIT_SIGNAL']) == signum: print('Catching {}'.format(os.environ['EXIT_SIGNAL'])) sys.exit(2) print('Ignoring {}'.format(signum)) signal.signal(signal.SIGINT, exit) signal.signal(signal.SIGTERM, exit) for i in range(10): print(i) time.sleep(1) sys.exit(1) """)) ffmpeg.chmod(0o0755) monkeypatch.setattr(transcode, 'GLOBAL_MUTABLE_CONFIG', {'--ffmpeg-bin': str(ffmpeg)}) monkeypatch.setattr(transcode, 'SLEEP_FOR', 0.1) monkeypatch.setattr(transcode, 'TIMEOUT', 0.5) monkeypatch.setenv('EXIT_SIGNAL', exit_signal) source_dir = tmpdir.ensure_dir('source') target_dir = tmpdir.ensure_dir('target') HERE.join('1khz_sine_2.mp3').copy(source_dir.join('song1.mp3')) song = Song(str(source_dir.join('song1.mp3')), str(source_dir), str(target_dir)) # Run. loop = asyncio.get_event_loop() exit_status = loop.run_until_complete(transcode.convert_file(song))[-1] messages = [r.message for r in caplog.records if r.name.startswith('flash_air_music')] # Verify. assert exit_status == (2 if exit_signal != signal.SIGKILL else -9) assert 'Converting song1.mp3' in messages assert 'Storing metadata in song1.mp3' not in messages assert any(re.match(r'^Process \d+ exited {}$'.format(exit_status), m) for m in messages) assert any(re.match(r'^Process \d+ still running\.\.\.$', m) for m in messages) # Verify based on exit_signal. sent_signals = [m for m in messages if m.startswith('Timeout exceeded')] assert sent_signals[0].startswith('Timeout exceeded, sending signal 2') if exit_signal in (signal.SIGTERM, signal.SIGKILL): assert sent_signals[1].startswith('Timeout exceeded, sending signal 15') if exit_signal == signal.SIGKILL: assert sent_signals[2].startswith('Timeout exceeded, sending signal 9') @pytest.mark.skipif(str(FFMPEG_DEFAULT_BINARY is None)) @pytest.mark.parametrize('mode', ['failure', 'exception']) def test_convert_songs_errors(monkeypatch, tmpdir, caplog, mode): """Test convert_songs()'s error handling. :param monkeypatch: pytest fixture. :param tmpdir: pytest fixture. :param caplog: pytest extension fixture. :param str mode: Scenario to test for. """ ffmpeg = tmpdir.join('ffmpeg') if mode != 'exception': ffmpeg.write(dedent("""\ #!/bin/bash [ "$ERROR_ON" == "$(basename $2)" ] && exit 2 ffmpeg $@ """)) ffmpeg.chmod(0o0755) monkeypatch.setattr(transcode, 'GLOBAL_MUTABLE_CONFIG', {'--ffmpeg-bin': str(ffmpeg), '--threads': '2'}) monkeypatch.setenv('ERROR_ON', 'song1.mp3' if mode == 'failure' else '') source_dir = tmpdir.ensure_dir('source') target_dir = tmpdir.ensure_dir('target') HERE.join('1khz_sine_2.mp3').copy(source_dir.join('song1.mp3')) HERE.join('1khz_sine_2.mp3').copy(source_dir.join('song2.mp3')) songs = get_songs(str(source_dir), str(target_dir))[0] # Run. loop = asyncio.get_event_loop() loop.run_until_complete(transcode.convert_songs(songs)) messages = [r.message for r in caplog.records if r.name.startswith('flash_air_music')] # Verify files. assert not target_dir.join('song1.mp3').check() if mode == 'exception': assert not target_dir.join('song2.mp3').check() else: assert target_dir.join('song2.mp3').check(file=True) # Verify log. assert 'Storing metadata in song1.mp3' not in messages if mode == 'exception': assert 'Storing metadata in song2.mp3' not in messages assert len([True for m in messages if m.startswith('BUG!')]) == 2 assert any(re.match(r'Beginning to convert 2 file\(s\) up to 2 at a time\.$', m) for m in messages) assert any(re.match(r'Done converting 2 file\(s\) \(2 failed\)\.$', m) for m in messages) elif mode == 'failure': assert 'Storing metadata in song2.mp3' in messages assert len([True for m in messages if m.startswith('BUG!')]) == 0 assert any(re.match(r'Beginning to convert 2 file\(s\) up to 2 at a time\.$', m) for m in messages) assert any(re.match(r'Done converting 2 file\(s\) \(1 failed\)\.$', m) for m in messages) @pytest.mark.skipif(str(FFMPEG_DEFAULT_BINARY is None)) def test_convert_songs_single(monkeypatch, tmpdir, caplog): """Test convert_songs() with one file. :param monkeypatch: pytest fixture. :param tmpdir: pytest fixture. :param caplog: pytest extension fixture. """ monkeypatch.setattr(transcode, 'GLOBAL_MUTABLE_CONFIG', {'--ffmpeg-bin': FFMPEG_DEFAULT_BINARY, '--threads': '2'}) source_dir = tmpdir.ensure_dir('source') target_dir = tmpdir.ensure_dir('target') HERE.join('1khz_sine_2.mp3').copy(source_dir.join('song1.mp3')) songs = get_songs(str(source_dir), str(target_dir))[0] # Run. loop = asyncio.get_event_loop() loop.run_until_complete(transcode.convert_songs(songs)) messages = [r.message for r in caplog.records if r.name.startswith('flash_air_music')] # Verify. assert target_dir.join('song1.mp3').check(file=True) assert 'Storing metadata in song1.mp3' in messages assert any(re.match(r'Beginning to convert 1 file\(s\) up to 2 at a time\.$', m) for m in messages) assert any(re.match(r'Done converting 1 file\(s\) \(0 failed\)\.$', m) for m in messages) @pytest.mark.skipif(str(FFMPEG_DEFAULT_BINARY is None)) def test_convert_songs_semaphore(monkeypatch, tmpdir, caplog): """Test convert_songs() concurrency limit. :param monkeypatch: pytest fixture. :param tmpdir: pytest fixture. :param caplog: pytest extension fixture. """ ffmpeg = tmpdir.join('ffmpeg') ffmpeg.write(dedent("""\ #!/bin/bash python3 -c "import time; print('$(basename $2) START_TIME:', time.time())" ffmpeg $@ python3 -c "import time; print('$(basename $2) END_TIME:', time.time())" """)) ffmpeg.chmod(0o0755) monkeypatch.setattr(transcode, 'GLOBAL_MUTABLE_CONFIG', {'--ffmpeg-bin': str(ffmpeg), '--threads': '2'}) source_dir = tmpdir.ensure_dir('source') target_dir = tmpdir.ensure_dir('target') HERE.join('1khz_sine_2.mp3').copy(source_dir.join('song1.mp3')) HERE.join('1khz_sine_2.mp3').copy(source_dir.join('song2.mp3')) HERE.join('1khz_sine_2.mp3').copy(source_dir.join('song3.mp3')) HERE.join('1khz_sine_2.mp3').copy(source_dir.join('song4.mp3')) songs = get_songs(str(source_dir), str(target_dir))[0] # Run. loop = asyncio.get_event_loop() loop.run_until_complete(transcode.convert_songs(songs)) messages = [r.message for r in caplog.records if r.name.startswith('flash_air_music')] # Verify. assert target_dir.join('song1.mp3').check(file=True) assert 'Storing metadata in song1.mp3' in messages assert 'Storing metadata in song2.mp3' in messages assert 'Storing metadata in song3.mp3' in messages assert 'Storing metadata in song4.mp3' in messages assert any(re.match(r'Beginning to convert 4 file\(s\) up to 2 at a time\.$', m) for m in messages) assert any(re.match(r'Done converting 4 file\(s\) \(0 failed\)\.$', m) for m in messages) # Verify overlaps. regex = re.compile(r'(song\d\.mp3) START_TIME: ([\d\.]+)\n\1 END_TIME: ([\d\.]+)') intervals = [(float(p[0]), float(p[1])) for p in (g.groups()[1:] for g in (regex.search(m) for m in messages) if g)] intervals.sort() assert len(intervals) == 4 overlaps = 0 for a, b in itertools.combinations(range(4), 2): if intervals[b][0] < intervals[a][0] < intervals[b][1] or intervals[a][0] < intervals[b][0] < intervals[a][1]: overlaps += 1 assert overlaps <= 3
mit
-7,235,192,991,105,716,000
41.655385
120
0.66508
false
ijat/Hotspot-PUTRA-Auto-login
PyInstaller-3.2/PyInstaller/hooks/hook-PyQt5.QtWebEngineWidgets.py
1
2207
#----------------------------------------------------------------------------- # Copyright (c) 2014-2016, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- import os from PyInstaller.utils.hooks import get_qmake_path import PyInstaller.compat as compat hiddenimports = ["sip", "PyQt5.QtCore", "PyQt5.QtGui", "PyQt5.QtNetwork", "PyQt5.QtWebChannel", ] # Find the additional files necessary for QtWebEngine. # Currently only implemented for OSX. # Note that for QtWebEngineProcess to be able to find icudtl.dat the bundle_identifier # must be set to 'org.qt-project.Qt.QtWebEngineCore'. This can be done by passing # bundle_identifier='org.qt-project.Qt.QtWebEngineCore' to the BUNDLE command in # the .spec file. FIXME: This is not ideal and a better solution is required. qmake = get_qmake_path('5') if qmake: libdir = compat.exec_command(qmake, "-query", "QT_INSTALL_LIBS").strip() if compat.is_darwin: binaries = [ (os.path.join(libdir, 'QtWebEngineCore.framework', 'Versions', '5',\ 'Helpers', 'QtWebEngineProcess.app', 'Contents', 'MacOS', 'QtWebEngineProcess'), os.path.join('QtWebEngineProcess.app', 'Contents', 'MacOS')) ] resources_dir = os.path.join(libdir, 'QtWebEngineCore.framework', 'Versions', '5', 'Resources') datas = [ (os.path.join(resources_dir, 'icudtl.dat'),''), (os.path.join(resources_dir, 'qtwebengine_resources.pak'), ''), # The distributed Info.plist has LSUIElement set to true, which prevents the # icon from appearing in the dock. (os.path.join(libdir, 'QtWebEngineCore.framework', 'Versions', '5',\ 'Helpers', 'QtWebEngineProcess.app', 'Contents', 'Info.plist'), os.path.join('QtWebEngineProcess.app', 'Contents')) ]
gpl-3.0
6,505,215,117,670,279,000
44.040816
106
0.589488
false
loli/medpy
bin/medpy_diff.py
1
3675
#!/usr/bin/env python """ Compares the pixel values of two images and gives a measure of the difference. Copyright (C) 2013 Oskar Maier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.""" # build-in modules import sys import argparse import logging # third-party modules import scipy # path changes # own modules from medpy.core import Logger from medpy.io import load from functools import reduce # information __author__ = "Oskar Maier" __version__ = "r0.1.0, 2012-05-25" __email__ = "[email protected]" __status__ = "Release" __description__ = """ Compares the pixel values of two images and gives a measure of the difference. Also compares the dtype and shape. Copyright (C) 2013 Oskar Maier This program comes with ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to redistribute it under certain conditions; see the LICENSE file or <http://www.gnu.org/licenses/> for details. """ # code def main(): args = getArguments(getParser()) # prepare logger logger = Logger.getInstance() if args.debug: logger.setLevel(logging.DEBUG) elif args.verbose: logger.setLevel(logging.INFO) # load input image1 data_input1, _ = load(args.input1) # load input image2 data_input2, _ = load(args.input2) # compare dtype and shape if not data_input1.dtype == data_input2.dtype: print('Dtype differs: {} to {}'.format(data_input1.dtype, data_input2.dtype)) if not data_input1.shape == data_input2.shape: print('Shape differs: {} to {}'.format(data_input1.shape, data_input2.shape)) print('The voxel content of images of different shape can not be compared. Exiting.') sys.exit(-1) # compare image data voxel_total = reduce(lambda x, y: x*y, data_input1.shape) voxel_difference = len((data_input1 != data_input2).nonzero()[0]) if not 0 == voxel_difference: print('Voxel differ: {} of {} total voxels'.format(voxel_difference, voxel_total)) print('Max difference: {}'.format(scipy.absolute(data_input1 - data_input2).max())) else: print('No other difference.') logger.info("Successfully terminated.") def getArguments(parser): "Provides additional validation of the arguments collected by argparse." return parser.parse_args() def getParser(): "Creates and returns the argparse parser object." parser = argparse.ArgumentParser(description=__description__) parser.add_argument('input1', help='Source volume one.') parser.add_argument('input2', help='Source volume two.') parser.add_argument('-v', dest='verbose', action='store_true', help='Display more information.') parser.add_argument('-d', dest='debug', action='store_true', help='Display debug information.') parser.add_argument('-f', dest='force', action='store_true', help='Silently override existing output images.') return parser if __name__ == "__main__": main()
gpl-3.0
8,040,638,095,303,360,000
35.76
128
0.673469
false
alphagov/stagecraft
stagecraft/apps/dashboards/models/dashboard.py
1
14599
from __future__ import unicode_literals import uuid from django.core.validators import RegexValidator from django.db import models from stagecraft.apps.organisation.models import Node from stagecraft.apps.users.models import User from django.db.models.query import QuerySet def list_to_tuple_pairs(elements): return tuple([(element, element) for element in elements]) class DashboardManager(models.Manager): def by_tx_id(self, tx_id): filter_string = '"service_id:{}"'.format(tx_id) return self.raw(''' SELECT DISTINCT dashboards_dashboard.* FROM dashboards_module INNER JOIN dashboards_dashboard ON dashboards_dashboard.id = dashboards_module.dashboard_id, json_array_elements(query_parameters::json->'filter_by') AS filters WHERE filters::text = %s AND data_set_id=(SELECT id FROM datasets_dataset WHERE name='transactional_services_summaries') AND dashboards_dashboard.status='published' ''', [filter_string]) def get_query_set(self): return QuerySet(self.model, using=self._db) def for_user(self, user): return self.get_query_set().filter(owners=user) class Dashboard(models.Model): objects = DashboardManager() id = models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True) slug_validator = RegexValidator( '^[-a-z0-9]+$', message='Slug can only contain lower case letters, numbers or hyphens' ) slug = models.CharField( max_length=1000, unique=True, validators=[ slug_validator ] ) owners = models.ManyToManyField(User) dashboard_types = [ 'transaction', 'high-volume-transaction', 'service-group', 'agency', 'department', 'content', 'other', ] customer_types = [ '', 'Business', 'Individuals', 'Business and individuals', 'Charity', ] business_models = [ '', 'Department budget', 'Fees and charges', 'Taxpayers', 'Fees and charges, and taxpayers', ] straplines = [ 'Dashboard', 'Service dashboard', 'Content dashboard', 'Performance', 'Policy dashboard', 'Public sector purchasing dashboard', 'Topic Explorer', 'Service Explorer', ] dashboard_type = models.CharField( max_length=30, choices=list_to_tuple_pairs(dashboard_types), default=dashboard_types[0] ) page_type = models.CharField(max_length=80, default='dashboard') status = models.CharField( max_length=30, default='unpublished' ) title = models.CharField(max_length=256) description = models.CharField(max_length=500, blank=True) description_extra = models.CharField(max_length=400, blank=True) costs = models.CharField(max_length=1500, blank=True) other_notes = models.CharField(max_length=1000, blank=True) customer_type = models.CharField( max_length=30, choices=list_to_tuple_pairs(customer_types), default=customer_types[0], blank=True ) business_model = models.CharField( max_length=31, choices=list_to_tuple_pairs(business_models), default=business_models[0], blank=True ) # 'department' is not being considered for now # 'agency' is not being considered for now improve_dashboard_message = models.BooleanField(default=True) strapline = models.CharField( max_length=40, choices=list_to_tuple_pairs(straplines), default=straplines[0] ) tagline = models.CharField(max_length=400, blank=True) _organisation = models.ForeignKey( 'organisation.Node', blank=True, null=True, db_column='organisation_id') @property def published(self): return self.status == 'published' @published.setter def published(self, value): if value is True: self.status = 'published' else: self.status = 'unpublished' @property def organisation(self): return self._organisation @organisation.setter def organisation(self, node): self.department_cache = None self.agency_cache = None self.service_cache = None self.transaction_cache = None self._organisation = node if node is not None: for n in node.get_ancestors(include_self=True): if n.typeOf.name == 'department': self.department_cache = n elif n.typeOf.name == 'agency': self.agency_cache = n elif n.typeOf.name == 'service': self.service_cache = n elif n.typeOf.name == 'transaction': self.transaction_cache = n # Denormalise org tree for querying ease. department_cache = models.ForeignKey( 'organisation.Node', blank=True, null=True, related_name='dashboards_owned_by_department') agency_cache = models.ForeignKey( 'organisation.Node', blank=True, null=True, related_name='dashboards_owned_by_agency') service_cache = models.ForeignKey( 'organisation.Node', blank=True, null=True, related_name='dashboards_owned_by_service') transaction_cache = models.ForeignKey( 'organisation.Node', blank=True, null=True, related_name='dashboards_owned_by_transaction') spotlightify_base_fields = [ 'business_model', 'costs', 'customer_type', 'dashboard_type', 'description', 'description_extra', 'other_notes', 'page_type', 'published', 'slug', 'strapline', 'tagline', 'title' ] list_base_fields = [ 'slug', 'title', 'dashboard_type' ] @classmethod def list_for_spotlight(cls): dashboards = Dashboard.objects.filter(status='published')\ .select_related('department_cache', 'agency_cache', 'service_cache') def spotlightify_for_list(item): return item.spotlightify_for_list() return { 'page-type': 'browse', 'items': map(spotlightify_for_list, dashboards), } def spotlightify_for_list(self): base_dict = self.list_base_dict() if self.department_cache is not None: base_dict['department'] = self.department_cache.spotlightify() if self.agency_cache is not None: base_dict['agency'] = self.agency_cache.spotlightify() if self.service_cache is not None: base_dict['service'] = self.service_cache.spotlightify() return base_dict def spotlightify_base_dict(self): base_dict = {} for field in self.spotlightify_base_fields: base_dict[field.replace('_', '-')] = getattr(self, field) return base_dict def list_base_dict(self): base_dict = {} for field in self.list_base_fields: base_dict[field.replace('_', '-')] = getattr(self, field) return base_dict def related_pages_dict(self): related_pages_dict = {} transaction_link = self.get_transaction_link() if transaction_link: related_pages_dict['transaction'] = ( transaction_link.serialize()) related_pages_dict['other'] = [ link.serialize() for link in self.get_other_links() ] related_pages_dict['improve-dashboard-message'] = ( self.improve_dashboard_message ) return related_pages_dict def spotlightify(self, request_slug=None): base_dict = self.spotlightify_base_dict() base_dict['modules'] = self.spotlightify_modules() base_dict['relatedPages'] = self.related_pages_dict() if self.department(): base_dict['department'] = self.spotlightify_department() if self.agency(): base_dict['agency'] = self.spotlightify_agency() modules_or_tabs = get_modules_or_tabs(request_slug, base_dict) return modules_or_tabs def serialize(self): def simple_field(field): return not (field.is_relation or field.one_to_one or ( field.many_to_one and field.related_model)) serialized = {} fields = self._meta.get_fields() field_names = [field.name for field in fields if simple_field(field)] for field in field_names: if not (field.startswith('_') or field.endswith('_cache')): value = getattr(self, field) serialized[field] = value if self.status == 'published': serialized['published'] = True else: serialized['published'] = False if self.organisation: serialized['organisation'] = Node.serialize(self.organisation) else: serialized['organisation'] = None serialized['links'] = [link.serialize() for link in self.link_set.all()] serialized['modules'] = self.serialized_modules() return serialized def __str__(self): return self.slug def serialized_modules(self): return [m.serialize() for m in self.module_set.filter(parent=None).order_by('order')] def spotlightify_modules(self): return [m.spotlightify() for m in self.module_set.filter(parent=None).order_by('order')] def spotlightify_agency(self): return self.agency().spotlightify() def spotlightify_department(self): return self.department().spotlightify() def update_transaction_link(self, title, url): transaction_link = self.get_transaction_link() if not transaction_link: self.link_set.create( title=title, url=url, link_type='transaction' ) else: link = transaction_link link.title = title link.url = url link.save() def add_other_link(self, title, url): self.link_set.create( title=title, url=url, link_type='other' ) def get_transaction_link(self): transaction_link = self.link_set.filter(link_type='transaction') if len(transaction_link) == 1: return transaction_link[0] else: return None def get_other_links(self): return self.link_set.filter(link_type='other').all() def validate_and_save(self): self.full_clean() self.save() class Meta: app_label = 'dashboards' def organisations(self): department = None agency = None if self.organisation is not None: for node in self.organisation.get_ancestors(include_self=False): if node.typeOf.name == 'department': department = node if node.typeOf.name == 'agency': agency = node return department, agency def agency(self): if self.organisation is not None: if self.organisation.typeOf.name == 'agency': return self.organisation for node in self.organisation.get_ancestors(): if node.typeOf.name == 'agency': return node return None def department(self): if self.agency() is not None: dept = None for node in self.agency().get_ancestors(include_self=False): if node.typeOf.name == 'department': dept = node return dept else: if self.organisation is not None: for node in self.organisation.get_ancestors(): if node.typeOf.name == 'department': return node return None class Link(models.Model): id = models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True) title = models.CharField(max_length=100) url = models.URLField(max_length=200) dashboard = models.ForeignKey(Dashboard) link_types = [ 'transaction', 'other', ] link_type = models.CharField( max_length=20, choices=list_to_tuple_pairs(link_types), ) def link_url(self): return '<a href="{0}">{0}</a>'.format(self.url) link_url.allow_tags = True def serialize(self): return { 'title': self.title, 'type': self.link_type, 'url': self.url } class Meta: app_label = 'dashboards' def get_modules_or_tabs(request_slug, dashboard_json): # first part will always be empty as we never end the dashboard slug with # a slash if request_slug is None: return dashboard_json module_slugs = request_slug.replace( dashboard_json['slug'], '').split('/')[1:] if len(module_slugs) == 0: return dashboard_json if 'modules' not in dashboard_json: return None modules = dashboard_json['modules'] for slug in module_slugs: module = find_first_item_matching_slug(modules, slug) if module is None: return None elif module['modules']: modules = module['modules'] dashboard_json['modules'] = [module] elif 'tabs' in module: last_slug = module_slugs[-1] if last_slug == slug: dashboard_json['modules'] = [module] else: tab_slug = last_slug.replace(slug + '-', '') tab = get_single_tab_from_module(tab_slug, module) if tab is None: return None else: tab['info'] = module['info'] tab['title'] = module['title'] + ' - ' + tab['title'] dashboard_json['modules'] = [tab] break else: dashboard_json['modules'] = [module] dashboard_json['page-type'] = 'module' return dashboard_json def get_single_tab_from_module(tab_slug, module_json): return find_first_item_matching_slug(module_json['tabs'], tab_slug) def find_first_item_matching_slug(item_list, slug): for item in item_list: if item['slug'] == slug: return item
mit
-177,456,948,202,694,270
30.875546
81
0.575108
false
ottermegazord/ottermegazord.github.io
onexi/data_processing/s05_genPlots.py
1
1460
import pandas as pd import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import os import pdb import sys plt.style.use("ggplot") os.chdir("..") ipath = "./Data/Final_Data/" ifile = "Final_Data" opath = "./Data/Final_Data/Neighborhoods/" imgpath = "./Plots/Neighborhood_TS/" ext = ".csv" input_var = raw_input("Run mode (analysis/plot): ") if input_var == "analysis": df = pd.read_csv(ipath + ifile + ext, low_memory=False) df2 = df.groupby(["TIME", "NEIGHBORHOOD"]).mean().unstack() time = df["TIME"].unique().tolist() nhood = df["NEIGHBORHOOD"].unique().tolist() nhood = [x for x in nhood if str(x) != 'nan'] for n in nhood: mean = [] for t in time: mean.append(df2.loc[t, ("AV_PER_SQFT", n)]) out_df = pd.DataFrame({'TIME': time, 'MEAN_AV_PER_SQFT': mean}) out_df.to_csv(opath + n + ext, index=False) elif input_var == "plot": def makePlot(x, y, xlabel, ylabel, title, filename): x_pos = [i for i, _ in enumerate(x)] plt.bar(x_pos, y, color='green') plt.ylabel(ylabel) plt.xlabel(xlabel) plt.title(title) plt.xticks(x_pos, x, fontsize=8) plt.savefig(filename, bbox_inches="tight", dpi=300) plt.close() nhood_files = os.listdir(opath) for f in nhood_files: nhood = f[:-4] df = pd.read_csv(opath + f, low_memory=False) makePlot(x=df["TIME"].tolist(), y=df["MEAN_AV_PER_SQFT"].tolist(), ylabel="AVG LAND VALUE ($/sqft)", xlabel="TIME (year)", title=nhood, filename=imgpath + nhood +".png")
mit
1,006,559,307,171,647,600
27.076923
171
0.650685
false
manahl/pytest-plugins
pytest-shutil/pytest_shutil/run.py
1
8562
""" Testing tools for running cmdline methods """ import sys import os import imp import logging from functools import update_wrapper import inspect import textwrap from contextlib import closing import subprocess from mock import patch import execnet from six.moves import cPickle # @UnresolvedImport from . import cmdline try: # Python 3 from contextlib import ExitStack except ImportError: from contextlib2 import ExitStack try: # Python 2 str_type = basestring except NameError: # Python 3 str_type = str log = logging.getLogger(__name__) # TODO: add option to return results as a pipe to avoid buffering # large amounts of output def run(cmd, stdin=None, capture_stdout=True, capture_stderr=False, check_rc=True, background=False, **kwargs): """ Run a command; raises `subprocess.CalledProcessError` on failure. Parameters ---------- stdin : file object text piped to standard input capture_stdout : `bool` or `stream` If set, stdout will be captured and returned capture_stderr : `bool` If set, stderr will be piped to stdout and returned **kwargs : optional arguments Other arguments are passed to Popen() """ log.debug('exec: %s' % str(cmd)) stdout = subprocess.PIPE if capture_stdout is True else capture_stdout if capture_stdout else None stderr = subprocess.STDOUT if capture_stderr else None stdin_arg = None if stdin is None else subprocess.PIPE p = subprocess.Popen(cmd, stdin=stdin_arg, stdout=stdout, stderr=stderr, **kwargs) if background: return p (out, _) = p.communicate(stdin) if out is not None and not isinstance(out, str_type): try: out = out.decode('utf-8') except: log.warning("Unable to decode command output to UTF-8") if check_rc and p.returncode != 0: err_msg = ((out if out else 'No output') if capture_stdout is True else '<not captured>') cmd = cmd if isinstance(cmd, str) else ' '.join(cmd) log.error("Command failed: \"%s\"\n%s" % (cmd, err_msg.strip())) ex = subprocess.CalledProcessError(p.returncode, cmd) ex.output = err_msg raise ex return out def run_as_main(fn, *argv): """ Run a given function as if it was the system entry point, eg for testing scripts. Eg:: from scripts.Foo import main run_as_main(main, 'foo','bar') This is equivalent to ``Foo foo bar``, assuming ``scripts.Foo.main`` is registered as an entry point. """ with patch("sys.argv", new=['progname'] + list(argv)): log.info("run_as_main: %s" % str(argv)) return fn() def run_module_as_main(module, argv=[]): """ Run a given module as if it was the system entry point. """ where = os.path.dirname(module.__file__) filename = os.path.basename(module.__file__) filename = os.path.splitext(filename)[0] + ".py" with patch("sys.argv", new=argv): imp.load_source('__main__', os.path.join(where, filename)) def _evaluate_fn_source(src, *args, **kwargs): locals_ = {} eval(compile(src, '<string>', 'single'), {}, locals_) fn = next(iter(locals_.values())) if isinstance(fn, staticmethod): fn = fn.__get__(None, object) return fn(*args, **kwargs) def _invoke_method(obj, name, *args, **kwargs): return getattr(obj, name)(*args, **kwargs) def _find_class_from_staticmethod(fn): for _, cls in inspect.getmembers(sys.modules[fn.__module__], inspect.isclass): for name, member in inspect.getmembers(cls): if member is fn or (isinstance(member, staticmethod) and member.__get__(None, object) is fn): return cls, name return None, None def _make_pickleable(fn): # return a pickleable function followed by a tuple of initial arguments # could use partial but this is more efficient try: cPickle.dumps(fn, protocol=0) except (TypeError, cPickle.PickleError, AttributeError): pass else: return fn, () if inspect.ismethod(fn): name, self_ = fn.__name__, fn.__self__ if self_ is None: # Python 2 unbound method self_ = fn.im_class return _invoke_method, (self_, name) elif inspect.isfunction(fn) and fn.__module__ in sys.modules: cls, name = _find_class_from_staticmethod(fn) if (cls, name) != (None, None): try: cPickle.dumps((cls, name), protocol=0) except cPickle.PicklingError: pass else: return _invoke_method, (cls, name) # Fall back to sending the source code return _evaluate_fn_source, (textwrap.dedent(inspect.getsource(fn)),) def _run_in_subprocess_redirect_stdout(fd): import os # @Reimport import sys # @Reimport sys.stdout.close() os.dup2(fd, 1) os.close(fd) sys.stdout = os.fdopen(1, 'w', 1) def _run_in_subprocess_remote_fn(channel): from six.moves import cPickle # @UnresolvedImport @Reimport # NOQA fn, args, kwargs = cPickle.loads(channel.receive(None)) channel.send(cPickle.dumps(fn(*args, **kwargs), protocol=0)) def run_in_subprocess(fn, python=sys.executable, cd=None, timeout=None): """ Wrap a function to run in a subprocess. The function must be pickleable or otherwise must be totally self-contained; it must not reference a closure or any globals. It can also be the source of a function (def fn(...): ...). Raises execnet.RemoteError on exception. """ pkl_fn, preargs = (_evaluate_fn_source, (fn,)) if isinstance(fn, str) else _make_pickleable(fn) spec = '//'.join(filter(None, ['popen', 'python=' + python, 'chdir=' + cd if cd else None])) def inner(*args, **kwargs): # execnet sends stdout to /dev/null :( fix_stdout = sys.version_info < (3, 0, 0) # Python 3 passes close_fds=True to subprocess.Popen with ExitStack() as stack: with ExitStack() as stack2: if fix_stdout: fd = os.dup(1) stack2.callback(os.close, fd) gw = execnet.makegateway(spec) # @UndefinedVariable stack.callback(gw.exit) if fix_stdout: with closing(gw.remote_exec(_run_in_subprocess_remote_fn)) as chan: chan.send(cPickle.dumps((_run_in_subprocess_redirect_stdout, (fd,), {}), protocol=0)) chan.receive(None) with closing(gw.remote_exec(_run_in_subprocess_remote_fn)) as chan: payload = (pkl_fn, tuple(i for t in (preargs, args) for i in t), kwargs) chan.send(cPickle.dumps(payload, protocol=0)) return cPickle.loads(chan.receive(timeout)) return inner if isinstance(fn, str) else update_wrapper(inner, fn) def run_with_coverage(cmd, pytestconfig, coverage=None, cd=None, **kwargs): """ Run a given command with coverage enabled. This won't make any sense if the command isn't a python script. This must be run within a pytest session that has been setup with the '--cov=xxx' options, and therefore requires the pytestconfig argument that can be retrieved from the standard pytest funcarg of the same name. Parameters ---------- cmd: `List` Command to run pytestconfig: `pytest._config.Config` Pytest configuration object coverage: `str` Path to the coverage executable cd: `str` If not None, will change to this directory before running the cmd. This is the directory that the coverage files will be created in. kwargs: keyword arguments Any extra arguments to pass to `pkglib.cmdline.run` Returns ------- `str` standard output Examples -------- >>> def test_example(pytestconfig): ... cmd = ['python','myscript.py'] ... run_with_coverage(cmd, pytestconfig) """ if isinstance(cmd, str): cmd = [cmd] if coverage is None: coverage = [sys.executable, '-mcoverage.__main__'] elif isinstance(coverage, str): coverage = [coverage] args = coverage + ['run', '-p'] if getattr(pytestconfig.option, 'cov_source', None): source_dirs = ",".join(pytestconfig.option.cov_source) args += ['--source=%s' % source_dirs] args += cmd if cd: with cmdline.chdir(cd): return run(args, **kwargs) return run(args, **kwargs)
mit
-3,054,477,449,442,501,600
32.057915
105
0.620649
false
joliveros/bitmex-websocket
tests/test_instrument.py
1
2865
import alog import pytest from mock import PropertyMock, MagicMock, mock from bitmex_websocket import Instrument from bitmex_websocket._instrument import SubscribeToAtLeastOneChannelException, \ SubscribeToSecureChannelException from bitmex_websocket.constants import Channels, SecureChannels, \ SecureInstrumentChannels from tests.helpers import message_fixtures fixtures = message_fixtures() orderBookL2_data = fixtures['orderBookL2'] instrument_data = fixtures['instrument'] class TestInstrument(object): def test_raises_exception_no_channel_subscribed(self): with pytest.raises(SubscribeToAtLeastOneChannelException): Instrument() def test_only_public_channels(self): instrument = Instrument(channels=[Channels.connected]) assert [Channels.connected] == instrument.channels def test_public_and_secure_channels_are_in_channels_list(self, mocker): header_mock = mocker.patch( 'bitmex_websocket._bitmex_websocket.BitMEXWebsocket.header') header_mock.return_value = [] channels = [ Channels.connected, SecureChannels.margin] instrument = Instrument(should_auth=True, channels=channels) assert channels == instrument.channels def test_raises_exception_if_secure_channels_are_specified_without_auth( self): with pytest.raises(SubscribeToSecureChannelException): channels = [ Channels.connected, SecureChannels.margin] instrument = Instrument(channels=channels) assert channels == instrument.channels def test_does_not_raise_exception_when_subscribing_secure_channel( self, mocker): header_mock = mocker.patch( 'bitmex_websocket._bitmex_websocket.BitMEXWebsocket.header') header_mock.return_value = [] channels = [ Channels.connected, SecureChannels.margin] instrument = Instrument(channels=channels, should_auth=True) instrument.emit('open') assert channels == instrument.channels def test_subscribe_to_public_channels(self, mocker): header_mock = mocker.patch( 'bitmex_websocket._bitmex_websocket.BitMEXWebsocket.header') header_mock.return_value = [] subscribe_mock: MagicMock = mocker.patch( 'bitmex_websocket._bitmex_websocket.BitMEXWebsocket.subscribe') channels = [ Channels.connected, SecureChannels.margin, SecureInstrumentChannels.order ] instrument = Instrument(channels=channels, should_auth=True) instrument.subscribe_channels() assert channels == instrument.channels subscribe_mock.assert_has_calls([mock.call('margin:XBTUSD'), mock.call('order:XBTUSD')])
mit
-1,103,083,234,951,720,000
32.313953
81
0.675044
false
fennekki/unikko
unikko/output/html.py
1
3802
from yattag import Doc, indent from sys import stderr def _inner_recurse_tags(obj, tree, doc, tag, text): """Execute inner loop structure of HTML generation. Params: obj (Object): The object currently being looped over tree (Object): A VOTL Object containing the subtree-to-be -generated doc: yattag Doc().doc tag: yattag Doc().tag text: yattag Doc().text """ if obj.object_type == "header": # Only generate a header element for headers with tag("h{:d}".format(obj.level + 1)): text(obj.first_line) elif obj.object_type == "body": paragraphs = [] current = [] for line in obj.lines: if line == "": if len(current) > 0: paragraphs.append("\n".join(current)) current = [] else: current.append(line) # Last paragraph if len(current) > 0: paragraphs.append("\n".join(current)) for paragraph in paragraphs: with tag("p"): text(paragraph) elif obj.object_type == "body-pre": # Just print the content in a pre-tag with tag("pre"): for line in obj.lines: text(line, "\n") elif obj.object_type[-4:] == "-pre": # Class is name without -pre klass = obj.object_type[:-4] # Custom preformatted with tag("pre", klass=klass): for line in obj.lines: text(line, "\n") else: # Body, but custom klass = obj.object_type paragraphs = [] current = [] for line in obj.lines: # Construct paragraphs into paragraphs from lines in obj if line == "": if len(current) > 0: paragraphs.append("\n".join(current)) current = [] else: current.append(line) if len(current) > 0: paragraphs.append("\n".join(current)) for paragraph in paragraphs: # Each generated paragraph becomes a <p> tag with tag("p", klass=klass): text(paragraph) _recurse_tags(obj, doc, tag, text) def _recurse_tags(tree, doc, tag, text): """Recursively generate HTML from children. Params: tree (Object): A VOTL Object containing the subtree-to-be -generated doc: yattag Doc().doc tag: yattag Doc().tag text: yattag Doc().text """ if len(tree.children) > 0: for o in tree.children: if len(o.children) > 0: # Only create divs for objects with children with tag("div"): _inner_recurse_tags(o, tree, doc, tag, text) else: _inner_recurse_tags(o, tree, doc, tag, text) def html_from_tree(tree): """Generate indented HTML from VOTL Object tree. Params: tree (Object): A VOTL Object containing the tree, from which HTML will be generated. Returns: String containing a pretty-formatted HTML document. """ doc, tag, text = Doc().tagtext() doc.asis("<!DOCTYPE html>") try: first = tree.children[0] except IndexError: print("Error generating markdown: Tree has no children!", file=stderr) return "" if first.object_type == "header": title = first.first_line else: title = "Untitled" with tag("html"): with tag("head"): with tag("title"): text(title) doc.stag("meta", charset="utf-8") with tag("body"): _recurse_tags(tree, doc, tag, text) return indent(doc.getvalue())
bsd-2-clause
-3,682,860,216,058,355,000
29.416
78
0.522357
false
ricardog/raster-project
projections/r2py/rparser.py
1
5180
from pyparsing import * import re ParserElement.enablePackrat() from .tree import Node, Operator import pdb def rparser(): expr = Forward() lparen = Literal("(").suppress() rparen = Literal(")").suppress() double = Word(nums + ".").setParseAction(lambda t:float(t[0])) integer = pyparsing_common.signed_integer number = pyparsing_common.number ident = Word(initChars = alphas + "_", bodyChars = alphanums + "_" + ".") string = dblQuotedString funccall = Group(ident + lparen + Group(Optional(delimitedList(expr))) + rparen + Optional(integer)).setResultsName("funccall") operand = number | string | funccall | ident expop = Literal('^') multop = oneOf('* /') plusop = oneOf('+ -') introp = oneOf('| :') expr << infixNotation(operand, [(expop, 2, opAssoc.RIGHT), (introp, 2, opAssoc.LEFT), (multop, 2, opAssoc.LEFT), (plusop, 2, opAssoc.LEFT),]).setResultsName('expr') return expr PARSER = rparser() def parse(text): def walk(l): ## ['log', [['cropland', '+', 1]]] ## ['poly', [['log', [['cropland', '+', 1]]], 3], 3] ## [[['factor', ['unSub'], 21], ':', ['poly', [['log', [['cropland', '+', 1]]], 3], 3], ':', ['poly', [['log', [['hpd', '+', 1]]], 3], 2]]] if type(l) in (int, float): return l if isinstance(l, str): if l == 'Intercept' or l == '"Intercept"': return 1 elif l[0] == '"' and l[-1] == '"': return l[1:-1] else: return l if len(l) == 1 and type(l[0]) in (int, str, float, ParseResults): return walk(l[0]) if l[0] == 'factor': assert len(l) == 3, "unexpected number of arguments to factor" assert len(l[1]) == 1, "argument to factor is an expression" assert type(l[2]) == int, "second argument to factor is not an int" return Node(Operator('=='), (Node(Operator('in'), (l[1][0], 'float32[:]')), l[2])) if l[0] == 'poly': assert len(l) in (2, 3), "unexpected number of arguments to poly" assert isinstance(l[1][1], int), "degree argument to poly is not an int" inner = walk(l[1][0]) degree = l[1][1] if len(l) == 2: pwr = 1 else: assert type(l[2]) == int, "power argument to poly is not an int" pwr = l[2] return Node(Operator('sel'), (Node(Operator('poly'), (inner, degree)), pwr)) if l[0] == 'log': assert len(l) == 2, "unexpected number of arguments to log" args = walk(l[1]) return Node(Operator('log'), [args]) if l[0] == 'scale': assert len(l[1]) in (3, 5), "unexpected number of arguments to scale" args = walk(l[1][0]) return Node(Operator('scale'), [args] + l[1][1:]) if l[0] == 'I': assert len(l) == 2, "unexpected number of arguments to I" args = walk(l[1]) return Node(Operator('I'), [args]) # Only used for testing if l[0] in ('sin', 'tan'): assert len(l) == 2, "unexpected number of arguments to %s" % l[0] args = walk(l[1]) return Node(Operator(l[0]), [args]) if l[0] in ('max', 'min', 'pow'): assert len(l) == 2, "unexpected number of arguments to %s" % l[0] assert len(l[1]) == 2, "unexpected number of arguments to %s" % l[0] left = walk(l[1][0]) right = walk(l[1][1]) return Node(Operator(l[0]), (left, right)) if l[0] == 'exp': assert len(l) == 2, "unexpected number of arguments to exp" args = walk(l[1]) return Node(Operator('exp'), [args]) if l[0] == 'clip': assert len(l) == 2, "unexpected number of arguments to %s" % l[0] assert len(l[1]) == 3, "unexpected number of arguments to %s" % l[0] left = walk(l[1][0]) low = walk(l[1][1]) high = walk(l[1][2]) return Node(Operator(l[0]), (left, low, high)) if l[0] == 'inv_logit': assert len(l) == 2, "unexpected number of arguments to inv_logit" args = walk(l[1]) return Node(Operator('inv_logit'), [args]) ## Only binary operators left if len(l) == 1: pdb.set_trace() pass assert len(l) % 2 == 1, "unexpected number of arguments for binary operator" assert len(l) != 1, "unexpected number of arguments for binary operator" ## FIXME: this only works for associative operators. Need to either ## special-case division or include an attribute that specifies ## whether the op is associative. left = walk(l.pop(0)) op = l.pop(0) right = walk(l) if type(right) != Node: return Node(Operator(op), (left, right)) elif right.type.type == op: return Node(Operator(op), (left, ) + right.args) return Node(Operator(op), (left, right)) ### FIXME: hack if not isinstance(text, str): text = str(text) new_text = re.sub('newrange = c\((\d), (\d+)\)', '\\1, \\2', text) new_text = new_text.replace('rescale(', 'scale(') nodes = PARSER.parseString(new_text, parseAll=True) tree = walk(nodes) if isinstance(tree, (str, int, float)): tree = Node(Operator('I'), [tree]) return tree
apache-2.0
8,386,587,708,140,975,000
36.266187
143
0.547104
false
scdoshi/djutils
djutils/gis.py
1
2346
""" GIS: GIS related utilities. """ ############################################################################### ## Imports ############################################################################### import math ############################################################################### ## GIS Format Conversions ############################################################################### def GPRMC2DegDec(lat, latDirn, lng, lngDirn): """Converts GPRMC formats (Decimal Minutes) to Degrees Decimal Eg. """ x = float(lat[0:2]) + float(lat[2:]) / 60 y = float(lng[0:3]) + float(lng[3:]) / 60 if latDirn == 'S': x = -x if lngDirn == 'W': y = -y return x, y def TinyGPS2DegDec(lat, lng): """Converts TinyGPS formats (Decimal Degrees to e-5) to Degrees Decimal Eg. """ x = float(lat[:-5] + '.' + lat[-5:]) y = float(lng[:-5] + '.' + lng[-5:]) return x, y ############################################################################### ## Functions to convert miles to change in lat, long (approx) ############################################################################### # Distances are measured in miles. # Longitudes and latitudes are measured in degrees. # Earth is assumed to be perfectly spherical. earth_radius = 3960.0 degrees_to_radians = math.pi / 180.0 radians_to_degrees = 180.0 / math.pi def ChangeInLatitude(miles): """Given a distance north, return the change in latitude.""" return (miles / earth_radius) * radians_to_degrees def ChangeInLongitude(lat, miles): """Given a latitude and a distance west, return the change in longitude.""" # Find the radius of a circle around the earth at given latitude. r = earth_radius * math.cos(lat * degrees_to_radians) return (miles / r) * radians_to_degrees def CalculateBoundingBox(lng, lat, miles): """ Given a latitude, longitude and a distance in miles, calculate the co-ordinates of the bounding box 2*miles on long each side with the given co-ordinates at the center. """ latChange = ChangeInLatitude(miles) latSouth = lat - latChange latNorth = lat + latChange lngChange = ChangeInLongitude(lat, miles) lngWest = lng + lngChange lngEast = lng - lngChange return (lngWest, latSouth, lngEast, latNorth)
bsd-3-clause
8,272,118,917,767,031,000
27.962963
79
0.516624
false
Z2PackDev/TBmodels
tests/test_hdf5.py
1
3921
#!/usr/bin/env python # (c) 2015-2018, ETH Zurich, Institut fuer Theoretische Physik # Author: Dominik Gresch <[email protected]> """Tests saving and loading to HDF5 format.""" import tempfile import pytest import numpy as np import tbmodels KWARGS = [ dict(), dict(pos=None, dim=3), dict(uc=3 * np.eye(3)), dict(pos=np.zeros((2, 3)), uc=np.eye(3)), ] @pytest.mark.parametrize("kwargs", KWARGS) def test_hdf5_consistency_file(get_model, models_equal, kwargs): """ Test that a tight-binding model remains the same after saving to HDF5 format and loading, using the Model methods. """ model1 = get_model(0.1, 0.2, **kwargs) with tempfile.NamedTemporaryFile() as tmpf: model1.to_hdf5_file(tmpf.name) model2 = tbmodels.Model.from_hdf5_file(tmpf.name) models_equal(model1, model2) @pytest.mark.parametrize("kwargs", KWARGS) def test_hdf5_consistency_freefunc(get_model, models_equal, kwargs): """ Test that a tight-binding model remains the same after saving to HDF5 and loading, using the free `io` functions. """ model1 = get_model(0.1, 0.2, **kwargs) with tempfile.NamedTemporaryFile() as tmpf: tbmodels.io.save(model1, tmpf.name) model2 = tbmodels.io.load(tmpf.name) models_equal(model1, model2) @pytest.fixture(params=["InAs_nosym.hdf5"]) def hdf5_sample(sample, request): """Fixture which provides the filename of a HDF5 tight-binding model.""" return sample(request.param) @pytest.fixture(params=["InAs_nosym_legacy.hdf5"]) def hdf5_sample_legacy(sample, request): """ Fixture which provides the filename of a HDF5 tight-binding model, in legacy format. """ return sample(request.param) def test_hdf5_load_freefunc(hdf5_sample): # pylint: disable=redefined-outer-name """Test that a HDF5 file can be loaded with the `io.load` function.""" res = tbmodels.io.load(hdf5_sample) assert isinstance(res, tbmodels.Model) def test_hdf5_load_method(hdf5_sample): # pylint: disable=redefined-outer-name """Test that a HDF5 file can be loaded with the Model method.""" res = tbmodels.Model.from_hdf5_file(hdf5_sample) assert isinstance(res, tbmodels.Model) def test_hdf5_load_freefunc_legacy( hdf5_sample_legacy, ): # pylint: disable=redefined-outer-name """Test that a HDF5 file in legacy format can be loaded with the `io.load` function.""" with pytest.deprecated_call(): res = tbmodels.io.load(hdf5_sample_legacy) assert isinstance(res, tbmodels.Model) def test_hdf5_load_method_legacy( hdf5_sample_legacy, ): # pylint: disable=redefined-outer-name """Test that a HDF5 file in legacy format can be loaded with the Model method.""" with pytest.deprecated_call(): res = tbmodels.Model.from_hdf5_file(hdf5_sample_legacy) assert isinstance(res, tbmodels.Model) def test_hdf5_kdotp(kdotp_models_equal): """Test that k.p models can be saved / loaded to HDF5.""" kp_model = tbmodels.kdotp.KdotpModel( {(1, 0): [[0.1, 0.2j], [-0.2j, 0.3]], (0, 0): np.eye(2)} ) with tempfile.NamedTemporaryFile() as tmpf: tbmodels.io.save(kp_model, tmpf.name) model2 = tbmodels.io.load(tmpf.name) kdotp_models_equal(kp_model, model2) def test_generic_legacy_object(sample): """Test that a generic object in legacy format can be loaded.""" filename = sample("legacy_general_object.hdf5") with pytest.deprecated_call(): res = tbmodels.io.load(filename) assert res == [2, [3, 4], 2.3] def test_invalid_hdf5_file(sample): """ Check that trying to load a file with invalid structure raises the expected error. """ filename = sample("invalid_file_structure.hdf5") with pytest.deprecated_call(), pytest.raises(ValueError) as excinfo: tbmodels.io.load(filename) assert "File structure not understood" in str(excinfo.value)
apache-2.0
-840,358,357,897,939,300
31.404959
91
0.682734
false
ArcherSys/ArcherSys
Scripts/pildriver.py
1
15521
#!c:\xampp\htdocs\scripts\python.exe """PILdriver, an image-processing calculator using PIL. An instance of class PILDriver is essentially a software stack machine (Polish-notation interpreter) for sequencing PIL image transformations. The state of the instance is the interpreter stack. The only method one will normally invoke after initialization is the `execute' method. This takes an argument list of tokens, pushes them onto the instance's stack, and then tries to clear the stack by successive evaluation of PILdriver operators. Any part of the stack not cleaned off persists and is part of the evaluation context for the next call of the execute method. PILDriver doesn't catch any exceptions, on the theory that these are actually diagnostic information that should be interpreted by the calling code. When called as a script, the command-line arguments are passed to a PILDriver instance. If there are no command-line arguments, the module runs an interactive interpreter, each line of which is split into space-separated tokens and passed to the execute method. In the method descriptions below, a first line beginning with the string `usage:' means this method can be invoked with the token that follows it. Following <>-enclosed arguments describe how the method interprets the entries on the stack. Each argument specification begins with a type specification: either `int', `float', `string', or `image'. All operations consume their arguments off the stack (use `dup' to keep copies around). Use `verbose 1' to see the stack state displayed before each operation. Usage examples: `show crop 0 0 200 300 open test.png' loads test.png, crops out a portion of its upper-left-hand corner and displays the cropped portion. `save rotated.png rotate 30 open test.tiff' loads test.tiff, rotates it 30 degrees, and saves the result as rotated.png (in PNG format). """ # by Eric S. Raymond <[email protected]> # $Id$ # TO DO: # 1. Add PILFont capabilities, once that's documented. # 2. Add PILDraw operations. # 3. Add support for composing and decomposing multiple-image files. # from __future__ import print_function from PIL import Image class PILDriver(object): verbose = 0 def do_verbose(self): """usage: verbose <int:num> Set verbosity flag from top of stack. """ self.verbose = int(self.do_pop()) # The evaluation stack (internal only) stack = [] # Stack of pending operations def push(self, item): "Push an argument onto the evaluation stack." self.stack = [item] + self.stack def top(self): "Return the top-of-stack element." return self.stack[0] # Stack manipulation (callable) def do_clear(self): """usage: clear Clear the stack. """ self.stack = [] def do_pop(self): """usage: pop Discard the top element on the stack. """ top = self.stack[0] self.stack = self.stack[1:] return top def do_dup(self): """usage: dup Duplicate the top-of-stack item. """ if hasattr(self, 'format'): # If it's an image, do a real copy dup = self.stack[0].copy() else: dup = self.stack[0] self.stack = [dup] + self.stack def do_swap(self): """usage: swap Swap the top-of-stack item with the next one down. """ self.stack = [self.stack[1], self.stack[0]] + self.stack[2:] # Image module functions (callable) def do_new(self): """usage: new <int:xsize> <int:ysize> <int:color>: Create and push a greyscale image of given size and color. """ xsize = int(self.do_pop()) ysize = int(self.do_pop()) color = int(self.do_pop()) self.push(Image.new("L", (xsize, ysize), color)) def do_open(self): """usage: open <string:filename> Open the indicated image, read it, push the image on the stack. """ self.push(Image.open(self.do_pop())) def do_blend(self): """usage: blend <image:pic1> <image:pic2> <float:alpha> Replace two images and an alpha with the blended image. """ image1 = self.do_pop() image2 = self.do_pop() alpha = float(self.do_pop()) self.push(Image.blend(image1, image2, alpha)) def do_composite(self): """usage: composite <image:pic1> <image:pic2> <image:mask> Replace two images and a mask with their composite. """ image1 = self.do_pop() image2 = self.do_pop() mask = self.do_pop() self.push(Image.composite(image1, image2, mask)) def do_merge(self): """usage: merge <string:mode> <image:pic1> [<image:pic2> [<image:pic3> [<image:pic4>]]] Merge top-of stack images in a way described by the mode. """ mode = self.do_pop() bandlist = [] for band in mode: bandlist.append(self.do_pop()) self.push(Image.merge(mode, bandlist)) # Image class methods def do_convert(self): """usage: convert <string:mode> <image:pic1> Convert the top image to the given mode. """ mode = self.do_pop() image = self.do_pop() self.push(image.convert(mode)) def do_copy(self): """usage: copy <image:pic1> Make and push a true copy of the top image. """ self.dup() def do_crop(self): """usage: crop <int:left> <int:upper> <int:right> <int:lower> <image:pic1> Crop and push a rectangular region from the current image. """ left = int(self.do_pop()) upper = int(self.do_pop()) right = int(self.do_pop()) lower = int(self.do_pop()) image = self.do_pop() self.push(image.crop((left, upper, right, lower))) def do_draft(self): """usage: draft <string:mode> <int:xsize> <int:ysize> Configure the loader for a given mode and size. """ mode = self.do_pop() xsize = int(self.do_pop()) ysize = int(self.do_pop()) self.push(self.draft(mode, (xsize, ysize))) def do_filter(self): """usage: filter <string:filtername> <image:pic1> Process the top image with the given filter. """ from PIL import ImageFilter filter = eval("ImageFilter." + self.do_pop().upper()) image = self.do_pop() self.push(image.filter(filter)) def do_getbbox(self): """usage: getbbox Push left, upper, right, and lower pixel coordinates of the top image. """ bounding_box = self.do_pop().getbbox() self.push(bounding_box[3]) self.push(bounding_box[2]) self.push(bounding_box[1]) self.push(bounding_box[0]) def do_getextrema(self): """usage: extrema Push minimum and maximum pixel values of the top image. """ extrema = self.do_pop().extrema() self.push(extrema[1]) self.push(extrema[0]) def do_offset(self): """usage: offset <int:xoffset> <int:yoffset> <image:pic1> Offset the pixels in the top image. """ xoff = int(self.do_pop()) yoff = int(self.do_pop()) image = self.do_pop() self.push(image.offset(xoff, yoff)) def do_paste(self): """usage: paste <image:figure> <int:xoffset> <int:yoffset> <image:ground> Paste figure image into ground with upper left at given offsets. """ figure = self.do_pop() xoff = int(self.do_pop()) yoff = int(self.do_pop()) ground = self.do_pop() if figure.mode == "RGBA": ground.paste(figure, (xoff, yoff), figure) else: ground.paste(figure, (xoff, yoff)) self.push(ground) def do_resize(self): """usage: resize <int:xsize> <int:ysize> <image:pic1> Resize the top image. """ ysize = int(self.do_pop()) xsize = int(self.do_pop()) image = self.do_pop() self.push(image.resize((xsize, ysize))) def do_rotate(self): """usage: rotate <int:angle> <image:pic1> Rotate image through a given angle """ angle = int(self.do_pop()) image = self.do_pop() self.push(image.rotate(angle)) def do_save(self): """usage: save <string:filename> <image:pic1> Save image with default options. """ filename = self.do_pop() image = self.do_pop() image.save(filename) def do_save2(self): """usage: save2 <string:filename> <string:options> <image:pic1> Save image with specified options. """ filename = self.do_pop() options = self.do_pop() image = self.do_pop() image.save(filename, None, options) def do_show(self): """usage: show <image:pic1> Display and pop the top image. """ self.do_pop().show() def do_thumbnail(self): """usage: thumbnail <int:xsize> <int:ysize> <image:pic1> Modify the top image in the stack to contain a thumbnail of itself. """ ysize = int(self.do_pop()) xsize = int(self.do_pop()) self.top().thumbnail((xsize, ysize)) def do_transpose(self): """usage: transpose <string:operator> <image:pic1> Transpose the top image. """ transpose = self.do_pop().upper() image = self.do_pop() self.push(image.transpose(transpose)) # Image attributes def do_format(self): """usage: format <image:pic1> Push the format of the top image onto the stack. """ self.push(self.do_pop().format) def do_mode(self): """usage: mode <image:pic1> Push the mode of the top image onto the stack. """ self.push(self.do_pop().mode) def do_size(self): """usage: size <image:pic1> Push the image size on the stack as (y, x). """ size = self.do_pop().size self.push(size[0]) self.push(size[1]) # ImageChops operations def do_invert(self): """usage: invert <image:pic1> Invert the top image. """ from PIL import ImageChops self.push(ImageChops.invert(self.do_pop())) def do_lighter(self): """usage: lighter <image:pic1> <image:pic2> Pop the two top images, push an image of the lighter pixels of both. """ from PIL import ImageChops image1 = self.do_pop() image2 = self.do_pop() self.push(ImageChops.lighter(image1, image2)) def do_darker(self): """usage: darker <image:pic1> <image:pic2> Pop the two top images, push an image of the darker pixels of both. """ from PIL import ImageChops image1 = self.do_pop() image2 = self.do_pop() self.push(ImageChops.darker(image1, image2)) def do_difference(self): """usage: difference <image:pic1> <image:pic2> Pop the two top images, push the difference image """ from PIL import ImageChops image1 = self.do_pop() image2 = self.do_pop() self.push(ImageChops.difference(image1, image2)) def do_multiply(self): """usage: multiply <image:pic1> <image:pic2> Pop the two top images, push the multiplication image. """ from PIL import ImageChops image1 = self.do_pop() image2 = self.do_pop() self.push(ImageChops.multiply(image1, image2)) def do_screen(self): """usage: screen <image:pic1> <image:pic2> Pop the two top images, superimpose their inverted versions. """ from PIL import ImageChops image2 = self.do_pop() image1 = self.do_pop() self.push(ImageChops.screen(image1, image2)) def do_add(self): """usage: add <image:pic1> <image:pic2> <int:offset> <float:scale> Pop the two top images, produce the scaled sum with offset. """ from PIL import ImageChops image1 = self.do_pop() image2 = self.do_pop() scale = float(self.do_pop()) offset = int(self.do_pop()) self.push(ImageChops.add(image1, image2, scale, offset)) def do_subtract(self): """usage: subtract <image:pic1> <image:pic2> <int:offset> <float:scale> Pop the two top images, produce the scaled difference with offset. """ from PIL import ImageChops image1 = self.do_pop() image2 = self.do_pop() scale = float(self.do_pop()) offset = int(self.do_pop()) self.push(ImageChops.subtract(image1, image2, scale, offset)) # ImageEnhance classes def do_color(self): """usage: color <image:pic1> Enhance color in the top image. """ from PIL import ImageEnhance factor = float(self.do_pop()) image = self.do_pop() enhancer = ImageEnhance.Color(image) self.push(enhancer.enhance(factor)) def do_contrast(self): """usage: contrast <image:pic1> Enhance contrast in the top image. """ from PIL import ImageEnhance factor = float(self.do_pop()) image = self.do_pop() enhancer = ImageEnhance.Contrast(image) self.push(enhancer.enhance(factor)) def do_brightness(self): """usage: brightness <image:pic1> Enhance brightness in the top image. """ from PIL import ImageEnhance factor = float(self.do_pop()) image = self.do_pop() enhancer = ImageEnhance.Brightness(image) self.push(enhancer.enhance(factor)) def do_sharpness(self): """usage: sharpness <image:pic1> Enhance sharpness in the top image. """ from PIL import ImageEnhance factor = float(self.do_pop()) image = self.do_pop() enhancer = ImageEnhance.Sharpness(image) self.push(enhancer.enhance(factor)) # The interpreter loop def execute(self, list): "Interpret a list of PILDriver commands." list.reverse() while len(list) > 0: self.push(list[0]) list = list[1:] if self.verbose: print("Stack: " + repr(self.stack)) top = self.top() if not isinstance(top, str): continue funcname = "do_" + top if not hasattr(self, funcname): continue else: self.do_pop() func = getattr(self, funcname) func() if __name__ == '__main__': import sys # If we see command-line arguments, interpret them as a stack state # and execute. Otherwise go interactive. driver = PILDriver() if len(sys.argv[1:]) > 0: driver.execute(sys.argv[1:]) else: print("PILDriver says hello.") while True: try: if sys.version_info[0] >= 3: line = input('pildriver> ') else: line = raw_input('pildriver> ') except EOFError: print("\nPILDriver says goodbye.") break driver.execute(line.split()) print(driver.stack) # The following sets edit modes for GNU EMACS # Local Variables: # mode:python # End:
mit
-2,713,842,155,691,706,400
28.56381
95
0.58379
false
botswana-harvard/bais-subject
bais_subject/models/attitudes_towards_people.py
1
6192
from django.db import models from edc_base.model_fields import OtherCharField from edc_base.model_mixins import BaseUuidModel from ..choices import (YES_NO, TESTING_REASONS, TB_NONDISCLOSURE, HIV_TEST_RESULT, ARV_USAGE, ARV_TREATMENT_SOURCE, REASONS_ARV_NOT_TAKEN, TB_REACTION) class AttitudesTowardsPeople(BaseUuidModel): meal_sharing = models.CharField( verbose_name='Would you ever share a meal (from the same plate)' ' with a person you knew or suspected had HIV AND AIDS?', max_length=35, choices=YES_NO, ) aids_household_care = models.CharField( verbose_name='If a member of your family became sick with HIV AND AIDS,' ' would you be willing to care for him or her in your household?', max_length=35, choices=YES_NO, ) tb_household_care = models.CharField( verbose_name='If a member of your family became sick with TB,' ' would you be willing to care for him or her in your household?', max_length=35, choices=YES_NO, ) tb_household_empathy = models.CharField( verbose_name='If a member of your family got diagnosed with TB,' ' would you be willing to care for him or her in your household?', max_length=35, choices=YES_NO, ) aids_housekeeper = models.CharField( verbose_name='If your housekeeper, nanny or anybody looking' ' after your child has HIV but is not sick, ' 'would you allow him/her to continue' ' working/assisting with babysitting in your house? ', max_length=35, choices=YES_NO, ) aids_teacher = models.CharField( verbose_name='If a teacher has HIV but is not sick,' ' should s/he be allowed to continue teaching in school?', max_length=35, choices=YES_NO, ) aids_shopkeeper = models.CharField( verbose_name='If you knew that a shopkeeper or food seller had' ' HIV or AIDS, would you buy vegetables from them?', max_length=35, choices=YES_NO, ) aids_family_member = models.CharField( verbose_name='If a member of your family got infected' 'with HIV, would you want it to remain a secret?', max_length=35, choices=YES_NO, help_text="", ) aids_children = models.CharField( verbose_name='Do you think that children living with HIV ' 'should attend school with children who are HIV negative?', max_length=35, choices=YES_NO, ) aids_room_sharing = models.CharField( verbose_name='Would you share a room ' 'with a person you knew has been diagnosed with TB?', max_length=35, choices=YES_NO, ) aids_hiv_testing = models.CharField( verbose_name='Have you ever been tested for HIV?', max_length=35, choices=YES_NO, ) aids_hiv_times_tested = models.CharField( verbose_name='In the past 12 months how many times' ' have you been tested for HIV and received your results?', max_length=35, choices=YES_NO, ) aids_hiv_test_partner = models.CharField( verbose_name='Did you test together with your partner?', max_length=250, choices=YES_NO, ) aids_hiv_test_reason = models.CharField( verbose_name='What was the main reason for testing?', max_length=35, choices=TESTING_REASONS, ) aids_hiv_test_reason_other = OtherCharField( verbose_name='Specify Other', max_length=35, null=True, blank=True, ) aids_hiv_not_tested = models.CharField( verbose_name='Why haven’t you tested?', max_length=35, choices=TESTING_REASONS, ) aids_hiv_not_tested_other = OtherCharField( verbose_name='Other, Specify', max_length=35, null=True, blank=True, ) aids_hiv_test_result = models.CharField( verbose_name='What was the result of your last HIV test? ', max_length=35, choices=HIV_TEST_RESULT, ) aids_hiv_test_result_disclosure = models.CharField( verbose_name='Did you tell anyone the result of your the test? ', max_length=35, choices=YES_NO, ) current_arv_therapy = models.CharField( verbose_name='Are you currently taking ARVs?', max_length=35, choices=ARV_USAGE, ) current_arv_supplier = models.CharField( verbose_name='Where are you taking your ARVs?', max_length=35, choices=ARV_TREATMENT_SOURCE, ) current_arv_supplier_other = OtherCharField( verbose_name='Other Specify', max_length=35, null=True, blank=True, ) not_on_arv_therapy = models.CharField( verbose_name='Why aren\'t you taking your ARVs?', max_length=35, choices=REASONS_ARV_NOT_TAKEN, ) not_on_arv_therapy_other = OtherCharField( verbose_name='Other Specify', max_length=35, blank=True, null=True ) tb_reaction = models.CharField( verbose_name='What would be your reaction' ' if you found out you had TB ?', max_length=35, choices=TB_REACTION, ) tb_reaction_other = OtherCharField( verbose_name='Other Specify', max_length=35, null=True, blank=True, ) tb_diagnosis = models.CharField( verbose_name='If you were diagnosed with Tb,would you tell anyone?', max_length=35, choices=YES_NO, ) tb_diagnosis_disclosure = models.CharField( verbose_name='If yes, whom would you tell?', max_length=35, choices=YES_NO, ) tb_diagnosis_no_disclosure = models.CharField( verbose_name='If No,why not', max_length=35, choices=TB_NONDISCLOSURE, ) tb_diagnosis_no_disclosure_other = OtherCharField( verbose_name='Other, Specify', max_length=35, blank=True, null=True ) class Meta(BaseUuidModel.Meta): app_label = 'bais_subject'
gpl-3.0
-4,917,492,235,012,561,000
27.525346
80
0.607593
false
openEduConnect/eduextractor
docs/conf.py
1
9538
# -*- coding: utf-8 -*- # # eduextractor documentation build configuration file, created by # sphinx-quickstart on Mon Aug 10 17:16:14 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys import os import shlex # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.mathjax', 'sphinx.ext.ifconfig', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'eduextractor' copyright = u'2015, Hunter Owens' author = u'Hunter Owens' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.0.1' # The full version, including alpha/beta/rc tags. release = '0.0.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' #html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # Now only 'ja' uses this config value #html_search_options = {'type': 'default'} # The name of a javascript file (relative to the configuration directory) that # implements a search results scorer. If empty, the default will be used. #html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. htmlhelp_basename = 'eduextractordoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', # Latex figure (float) alignment #'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'eduextractor.tex', u'eduextractor Documentation', u'Hunter Owens', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'eduextractor', u'eduextractor Documentation', [author], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'eduextractor', u'eduextractor Documentation', author, 'eduextractor', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'https://docs.python.org/': None}
mit
-1,010,721,669,949,313,500
31.222973
79
0.707696
false
fako/datascope
src/sources/models/google/text.py
1
2087
from datagrowth.exceptions import DGInvalidResource from sources.models.google.query import GoogleQuery class GoogleText(GoogleQuery): URI_TEMPLATE = 'https://www.googleapis.com/customsearch/v1?q={}' GET_SCHEMA = { "args": { "type": "array", "items": [ { "type": "string", # the query string }, { "type": "integer", # amount of desired images }, ], "additionalItems": False, "minItems": 1 }, "kwargs": None } def variables(self, *args): args = args or self.request.get("args") return { "url": (args[0],), "quantity": args[2] if len(args) > 2 else 0, } def auth_parameters(self): params = super(GoogleText, self).auth_parameters() params.update({ "cx": self.config.cx }) return params @property def content(self): content_type, data = super(GoogleText, self).content try: if data is not None: data["queries"]["request"][0]["searchTerms"] = data["queries"]["request"][0]["searchTerms"][1:-1] except (KeyError, IndexError): raise DGInvalidResource("Google Image resource does not specify searchTerms", self) return content_type, data def next_parameters(self): if self.request["quantity"] <= 0: return {} content_type, data = super(GoogleText, self).content missing_quantity = self.request["quantity"] - 10 try: nextData = data["queries"]["nextPage"][0] except KeyError: return {} return { "start": nextData["startIndex"], "quantity": missing_quantity } def _create_request(self, method, *args, **kwargs): request = super(GoogleText, self)._create_request(method, *args, **kwargs) request["quantity"] = self.variables(*args)["quantity"] return request
gpl-3.0
6,124,814,023,701,157,000
30.621212
113
0.529947
false
SymbiFlow/prjxray
fuzzers/005-tilegrid/pcie/top.py
1
1574
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import os import random random.seed(int(os.getenv("SEED"), 16)) from prjxray import util from prjxray.db import Database def gen_sites(): db = Database(util.get_db_root(), util.get_part()) grid = db.grid() for tile_name in sorted(grid.tiles()): loc = grid.loc_of_tilename(tile_name) gridinfo = grid.gridinfo_at_loc(loc) for site_name, site_type in gridinfo.sites.items(): if site_type in ['PCIE_2_1']: yield tile_name, site_name def write_params(params): pinstr = 'tile,val,site\n' for tile, (site, val) in sorted(params.items()): pinstr += '%s,%s,%s\n' % (tile, val, site) open('params.csv', 'w').write(pinstr) def run(): print(''' module top(input wire in, output wire out); ''') params = {} sites = list(gen_sites()) for (tile_name, site_name), isone in zip(sites, util.gen_fuzz_states(len(sites))): params[tile_name] = (site_name, isone) attr = "FALSE" if isone else "TRUE" print( ''' (* KEEP, DONT_TOUCH*) PCIE_2_1 #( .AER_CAP_PERMIT_ROOTERR_UPDATE("{}") ) pcie ();'''.format(attr)) print("endmodule") write_params(params) if __name__ == '__main__': run()
isc
6,070,674,432,901,419,000
24.387097
79
0.579416
false
itsnotmyfault1/kimcopter2
crazyflie-pc-client/lib/cflib/crazyflie/__init__.py
1
13576
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 2011-2013 Bitcraze AB # # Crazyflie Nano Quadcopter Client # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. """ The Crazyflie module is used to easily connect/send/receive data from a Crazyflie. Each function in the Crazyflie has a class in the module that can be used to access that functionality. The same design is then used in the Crazyflie firmware which makes the mapping 1:1 in most cases. """ __author__ = 'Bitcraze AB' __all__ = ['Crazyflie'] import logging logger = logging.getLogger(__name__) import time from threading import Thread from threading import Timer from .commander import Commander from .console import Console from .param import Param from .log import Log from .toccache import TocCache import cflib.crtp from cflib.utils.callbacks import Caller class State: """Stat of the connection procedure""" DISCONNECTED = 0 INITIALIZED = 1 CONNECTED = 2 SETUP_FINISHED = 3 class Crazyflie(): """The Crazyflie class""" # Callback callers disconnected = Caller() connectionLost = Caller() connected = Caller() connectionInitiated = Caller() connectSetupFinished = Caller() connectionFailed = Caller() receivedPacket = Caller() linkQuality = Caller() state = State.DISCONNECTED def __init__(self, link=None, ro_cache=None, rw_cache=None): """ Create the objects from this module and register callbacks. ro_cache -- Path to read-only cache (string) rw_cache -- Path to read-write cache (string) """ self.link = link self._toc_cache = TocCache(ro_cache=ro_cache, rw_cache=rw_cache) self.incoming = _IncomingPacketHandler(self) self.incoming.setDaemon(True) self.incoming.start() self.commander = Commander(self) self.log = Log(self) self.console = Console(self) self.param = Param(self) self._log_toc_updated = False self._param_toc_updated = False self.link_uri = "" # Used for retry when no reply was sent back self.receivedPacket.add_callback(self._check_for_initial_packet_cb) self.receivedPacket.add_callback(self._check_for_answers) self.answer_timers = {} # Connect callbacks to logger self.disconnected.add_callback( lambda uri: logger.info("Callback->Disconnected from [%s]", uri)) self.connected.add_callback( lambda uri: logger.info("Callback->Connected to [%s]", uri)) self.connectionLost.add_callback( lambda uri, errmsg: logger.info("Callback->Connectionl ost to" " [%s]: %s", uri, errmsg)) self.connectionFailed.add_callback( lambda uri, errmsg: logger.info("Callback->Connected failed to" " [%s]: %s", uri, errmsg)) self.connectionInitiated.add_callback( lambda uri: logger.info("Callback->Connection initialized[%s]", uri)) self.connectSetupFinished.add_callback( lambda uri: logger.info("Callback->Connection setup finished [%s]", uri)) def _start_connection_setup(self): """Start the connection setup by refreshing the TOCs""" logger.info("We are connected[%s], request connection setup", self.link_uri) self.log.refresh_toc(self._log_toc_updated_cb, self._toc_cache) def _param_toc_updated_cb(self): """Called when the param TOC has been fully updated""" logger.info("Param TOC finished updating") self._param_toc_updated = True if (self._log_toc_updated is True and self._param_toc_updated is True): self.connectSetupFinished.call(self.link_uri) def _log_toc_updated_cb(self): """Called when the log TOC has been fully updated""" logger.info("Log TOC finished updating") self._log_toc_updated = True self.param.refresh_toc(self._param_toc_updated_cb, self._toc_cache) if (self._log_toc_updated and self._param_toc_updated): logger.info("All TOCs finished updating") self.connectSetupFinished.call(self.link_uri) def _link_error_cb(self, errmsg): """Called from the link driver when there's an error""" logger.warning("Got link error callback [%s] in state [%s]", errmsg, self.state) if (self.link is not None): self.link.close() self.link = None if (self.state == State.INITIALIZED): self.connectionFailed.call(self.link_uri, errmsg) if (self.state == State.CONNECTED or self.state == State.SETUP_FINISHED): self.disconnected.call(self.link_uri) self.connectionLost.call(self.link_uri, errmsg) self.state = State.DISCONNECTED def _link_quality_cb(self, percentage): """Called from link driver to report link quality""" self.linkQuality.call(percentage) def _check_for_initial_packet_cb(self, data): """ Called when first packet arrives from Crazyflie. This is used to determine if we are connected to something that is answering. """ self.state = State.CONNECTED self.connected.call(self.link_uri) self.receivedPacket.remove_callback(self._check_for_initial_packet_cb) def open_link(self, link_uri): """ Open the communication link to a copter at the given URI and setup the connection (download log/parameter TOC). """ self.connectionInitiated.call(link_uri) self.state = State.INITIALIZED self.link_uri = link_uri self._log_toc_updated = False self._param_toc_updated = False try: self.link = cflib.crtp.get_link_driver(link_uri, self._link_quality_cb, self._link_error_cb) # Add a callback so we can check that any data is comming # back from the copter self.receivedPacket.add_callback(self._check_for_initial_packet_cb) self._start_connection_setup() except Exception as ex: # pylint: disable=W0703 # We want to catch every possible exception here and show # it in the user interface import traceback logger.error("Couldn't load link driver: %s\n\n%s", ex, traceback.format_exc()) exception_text = "Couldn't load link driver: %s\n\n%s" % ( ex, traceback.format_exc()) if self.link: self.link.close() self.link = None self.connectionFailed.call(link_uri, exception_text) def close_link(self): """Close the communication link.""" logger.info("Closing link") if (self.link is not None): self.commander.send_setpoint(0, 0, 0, 0, False) if (self.link is not None): self.link.close() self.link = None self.disconnected.call(self.link_uri) def add_port_callback(self, port, cb): """Add a callback to cb on port""" self.incoming.add_port_callback(port, cb) def remove_port_callback(self, port, cb): """Remove the callback cb on port""" self.incoming.remove_port_callback(port, cb) def _no_answer_do_retry(self, pk): """Resend packets that we have not gotten answers to""" logger.debug("ExpectAnswer: No answer on [%d], do retry", pk.port) # Cancel timer before calling for retry to help bug hunting old_timer = self.answer_timers[pk.port] if (old_timer is not None): old_timer.cancel() self.send_packet(pk, True) else: logger.warning("ExpectAnswer: ERROR! Was doing retry but" "timer was None") def _check_for_answers(self, pk): """ Callback called for every packet received to check if we are waiting for an answer on this port. If so, then cancel the retry timer. """ try: timer = self.answer_timers[pk.port] if (timer is not None): logger.debug("ExpectAnswer: Got answer back on port [%d]" ", cancelling timer", pk.port) timer.cancel() self.answer_timers[pk.port] = None except KeyError: # We are not waiting for any answer on this port, ignore.. pass def send_packet(self, pk, expect_answer=False): """ Send a packet through the link interface. pk -- Packet to send expect_answer -- True if a packet from the Crazyflie is expected to be sent back, otherwise false """ if (self.link is not None): self.link.send_packet(pk) if (expect_answer): logger.debug("ExpectAnswer: Will expect answer on port [%d]", pk.port) new_timer = Timer(0.2, lambda: self._no_answer_do_retry(pk)) try: old_timer = self.answer_timers[pk.port] if (old_timer is not None): old_timer.cancel() # If we get here a second call has been made to send # packet on this port before we have gotten the first # one back. This is an error and might cause loss of # packets!! logger.warning("ExpectAnswer: ERROR! Older timer whas" " running while scheduling new one on " "[%d]", pk.port) except KeyError: pass self.answer_timers[pk.port] = new_timer new_timer.start() class _IncomingPacketHandler(Thread): """Handles incoming packets and sends the data to the correct receivers""" def __init__(self, cf): Thread.__init__(self) self.cf = cf self.cb = [] def add_port_callback(self, port, cb): """Add a callback for data that comes on a specific port""" logger.debug("Adding callback on port [%d] to [%s]", port, cb) self.add_header_callback(cb, port, 0, 0xff, 0x0) def remove_port_callback(self, port, cb): """Remove a callback for data that comes on a specific port""" logger.debug("Removing callback on port [%d] to [%s]", port, cb) for port_callback in self.cb: if (port_callback[0] == port and port_callback[4] == cb): self.cb.remove(port_callback) def add_header_callback(self, cb, port, channel, port_mask=0xFF, channel_mask=0xFF): """ Add a callback for a specific port/header callback with the possibility to add a mask for channel and port for multiple hits for same callback. """ self.cb.append([port, port_mask, channel, channel_mask, cb]) def run(self): while(True): if self.cf.link is None: time.sleep(1) continue pk = self.cf.link.receive_packet(1) if pk is None: continue #All-packet callbacks self.cf.receivedPacket.call(pk) found = False for cb in self.cb: if (cb[0] == pk.port & cb[1] and cb[2] == pk.channel & cb[3]): try: cb[4](pk) except Exception: # pylint: disable=W0703 # Disregard pylint warning since we want to catch all # exceptions and we can't know what will happen in # the callbacks. import traceback logger.warning("Exception while doing callback on port" " [%d]\n\n%s", pk.port, traceback.format_exc()) if (cb[0] != 0xFF): found = True if not found: logger.warning("Got packet on header (%d,%d) but no callback " "to handle it", pk.port, pk.channel)
gpl-2.0
7,902,765,162,880,301,000
37.350282
79
0.560106
false
twisted/mantissa
xmantissa/test/historic/test_privateApplication3to4.py
1
3405
""" Tests for the upgrade of L{PrivateApplication} schema from 3 to 4. """ from axiom.userbase import LoginSystem from axiom.test.historic.stubloader import StubbedTest from xmantissa.ixmantissa import ITemplateNameResolver, IWebViewer from xmantissa.website import WebSite from xmantissa.webapp import PrivateApplication from xmantissa.publicweb import CustomizedPublicPage from xmantissa.webgestalt import AuthenticationApplication from xmantissa.prefs import PreferenceAggregator, DefaultPreferenceCollection from xmantissa.search import SearchAggregator from xmantissa.test.historic.stub_privateApplication3to4 import ( USERNAME, DOMAIN, PREFERRED_THEME, PRIVATE_KEY) class PrivateApplicationUpgradeTests(StubbedTest): """ Tests for L{xmantissa.webapp.privateApplication3to4}. """ def setUp(self): d = StubbedTest.setUp(self) def siteStoreUpgraded(ignored): loginSystem = self.store.findUnique(LoginSystem) account = loginSystem.accountByAddress(USERNAME, DOMAIN) self.subStore = account.avatars.open() return self.subStore.whenFullyUpgraded() d.addCallback(siteStoreUpgraded) return d def test_powerup(self): """ At version 4, L{PrivateApplication} should be an L{ITemplateNameResolver} powerup on its store. """ application = self.subStore.findUnique(PrivateApplication) powerups = list(self.subStore.powerupsFor(ITemplateNameResolver)) self.assertIn(application, powerups) def test_webViewer(self): """ At version 5, L{PrivateApplication} should be an L{IWebViewer} powerup on its store. """ application = self.subStore.findUnique(PrivateApplication) interfaces = list(self.subStore.interfacesFor(application)) self.assertIn(IWebViewer, interfaces) def test_attributes(self): """ All of the attributes of L{PrivateApplication} should have the same values on the upgraded item as they did before the upgrade. """ application = self.subStore.findUnique(PrivateApplication) self.assertEqual(application.preferredTheme, PREFERRED_THEME) self.assertEqual(application.privateKey, PRIVATE_KEY) website = self.subStore.findUnique(WebSite) self.assertIdentical(application.website, website) customizedPublicPage = self.subStore.findUnique(CustomizedPublicPage) self.assertIdentical( application.customizedPublicPage, customizedPublicPage) authenticationApplication = self.subStore.findUnique( AuthenticationApplication) self.assertIdentical( application.authenticationApplication, authenticationApplication) preferenceAggregator = self.subStore.findUnique(PreferenceAggregator) self.assertIdentical( application.preferenceAggregator, preferenceAggregator) defaultPreferenceCollection = self.subStore.findUnique( DefaultPreferenceCollection) self.assertIdentical( application.defaultPreferenceCollection, defaultPreferenceCollection) searchAggregator = self.subStore.findUnique(SearchAggregator) self.assertIdentical(application.searchAggregator, searchAggregator) self.assertIdentical(application.privateIndexPage, None)
mit
4,140,660,516,419,531,000
37.258427
77
0.726579
false
Lemueler/Petro-UI
utils.py
1
10256
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2012 Deepin, Inc. # 2012 Kaisheng Ye # # Author: Kaisheng Ye <[email protected]> # Maintainer: Kaisheng Ye <[email protected]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from constant import DEFAULT_FONT, DEFAULT_FONT_SIZE import gtk import cairo import pangocairo import pango import math import socket import os import traceback import sys import datetime from contextlib import contextmanager from weather.Weather_info import Weather_info import test @contextmanager def cairo_disable_antialias(cr): # Save antialias. antialias = cr.get_antialias() cr.set_antialias(cairo.ANTIALIAS_NONE) try: yield except Exception, e: print 'function cairo_disable_antialias got error: %s' % e traceback.print_exc(file=sys.stdout) else: # Restore antialias. cr.set_antialias(antialias) def cairo_popover(widget, surface_context, trayicon_x, trayicon_y, trayicon_w, trayicon_h, radius, arrow_width, arrow_height, offs=0, pos_type=gtk.POS_TOP): cr = surface_context x = trayicon_x y = trayicon_y w = trayicon_w - trayicon_x * 2 h = trayicon_h - trayicon_x * 2 # set position top, bottom. if pos_type == gtk.POS_BOTTOM: y = y - arrow_height h -= y # draw. cr.arc(x + radius, y + arrow_height + radius, radius, math.pi, math.pi * 1.5) if pos_type == gtk.POS_TOP: y_padding = y + arrow_height arrow_height_padding = arrow_height cr.line_to(offs, y_padding) cr.rel_line_to(arrow_width / 2.0, -arrow_height_padding) cr.rel_line_to(arrow_width / 2.0, arrow_height_padding) cr.arc(x + w - radius, y + arrow_height + radius, radius, math.pi * 1.5, math.pi * 2.0) cr.arc(x + w - radius, y + h - radius, radius, 0, math.pi * 0.5) if pos_type == gtk.POS_BOTTOM: y_padding = trayicon_y + h - arrow_height arrow_height_padding = arrow_height cr.line_to(offs + arrow_width, y_padding) cr.rel_line_to(-arrow_width / 2.0, arrow_height_padding) cr.rel_line_to(-arrow_width / 2.0, -arrow_height_padding) cr.arc(x + radius, y + h - radius, radius, math.pi * 0.5, math.pi) cr.close_path() def new_surface(width, height): surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height) surface_context = cairo.Context(surface) return surface, surface_context def propagate_expose(widget, event): if hasattr(widget, "get_child") and widget.get_child(): widget.propagate_expose(widget.get_child(), event) def get_text_size(text, text_size=DEFAULT_FONT_SIZE, text_font=DEFAULT_FONT): try: surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 0, 0) cr = cairo.Context(surface) context = pangocairo.CairoContext(cr) layout = context.create_layout() temp_font = pango.FontDescription("%s %s" % (text_font, text_size)) layout.set_font_description(temp_font) layout.set_text(text) return layout.get_pixel_size() except: return (0, 0) def get_home_path(): return os.path.expandvars("$HOME") def get_config_path(): return os.path.join(get_home_path(), ".config/deepin-system-settings/tray") def get_config_file(): return os.path.join(get_config_path(), "config.ini") def config_path_check(): if os.path.exists(get_config_path()): return True else: return False def config_file_check(): if os.path.exists(get_config_file()): return True else: return False def init_config_path(): os.makedirs(get_config_path()) def pixbuf_check(element): return isinstance(element, gtk.gdk.Pixbuf) def text_check(element): return isinstance(element, str) def cn_check(): return os.environ["LANGUAGE"].startswith("zh_") def app_check(bind_name): try: app_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) app_socket.bind(bind_name) return False except: return True def clear_app_bind(bind_name): try: os.remove(bind_name) except Exception, e: print "clear_app_bind[error]:", e def get_run_app_path(add_path="image"): file = os.path.abspath(sys.argv[0]) path = os.path.dirname(file) return os.path.join(path, add_path) def cairo_popover_rectangle(widget, surface_context, trayicon_x, trayicon_y, trayicon_w, trayicon_h, radius): cr = surface_context x = trayicon_x y = trayicon_y w = trayicon_w - (trayicon_x * 2) h = trayicon_h - (trayicon_x * 2) # draw. cr.arc(x + radius, y + radius, radius, math.pi, math.pi * 1.5) cr.arc(x + w - radius, y + radius, radius, math.pi * 1.5, math.pi * 2.0) cr.arc(x + w - radius, y + h - radius, radius, 0, math.pi * 0.5) cr.arc(x + radius, y + h - radius, radius, math.pi * 0.5, math.pi) cr.close_path() def in_window_check(widget, event): toplevel = widget.get_toplevel() window_x, window_y = toplevel.get_position() x_root = event.x_root y_root = event.y_root if not ((x_root >= window_x and x_root < window_x + widget.allocation.width) and (y_root >= window_y and y_root < window_y + widget.allocation.height)): return True def move_window(widget, event, window): ''' Move window with given widget and event. This function generic use for move window when mouse drag on target widget. @param widget: Gtk.Widget instance to drag. @param event: Gdk.Event instance, generic, event come from gtk signal call. @param window: Gtk.Window instance. ''' if event.button == 1: window.begin_move_drag( event.button, int(event.x_root), int(event.y_root), event.time) return False def container_remove_all(container): ''' Handy function to remove all children widget from container. @param container: Gtk.Container instance. ''' container.foreach(lambda widget: container.remove(widget)) def get_screen_size(widget): ''' Get screen size from the toplevel window associated with widget. @param widget: Gtk.Widget instance. @return: Return screen size as (screen_width, screen_height) ''' screen = widget.get_screen() width = screen.get_width() height = screen.get_height() return (width, height) def scroll_to_top(scrolled_window): ''' Scroll scrolled_window to top position. @param scrolled_window: Gtk.ScrolledWindow instance. ''' scrolled_window.get_vadjustment().set_value(0) def scroll_to_bottom(scrolled_window): ''' Scroll scrolled_window to bottom position. @param scrolled_window: Gtk.ScrolledWindow instance. ''' vadjust = scrolled_window.get_vadjustment() vadjust.set_value(vadjust.get_upper() - vadjust.get_page_size()) def window_is_max(widget): ''' Whether window is maximized. @param widget: Gtk.Widget instance. @return: Return True if widget's toplevel window is maximized. ''' toplevel_window = widget.get_toplevel() if (toplevel_window.window.get_state() and gtk.gdk.WINDOW_STATE_MAXIMIZED == gtk.gdk.WINDOW_STATE_MAXIMIZED): return True else: return False def remove_signal_id(signal_id): ''' Remove signal id. @param signal_id: Signal id that return by function gobject.connect. ''' if signal_id: (signal_object, signal_handler_id) = signal_id if signal_object.handler_is_connected(signal_handler_id): signal_object.disconnect(signal_handler_id) signal_id = None def get_image_files(directory): imagetypes = ['png', 'jpg', 'jpeg'] tmp = [] if not os.path.exists(directory): return None for root, dirs, fileNames in os.walk(directory): if fileNames: for filename in fileNames: if '.' in filename and filename.split('.')[1] in imagetypes: tmp.append(os.path.join(root, filename)) return tmp def alpha_color_hex_to_cairo((color, alpha)): (r, g, b) = color_hex_to_cairo(color) return (r, g, b, alpha) def color_hex_to_cairo(color): gdk_color = gtk.gdk.color_parse(color) return (gdk_color.red / 65535.0, gdk_color.green / 65535.0, gdk_color.blue / 65535.0) def get_weekdays(days): day_id = datetime.datetime.now().weekday() data = [] weekday_info = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"] for i in xrange(0, days): data.append(weekday_info[day_id]) day_id += 1 if day_id == 7: day_id = 0 return data def get_weather_pic(weather): test.debug_tip(__file__, weather) image = Weather_info.get(weather) if image: return image else: return "./image/weather/na.png" def check_network(): import urllib2 try: urllib2.urlopen('http://wlemuel.sinaapp.com', timeout=1) return True except urllib2.URLError: return False
lgpl-3.0
5,664,354,250,956,561,000
25.158568
79
0.604908
false
tmenjo/cinder-2015.1.1
cinder/tests/test_rbd.py
1
50268
# Copyright 2012 Josh Durgin # Copyright 2013 Canonical Ltd. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import math import os import tempfile import mock from oslo_log import log as logging from oslo_utils import timeutils from oslo_utils import units from cinder import db from cinder import exception from cinder.i18n import _ from cinder.image import image_utils from cinder import test from cinder.tests.image import fake as fake_image from cinder.tests import test_volume from cinder.volume import configuration as conf import cinder.volume.drivers.rbd as driver from cinder.volume.flows.manager import create_volume LOG = logging.getLogger(__name__) # This is used to collect raised exceptions so that tests may check what was # raised. # NOTE: this must be initialised in test setUp(). RAISED_EXCEPTIONS = [] class MockException(Exception): def __init__(self, *args, **kwargs): RAISED_EXCEPTIONS.append(self.__class__) class MockImageNotFoundException(MockException): """Used as mock for rbd.ImageNotFound.""" class MockImageBusyException(MockException): """Used as mock for rbd.ImageBusy.""" class MockImageExistsException(MockException): """Used as mock for rbd.ImageExists.""" def common_mocks(f): """Decorator to set mocks common to all tests. The point of doing these mocks here is so that we don't accidentally set mocks that can't/don't get unset. """ def _common_inner_inner1(inst, *args, **kwargs): @mock.patch('cinder.volume.drivers.rbd.RBDVolumeProxy') @mock.patch('cinder.volume.drivers.rbd.RADOSClient') @mock.patch('cinder.backup.drivers.ceph.rbd') @mock.patch('cinder.backup.drivers.ceph.rados') def _common_inner_inner2(mock_rados, mock_rbd, mock_client, mock_proxy): inst.mock_rbd = mock_rbd inst.mock_rados = mock_rados inst.mock_client = mock_client inst.mock_proxy = mock_proxy inst.mock_rbd.RBD.Error = Exception inst.mock_rados.Error = Exception inst.mock_rbd.ImageBusy = MockImageBusyException inst.mock_rbd.ImageNotFound = MockImageNotFoundException inst.mock_rbd.ImageExists = MockImageExistsException inst.driver.rbd = inst.mock_rbd inst.driver.rados = inst.mock_rados return f(inst, *args, **kwargs) return _common_inner_inner2() return _common_inner_inner1 CEPH_MON_DUMP = """dumped monmap epoch 1 { "epoch": 1, "fsid": "33630410-6d93-4d66-8e42-3b953cf194aa", "modified": "2013-05-22 17:44:56.343618", "created": "2013-05-22 17:44:56.343618", "mons": [ { "rank": 0, "name": "a", "addr": "[::1]:6789\/0"}, { "rank": 1, "name": "b", "addr": "[::1]:6790\/0"}, { "rank": 2, "name": "c", "addr": "[::1]:6791\/0"}, { "rank": 3, "name": "d", "addr": "127.0.0.1:6792\/0"}, { "rank": 4, "name": "e", "addr": "example.com:6791\/0"}], "quorum": [ 0, 1, 2]} """ class RBDTestCase(test.TestCase): def setUp(self): global RAISED_EXCEPTIONS RAISED_EXCEPTIONS = [] super(RBDTestCase, self).setUp() self.cfg = mock.Mock(spec=conf.Configuration) self.cfg.volume_tmp_dir = None self.cfg.image_conversion_dir = None self.cfg.rbd_pool = 'rbd' self.cfg.rbd_ceph_conf = None self.cfg.rbd_secret_uuid = None self.cfg.rbd_user = None self.cfg.volume_dd_blocksize = '1M' self.cfg.rbd_store_chunk_size = 4 mock_exec = mock.Mock() mock_exec.return_value = ('', '') self.driver = driver.RBDDriver(execute=mock_exec, configuration=self.cfg) self.driver.set_initialized() self.volume_name = u'volume-00000001' self.snapshot_name = u'snapshot-00000001' self.volume_size = 1 self.volume = dict(name=self.volume_name, size=self.volume_size) self.snapshot = dict(volume_name=self.volume_name, name=self.snapshot_name) @common_mocks def test_create_volume(self): client = self.mock_client.return_value client.__enter__.return_value = client self.driver.create_volume(self.volume) chunk_size = self.cfg.rbd_store_chunk_size * units.Mi order = int(math.log(chunk_size, 2)) args = [client.ioctx, str(self.volume_name), self.volume_size * units.Gi, order] kwargs = {'old_format': False, 'features': client.features} self.mock_rbd.RBD.return_value.create.assert_called_once_with( *args, **kwargs) client.__enter__.assert_called_once_with() client.__exit__.assert_called_once_with(None, None, None) @common_mocks def test_manage_existing_get_size(self): with mock.patch.object(self.driver.rbd.Image(), 'size') as \ mock_rbd_image_size: with mock.patch.object(self.driver.rbd.Image(), 'close') \ as mock_rbd_image_close: mock_rbd_image_size.return_value = 2 * units.Gi existing_ref = {'source-name': self.volume_name} return_size = self.driver.manage_existing_get_size( self.volume, existing_ref) self.assertEqual(2, return_size) mock_rbd_image_size.assert_called_once_with() mock_rbd_image_close.assert_called_once_with() @common_mocks def test_manage_existing_get_invalid_size(self): with mock.patch.object(self.driver.rbd.Image(), 'size') as \ mock_rbd_image_size: with mock.patch.object(self.driver.rbd.Image(), 'close') \ as mock_rbd_image_close: mock_rbd_image_size.return_value = 'abcd' existing_ref = {'source-name': self.volume_name} self.assertRaises(exception.VolumeBackendAPIException, self.driver.manage_existing_get_size, self.volume, existing_ref) mock_rbd_image_size.assert_called_once_with() mock_rbd_image_close.assert_called_once_with() @common_mocks def test_manage_existing(self): client = self.mock_client.return_value client.__enter__.return_value = client with mock.patch.object(self.driver.rbd.RBD(), 'rename') as \ mock_rbd_image_rename: exist_volume = 'vol-exist' existing_ref = {'source-name': exist_volume} mock_rbd_image_rename.return_value = 0 self.driver.manage_existing(self.volume, existing_ref) mock_rbd_image_rename.assert_called_with( client.ioctx, exist_volume, self.volume_name) @common_mocks def test_manage_existing_with_exist_rbd_image(self): client = self.mock_client.return_value client.__enter__.return_value = client self.mock_rbd.RBD.return_value.rename.side_effect = ( MockImageExistsException) exist_volume = 'vol-exist' existing_ref = {'source-name': exist_volume} self.assertRaises(self.mock_rbd.ImageExists, self.driver.manage_existing, self.volume, existing_ref) # Make sure the exception was raised self.assertEqual(RAISED_EXCEPTIONS, [self.mock_rbd.ImageExists]) @common_mocks def test_delete_backup_snaps(self): self.driver.rbd.Image.remove_snap = mock.Mock() with mock.patch.object(self.driver, '_get_backup_snaps') as \ mock_get_backup_snaps: mock_get_backup_snaps.return_value = [{'name': 'snap1'}] rbd_image = self.driver.rbd.Image() self.driver._delete_backup_snaps(rbd_image) mock_get_backup_snaps.assert_called_once_with(rbd_image) self.assertTrue( self.driver.rbd.Image.return_value.remove_snap.called) @common_mocks def test_delete_volume(self): client = self.mock_client.return_value self.driver.rbd.Image.return_value.list_snaps.return_value = [] with mock.patch.object(self.driver, '_get_clone_info') as \ mock_get_clone_info: with mock.patch.object(self.driver, '_delete_backup_snaps') as \ mock_delete_backup_snaps: mock_get_clone_info.return_value = (None, None, None) self.driver.delete_volume(self.volume) mock_get_clone_info.assert_called_once_with( self.mock_rbd.Image.return_value, self.volume_name, None) (self.driver.rbd.Image.return_value .list_snaps.assert_called_once_with()) client.__enter__.assert_called_once_with() client.__exit__.assert_called_once_with(None, None, None) mock_delete_backup_snaps.assert_called_once_with( self.mock_rbd.Image.return_value) self.assertFalse( self.driver.rbd.Image.return_value.unprotect_snap.called) self.assertEqual( 1, self.driver.rbd.RBD.return_value.remove.call_count) @common_mocks def delete_volume_not_found(self): self.mock_rbd.Image.side_effect = self.mock_rbd.ImageNotFound self.assertIsNone(self.driver.delete_volume(self.volume)) self.mock_rbd.Image.assert_called_once_with() # Make sure the exception was raised self.assertEqual(RAISED_EXCEPTIONS, [self.mock_rbd.ImageNotFound]) @common_mocks def test_delete_busy_volume(self): self.mock_rbd.Image.return_value.list_snaps.return_value = [] self.mock_rbd.RBD.return_value.remove.side_effect = ( self.mock_rbd.ImageBusy) with mock.patch.object(self.driver, '_get_clone_info') as \ mock_get_clone_info: mock_get_clone_info.return_value = (None, None, None) with mock.patch.object(self.driver, '_delete_backup_snaps') as \ mock_delete_backup_snaps: with mock.patch.object(driver, 'RADOSClient') as \ mock_rados_client: self.assertRaises(exception.VolumeIsBusy, self.driver.delete_volume, self.volume) mock_get_clone_info.assert_called_once_with( self.mock_rbd.Image.return_value, self.volume_name, None) (self.mock_rbd.Image.return_value.list_snaps .assert_called_once_with()) mock_rados_client.assert_called_once_with(self.driver) mock_delete_backup_snaps.assert_called_once_with( self.mock_rbd.Image.return_value) self.assertFalse( self.mock_rbd.Image.return_value.unprotect_snap.called) self.assertEqual( 1, self.mock_rbd.RBD.return_value.remove.call_count) # Make sure the exception was raised self.assertEqual(RAISED_EXCEPTIONS, [self.mock_rbd.ImageBusy]) @common_mocks def test_delete_volume_not_found(self): self.mock_rbd.Image.return_value.list_snaps.return_value = [] self.mock_rbd.RBD.return_value.remove.side_effect = ( self.mock_rbd.ImageNotFound) with mock.patch.object(self.driver, '_get_clone_info') as \ mock_get_clone_info: mock_get_clone_info.return_value = (None, None, None) with mock.patch.object(self.driver, '_delete_backup_snaps') as \ mock_delete_backup_snaps: with mock.patch.object(driver, 'RADOSClient') as \ mock_rados_client: self.assertIsNone(self.driver.delete_volume(self.volume)) mock_get_clone_info.assert_called_once_with( self.mock_rbd.Image.return_value, self.volume_name, None) (self.mock_rbd.Image.return_value.list_snaps .assert_called_once_with()) mock_rados_client.assert_called_once_with(self.driver) mock_delete_backup_snaps.assert_called_once_with( self.mock_rbd.Image.return_value) self.assertFalse( self.mock_rbd.Image.return_value.unprotect_snap.called) self.assertEqual( 1, self.mock_rbd.RBD.return_value.remove.call_count) # Make sure the exception was raised self.assertEqual(RAISED_EXCEPTIONS, [self.mock_rbd.ImageNotFound]) @common_mocks def test_create_snapshot(self): proxy = self.mock_proxy.return_value proxy.__enter__.return_value = proxy self.driver.create_snapshot(self.snapshot) args = [str(self.snapshot_name)] proxy.create_snap.assert_called_with(*args) proxy.protect_snap.assert_called_with(*args) @common_mocks def test_delete_snapshot(self): proxy = self.mock_proxy.return_value proxy.__enter__.return_value = proxy self.driver.delete_snapshot(self.snapshot) args = [str(self.snapshot_name)] proxy.remove_snap.assert_called_with(*args) proxy.unprotect_snap.assert_called_with(*args) @common_mocks def test_get_clone_info(self): volume = self.mock_rbd.Image() volume.set_snap = mock.Mock() volume.parent_info = mock.Mock() parent_info = ('a', 'b', '%s.clone_snap' % (self.volume_name)) volume.parent_info.return_value = parent_info info = self.driver._get_clone_info(volume, self.volume_name) self.assertEqual(info, parent_info) self.assertFalse(volume.set_snap.called) volume.parent_info.assert_called_once_with() @common_mocks def test_get_clone_info_w_snap(self): volume = self.mock_rbd.Image() volume.set_snap = mock.Mock() volume.parent_info = mock.Mock() parent_info = ('a', 'b', '%s.clone_snap' % (self.volume_name)) volume.parent_info.return_value = parent_info snapshot = self.mock_rbd.ImageSnapshot() info = self.driver._get_clone_info(volume, self.volume_name, snap=snapshot) self.assertEqual(info, parent_info) self.assertEqual(volume.set_snap.call_count, 2) volume.parent_info.assert_called_once_with() @common_mocks def test_get_clone_info_w_exception(self): volume = self.mock_rbd.Image() volume.set_snap = mock.Mock() volume.parent_info = mock.Mock() volume.parent_info.side_effect = self.mock_rbd.ImageNotFound snapshot = self.mock_rbd.ImageSnapshot() info = self.driver._get_clone_info(volume, self.volume_name, snap=snapshot) self.assertEqual(info, (None, None, None)) self.assertEqual(volume.set_snap.call_count, 2) volume.parent_info.assert_called_once_with() # Make sure the exception was raised self.assertEqual(RAISED_EXCEPTIONS, [self.mock_rbd.ImageNotFound]) @common_mocks def test_get_clone_info_deleted_volume(self): volume = self.mock_rbd.Image() volume.set_snap = mock.Mock() volume.parent_info = mock.Mock() parent_info = ('a', 'b', '%s.clone_snap' % (self.volume_name)) volume.parent_info.return_value = parent_info info = self.driver._get_clone_info(volume, "%s.deleted" % (self.volume_name)) self.assertEqual(info, parent_info) self.assertFalse(volume.set_snap.called) volume.parent_info.assert_called_once_with() @common_mocks def test_create_cloned_volume_same_size(self): src_name = u'volume-00000001' dst_name = u'volume-00000002' self.cfg.rbd_max_clone_depth = 2 with mock.patch.object(self.driver, '_get_clone_depth') as \ mock_get_clone_depth: # Try with no flatten required with mock.patch.object(self.driver, '_resize') as mock_resize: mock_get_clone_depth.return_value = 1 self.driver.create_cloned_volume({'name': dst_name, 'size': 10}, {'name': src_name, 'size': 10}) (self.mock_rbd.Image.return_value.create_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) (self.mock_rbd.Image.return_value.protect_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) self.assertEqual( 1, self.mock_rbd.RBD.return_value.clone.call_count) self.mock_rbd.Image.return_value.close \ .assert_called_once_with() self.assertTrue(mock_get_clone_depth.called) self.assertEqual( 0, mock_resize.call_count) @common_mocks def test_create_cloned_volume_different_size(self): src_name = u'volume-00000001' dst_name = u'volume-00000002' self.cfg.rbd_max_clone_depth = 2 with mock.patch.object(self.driver, '_get_clone_depth') as \ mock_get_clone_depth: # Try with no flatten required with mock.patch.object(self.driver, '_resize') as mock_resize: mock_get_clone_depth.return_value = 1 self.driver.create_cloned_volume({'name': dst_name, 'size': 20}, {'name': src_name, 'size': 10}) (self.mock_rbd.Image.return_value.create_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) (self.mock_rbd.Image.return_value.protect_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) self.assertEqual( 1, self.mock_rbd.RBD.return_value.clone.call_count) self.mock_rbd.Image.return_value.close \ .assert_called_once_with() self.assertTrue(mock_get_clone_depth.called) self.assertEqual( 1, mock_resize.call_count) @common_mocks def test_create_cloned_volume_w_flatten(self): src_name = u'volume-00000001' dst_name = u'volume-00000002' self.cfg.rbd_max_clone_depth = 1 self.mock_rbd.RBD.return_value.clone.side_effect = ( self.mock_rbd.RBD.Error) with mock.patch.object(self.driver, '_get_clone_depth') as \ mock_get_clone_depth: # Try with no flatten required mock_get_clone_depth.return_value = 1 self.assertRaises(self.mock_rbd.RBD.Error, self.driver.create_cloned_volume, dict(name=dst_name), dict(name=src_name)) (self.mock_rbd.Image.return_value.create_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) (self.mock_rbd.Image.return_value.protect_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) self.assertEqual( 1, self.mock_rbd.RBD.return_value.clone.call_count) (self.mock_rbd.Image.return_value.unprotect_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) (self.mock_rbd.Image.return_value.remove_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) self.mock_rbd.Image.return_value.close.assert_called_once_with() self.assertTrue(mock_get_clone_depth.called) @common_mocks def test_create_cloned_volume_w_clone_exception(self): src_name = u'volume-00000001' dst_name = u'volume-00000002' self.cfg.rbd_max_clone_depth = 2 self.mock_rbd.RBD.return_value.clone.side_effect = ( self.mock_rbd.RBD.Error) with mock.patch.object(self.driver, '_get_clone_depth') as \ mock_get_clone_depth: # Try with no flatten required mock_get_clone_depth.return_value = 1 self.assertRaises(self.mock_rbd.RBD.Error, self.driver.create_cloned_volume, {'name': dst_name}, {'name': src_name}) (self.mock_rbd.Image.return_value.create_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) (self.mock_rbd.Image.return_value.protect_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) self.assertEqual( 1, self.mock_rbd.RBD.return_value.clone.call_count) (self.mock_rbd.Image.return_value.unprotect_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) (self.mock_rbd.Image.return_value.remove_snap .assert_called_once_with('.'.join((dst_name, 'clone_snap')))) self.mock_rbd.Image.return_value.close.assert_called_once_with() @common_mocks def test_good_locations(self): locations = ['rbd://fsid/pool/image/snap', 'rbd://%2F/%2F/%2F/%2F', ] map(self.driver._parse_location, locations) @common_mocks def test_bad_locations(self): locations = ['rbd://image', 'http://path/to/somewhere/else', 'rbd://image/extra', 'rbd://image/', 'rbd://fsid/pool/image/', 'rbd://fsid/pool/image/snap/', 'rbd://///', ] for loc in locations: self.assertRaises(exception.ImageUnacceptable, self.driver._parse_location, loc) self.assertFalse( self.driver._is_cloneable(loc, {'disk_format': 'raw'})) @common_mocks def test_cloneable(self): with mock.patch.object(self.driver, '_get_fsid') as mock_get_fsid: mock_get_fsid.return_value = 'abc' location = 'rbd://abc/pool/image/snap' info = {'disk_format': 'raw'} self.assertTrue(self.driver._is_cloneable(location, info)) self.assertTrue(mock_get_fsid.called) @common_mocks def test_uncloneable_different_fsid(self): with mock.patch.object(self.driver, '_get_fsid') as mock_get_fsid: mock_get_fsid.return_value = 'abc' location = 'rbd://def/pool/image/snap' self.assertFalse( self.driver._is_cloneable(location, {'disk_format': 'raw'})) self.assertTrue(mock_get_fsid.called) @common_mocks def test_uncloneable_unreadable(self): with mock.patch.object(self.driver, '_get_fsid') as mock_get_fsid: mock_get_fsid.return_value = 'abc' location = 'rbd://abc/pool/image/snap' self.driver.rbd.Error = Exception self.mock_proxy.side_effect = Exception args = [location, {'disk_format': 'raw'}] self.assertFalse(self.driver._is_cloneable(*args)) self.assertEqual(1, self.mock_proxy.call_count) self.assertTrue(mock_get_fsid.called) @common_mocks def test_uncloneable_bad_format(self): with mock.patch.object(self.driver, '_get_fsid') as mock_get_fsid: mock_get_fsid.return_value = 'abc' location = 'rbd://abc/pool/image/snap' formats = ['qcow2', 'vmdk', 'vdi'] for f in formats: self.assertFalse( self.driver._is_cloneable(location, {'disk_format': f})) self.assertTrue(mock_get_fsid.called) def _copy_image(self): with mock.patch.object(tempfile, 'NamedTemporaryFile'): with mock.patch.object(os.path, 'exists') as mock_exists: mock_exists.return_value = True with mock.patch.object(image_utils, 'fetch_to_raw'): with mock.patch.object(self.driver, 'delete_volume'): with mock.patch.object(self.driver, '_resize'): mock_image_service = mock.MagicMock() args = [None, {'name': 'test', 'size': 1}, mock_image_service, None] self.driver.copy_image_to_volume(*args) @common_mocks def test_copy_image_no_volume_tmp(self): self.cfg.volume_tmp_dir = None self.cfg.image_conversion_dir = None self._copy_image() @common_mocks def test_copy_image_volume_tmp(self): self.cfg.volume_tmp_dir = None self.cfg.image_conversion_dir = '/var/run/cinder/tmp' self._copy_image() @common_mocks def test_update_volume_stats(self): client = self.mock_client.return_value client.__enter__.return_value = client client.cluster = mock.Mock() client.cluster.mon_command = mock.Mock() client.cluster.mon_command.return_value = ( 0, '{"stats":{"total_bytes":64385286144,' '"total_used_bytes":3289628672,"total_avail_bytes":61095657472},' '"pools":[{"name":"rbd","id":2,"stats":{"kb_used":1510197,' '"bytes_used":1546440971,"max_avail":28987613184,"objects":412}},' '{"name":"volumes","id":3,"stats":{"kb_used":0,"bytes_used":0,' '"max_avail":28987613184,"objects":0}}]}\n', '') self.driver.configuration.safe_get = mock.Mock() self.driver.configuration.safe_get.return_value = 'RBD' expected = dict( volume_backend_name='RBD', vendor_name='Open Source', driver_version=self.driver.VERSION, storage_protocol='ceph', total_capacity_gb=27, free_capacity_gb=26, reserved_percentage=0) actual = self.driver.get_volume_stats(True) client.cluster.mon_command.assert_called_once_with( '{"prefix":"df", "format":"json"}', '') self.assertDictMatch(expected, actual) @common_mocks def test_update_volume_stats_error(self): client = self.mock_client.return_value client.__enter__.return_value = client client.cluster = mock.Mock() client.cluster.mon_command = mock.Mock() client.cluster.mon_command.return_value = (22, '', '') self.driver.configuration.safe_get = mock.Mock() self.driver.configuration.safe_get.return_value = 'RBD' expected = dict(volume_backend_name='RBD', vendor_name='Open Source', driver_version=self.driver.VERSION, storage_protocol='ceph', total_capacity_gb='unknown', free_capacity_gb='unknown', reserved_percentage=0) actual = self.driver.get_volume_stats(True) client.cluster.mon_command.assert_called_once_with( '{"prefix":"df", "format":"json"}', '') self.assertDictMatch(expected, actual) @common_mocks def test_get_mon_addrs(self): with mock.patch.object(self.driver, '_execute') as mock_execute: mock_execute.return_value = (CEPH_MON_DUMP, '') hosts = ['::1', '::1', '::1', '127.0.0.1', 'example.com'] ports = ['6789', '6790', '6791', '6792', '6791'] self.assertEqual((hosts, ports), self.driver._get_mon_addrs()) @common_mocks def test_initialize_connection(self): hosts = ['::1', '::1', '::1', '127.0.0.1', 'example.com'] ports = ['6789', '6790', '6791', '6792', '6791'] with mock.patch.object(self.driver, '_get_mon_addrs') as \ mock_get_mon_addrs: mock_get_mon_addrs.return_value = (hosts, ports) expected = { 'driver_volume_type': 'rbd', 'data': { 'name': '%s/%s' % (self.cfg.rbd_pool, self.volume_name), 'hosts': hosts, 'ports': ports, 'auth_enabled': False, 'auth_username': None, 'secret_type': 'ceph', 'secret_uuid': None, } } volume = dict(name=self.volume_name) actual = self.driver.initialize_connection(volume, None) self.assertDictMatch(expected, actual) self.assertTrue(mock_get_mon_addrs.called) @common_mocks def test_clone(self): src_pool = u'images' src_image = u'image-name' src_snap = u'snapshot-name' client_stack = [] def mock__enter__(inst): def _inner(): client_stack.append(inst) return inst return _inner client = self.mock_client.return_value # capture both rados client used to perform the clone client.__enter__.side_effect = mock__enter__(client) self.driver._clone(self.volume, src_pool, src_image, src_snap) args = [client_stack[0].ioctx, str(src_image), str(src_snap), client_stack[1].ioctx, str(self.volume_name)] kwargs = {'features': client.features} self.mock_rbd.RBD.return_value.clone.assert_called_once_with( *args, **kwargs) self.assertEqual(client.__enter__.call_count, 2) @common_mocks def test_extend_volume(self): fake_size = '20' fake_vol = {'project_id': 'testprjid', 'name': self.volume_name, 'size': fake_size, 'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66'} self.mox.StubOutWithMock(self.driver, '_resize') size = int(fake_size) * units.Gi self.driver._resize(fake_vol, size=size) self.mox.ReplayAll() self.driver.extend_volume(fake_vol, fake_size) self.mox.VerifyAll() @common_mocks def test_retype(self): context = {} diff = {'encryption': {}, 'extra_specs': {}} fake_volume = {'name': 'testvolume', 'host': 'currenthost'} fake_type = 'high-IOPS' # no support for migration host = {'host': 'anotherhost'} self.assertFalse(self.driver.retype(context, fake_volume, fake_type, diff, host)) host = {'host': 'currenthost'} # no support for changing encryption diff['encryption'] = {'non-empty': 'non-empty'} self.assertFalse(self.driver.retype(context, fake_volume, fake_type, diff, host)) diff['encryption'] = {} # no support for changing extra_specs diff['extra_specs'] = {'non-empty': 'non-empty'} self.assertFalse(self.driver.retype(context, fake_volume, fake_type, diff, host)) diff['extra_specs'] = {} self.assertTrue(self.driver.retype(context, fake_volume, fake_type, diff, host)) def test_rbd_volume_proxy_init(self): mock_driver = mock.Mock(name='driver') mock_driver._connect_to_rados.return_value = (None, None) with driver.RBDVolumeProxy(mock_driver, self.volume_name): self.assertEqual(1, mock_driver._connect_to_rados.call_count) self.assertFalse(mock_driver._disconnect_from_rados.called) self.assertEqual(1, mock_driver._disconnect_from_rados.call_count) mock_driver.reset_mock() snap = u'snapshot-name' with driver.RBDVolumeProxy(mock_driver, self.volume_name, snapshot=snap): self.assertEqual(1, mock_driver._connect_to_rados.call_count) self.assertFalse(mock_driver._disconnect_from_rados.called) self.assertEqual(1, mock_driver._disconnect_from_rados.call_count) @common_mocks def test_connect_to_rados(self): # Default self.cfg.rados_connect_timeout = -1 self.mock_rados.Rados.return_value.open_ioctx.return_value = \ self.mock_rados.Rados.return_value.ioctx # default configured pool ret = self.driver._connect_to_rados() self.assertTrue(self.mock_rados.Rados.return_value.connect.called) # Expect no timeout if default is used self.mock_rados.Rados.return_value.connect.assert_called_once_with() self.assertTrue(self.mock_rados.Rados.return_value.open_ioctx.called) self.assertEqual(ret[1], self.mock_rados.Rados.return_value.ioctx) self.mock_rados.Rados.return_value.open_ioctx.assert_called_with( self.cfg.rbd_pool) # different pool ret = self.driver._connect_to_rados('alt_pool') self.assertTrue(self.mock_rados.Rados.return_value.connect.called) self.assertTrue(self.mock_rados.Rados.return_value.open_ioctx.called) self.assertEqual(ret[1], self.mock_rados.Rados.return_value.ioctx) self.mock_rados.Rados.return_value.open_ioctx.assert_called_with( 'alt_pool') # With timeout self.cfg.rados_connect_timeout = 1 self.mock_rados.Rados.return_value.connect.reset_mock() self.driver._connect_to_rados() self.mock_rados.Rados.return_value.connect.assert_called_once_with( timeout=1) # error self.mock_rados.Rados.return_value.open_ioctx.reset_mock() self.mock_rados.Rados.return_value.shutdown.reset_mock() self.mock_rados.Rados.return_value.open_ioctx.side_effect = ( self.mock_rados.Error) self.assertRaises(exception.VolumeBackendAPIException, self.driver._connect_to_rados) self.assertTrue(self.mock_rados.Rados.return_value.open_ioctx.called) self.mock_rados.Rados.return_value.shutdown.assert_called_once_with() class RBDImageIOWrapperTestCase(test.TestCase): def setUp(self): super(RBDImageIOWrapperTestCase, self).setUp() self.meta = mock.Mock() self.meta.user = 'mock_user' self.meta.conf = 'mock_conf' self.meta.pool = 'mock_pool' self.meta.image = mock.Mock() self.meta.image.read = mock.Mock() self.meta.image.write = mock.Mock() self.meta.image.size = mock.Mock() self.mock_rbd_wrapper = driver.RBDImageIOWrapper(self.meta) self.data_length = 1024 self.full_data = 'abcd' * 256 def test_init(self): self.assertEqual(self.mock_rbd_wrapper._rbd_meta, self.meta) self.assertEqual(self.mock_rbd_wrapper._offset, 0) def test_inc_offset(self): self.mock_rbd_wrapper._inc_offset(10) self.mock_rbd_wrapper._inc_offset(10) self.assertEqual(self.mock_rbd_wrapper._offset, 20) def test_rbd_image(self): self.assertEqual(self.mock_rbd_wrapper.rbd_image, self.meta.image) def test_rbd_user(self): self.assertEqual(self.mock_rbd_wrapper.rbd_user, self.meta.user) def test_rbd_pool(self): self.assertEqual(self.mock_rbd_wrapper.rbd_conf, self.meta.conf) def test_rbd_conf(self): self.assertEqual(self.mock_rbd_wrapper.rbd_pool, self.meta.pool) def test_read(self): def mock_read(offset, length): return self.full_data[offset:length] self.meta.image.read.side_effect = mock_read self.meta.image.size.return_value = self.data_length data = self.mock_rbd_wrapper.read() self.assertEqual(data, self.full_data) data = self.mock_rbd_wrapper.read() self.assertEqual(data, '') self.mock_rbd_wrapper.seek(0) data = self.mock_rbd_wrapper.read() self.assertEqual(data, self.full_data) self.mock_rbd_wrapper.seek(0) data = self.mock_rbd_wrapper.read(10) self.assertEqual(data, self.full_data[:10]) def test_write(self): self.mock_rbd_wrapper.write(self.full_data) self.assertEqual(self.mock_rbd_wrapper._offset, 1024) def test_seekable(self): self.assertTrue(self.mock_rbd_wrapper.seekable) def test_seek(self): self.assertEqual(self.mock_rbd_wrapper._offset, 0) self.mock_rbd_wrapper.seek(10) self.assertEqual(self.mock_rbd_wrapper._offset, 10) self.mock_rbd_wrapper.seek(10) self.assertEqual(self.mock_rbd_wrapper._offset, 10) self.mock_rbd_wrapper.seek(10, 1) self.assertEqual(self.mock_rbd_wrapper._offset, 20) self.mock_rbd_wrapper.seek(0) self.mock_rbd_wrapper.write(self.full_data) self.meta.image.size.return_value = self.data_length self.mock_rbd_wrapper.seek(0) self.assertEqual(self.mock_rbd_wrapper._offset, 0) self.mock_rbd_wrapper.seek(10, 2) self.assertEqual(self.mock_rbd_wrapper._offset, self.data_length + 10) self.mock_rbd_wrapper.seek(-10, 2) self.assertEqual(self.mock_rbd_wrapper._offset, self.data_length - 10) # test exceptions. self.assertRaises(IOError, self.mock_rbd_wrapper.seek, 0, 3) self.assertRaises(IOError, self.mock_rbd_wrapper.seek, -1) # offset should not have been changed by any of the previous # operations. self.assertEqual(self.mock_rbd_wrapper._offset, self.data_length - 10) def test_tell(self): self.assertEqual(self.mock_rbd_wrapper.tell(), 0) self.mock_rbd_wrapper._inc_offset(10) self.assertEqual(self.mock_rbd_wrapper.tell(), 10) def test_flush(self): with mock.patch.object(driver, 'LOG') as mock_logger: self.meta.image.flush = mock.Mock() self.mock_rbd_wrapper.flush() self.meta.image.flush.assert_called_once_with() self.meta.image.flush.reset_mock() # this should be caught and logged silently. self.meta.image.flush.side_effect = AttributeError self.mock_rbd_wrapper.flush() self.meta.image.flush.assert_called_once_with() msg = _("flush() not supported in this version of librbd") mock_logger.warning.assert_called_with(msg) def test_fileno(self): self.assertRaises(IOError, self.mock_rbd_wrapper.fileno) def test_close(self): self.mock_rbd_wrapper.close() class ManagedRBDTestCase(test_volume.DriverTestCase): driver_name = "cinder.volume.drivers.rbd.RBDDriver" def setUp(self): super(ManagedRBDTestCase, self).setUp() # TODO(dosaboy): need to remove dependency on mox stubs here once # image.fake has been converted to mock. fake_image.stub_out_image_service(self.stubs) self.volume.driver.set_initialized() self.volume.stats = {'allocated_capacity_gb': 0, 'pools': {}} self.called = [] def _create_volume_from_image(self, expected_status, raw=False, clone_error=False): """Try to clone a volume from an image, and check the status afterwards. NOTE: if clone_error is True we force the image type to raw otherwise clone_image is not called """ volume_id = 1 # See tests.image.fake for image types. if raw: image_id = '155d900f-4e14-4e4c-a73d-069cbf4541e6' else: image_id = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77' # creating volume testdata db.volume_create(self.context, {'id': volume_id, 'updated_at': timeutils.utcnow(), 'display_description': 'Test Desc', 'size': 20, 'status': 'creating', 'instance_uuid': None, 'host': 'dummy'}) try: if not clone_error: self.volume.create_volume(self.context, volume_id, image_id=image_id) else: self.assertRaises(exception.CinderException, self.volume.create_volume, self.context, volume_id, image_id=image_id) volume = db.volume_get(self.context, volume_id) self.assertEqual(volume['status'], expected_status) finally: # cleanup db.volume_destroy(self.context, volume_id) def test_create_vol_from_image_status_available(self): """Clone raw image then verify volume is in available state.""" def _mock_clone_image(context, volume, image_location, image_meta, image_service): return {'provider_location': None}, True with mock.patch.object(self.volume.driver, 'clone_image') as \ mock_clone_image: mock_clone_image.side_effect = _mock_clone_image with mock.patch.object(self.volume.driver, 'create_volume') as \ mock_create: with mock.patch.object(create_volume.CreateVolumeFromSpecTask, '_copy_image_to_volume') as mock_copy: self._create_volume_from_image('available', raw=True) self.assertFalse(mock_copy.called) self.assertTrue(mock_clone_image.called) self.assertFalse(mock_create.called) def test_create_vol_from_non_raw_image_status_available(self): """Clone non-raw image then verify volume is in available state.""" def _mock_clone_image(context, volume, image_location, image_meta, image_service): return {'provider_location': None}, False with mock.patch.object(self.volume.driver, 'clone_image') as \ mock_clone_image: mock_clone_image.side_effect = _mock_clone_image with mock.patch.object(self.volume.driver, 'create_volume') as \ mock_create: with mock.patch.object(create_volume.CreateVolumeFromSpecTask, '_copy_image_to_volume') as mock_copy: self._create_volume_from_image('available', raw=False) self.assertTrue(mock_copy.called) self.assertTrue(mock_clone_image.called) self.assertTrue(mock_create.called) def test_create_vol_from_image_status_error(self): """Fail to clone raw image then verify volume is in error state.""" with mock.patch.object(self.volume.driver, 'clone_image') as \ mock_clone_image: mock_clone_image.side_effect = exception.CinderException with mock.patch.object(self.volume.driver, 'create_volume'): with mock.patch.object(create_volume.CreateVolumeFromSpecTask, '_copy_image_to_volume') as mock_copy: self._create_volume_from_image('error', raw=True, clone_error=True) self.assertFalse(mock_copy.called) self.assertTrue(mock_clone_image.called) self.assertFalse(self.volume.driver.create_volume.called) def test_clone_failure(self): driver = self.volume.driver with mock.patch.object(driver, '_is_cloneable', lambda *args: False): image_loc = (mock.Mock(), None) actual = driver.clone_image(mock.Mock(), mock.Mock(), image_loc, {}, mock.Mock()) self.assertEqual(({}, False), actual) self.assertEqual(({}, False), driver.clone_image('', object(), None, {}, '')) def test_clone_success(self): expected = ({'provider_location': None}, True) driver = self.volume.driver with mock.patch.object(self.volume.driver, '_is_cloneable') as \ mock_is_cloneable: mock_is_cloneable.return_value = True with mock.patch.object(self.volume.driver, '_clone') as \ mock_clone: with mock.patch.object(self.volume.driver, '_resize') as \ mock_resize: image_loc = ('rbd://fee/fi/fo/fum', None) volume = {'name': 'vol1'} actual = driver.clone_image(mock.Mock(), volume, image_loc, {'disk_format': 'raw', 'id': 'id.foo'}, mock.Mock()) self.assertEqual(expected, actual) mock_clone.assert_called_once_with(volume, 'fi', 'fo', 'fum') mock_resize.assert_called_once_with(volume) def test_clone_multilocation_success(self): expected = ({'provider_location': None}, True) driver = self.volume.driver def cloneable_side_effect(url_location, image_meta): return url_location == 'rbd://fee/fi/fo/fum' with mock.patch.object(self.volume.driver, '_is_cloneable') \ as mock_is_cloneable, \ mock.patch.object(self.volume.driver, '_clone') as mock_clone, \ mock.patch.object(self.volume.driver, '_resize') \ as mock_resize: mock_is_cloneable.side_effect = cloneable_side_effect image_loc = ('rbd://bee/bi/bo/bum', [{'url': 'rbd://bee/bi/bo/bum'}, {'url': 'rbd://fee/fi/fo/fum'}]) volume = {'name': 'vol1'} image_meta = mock.sentinel.image_meta image_service = mock.sentinel.image_service actual = driver.clone_image(self.context, volume, image_loc, image_meta, image_service) self.assertEqual(expected, actual) self.assertEqual(2, mock_is_cloneable.call_count) mock_clone.assert_called_once_with(volume, 'fi', 'fo', 'fum') mock_is_cloneable.assert_called_with('rbd://fee/fi/fo/fum', image_meta) mock_resize.assert_called_once_with(volume) def test_clone_multilocation_failure(self): expected = ({}, False) driver = self.volume.driver with mock.patch.object(driver, '_is_cloneable', return_value=False) \ as mock_is_cloneable, \ mock.patch.object(self.volume.driver, '_clone') as mock_clone, \ mock.patch.object(self.volume.driver, '_resize') \ as mock_resize: image_loc = ('rbd://bee/bi/bo/bum', [{'url': 'rbd://bee/bi/bo/bum'}, {'url': 'rbd://fee/fi/fo/fum'}]) volume = {'name': 'vol1'} image_meta = mock.sentinel.image_meta image_service = mock.sentinel.image_service actual = driver.clone_image(self.context, volume, image_loc, image_meta, image_service) self.assertEqual(expected, actual) self.assertEqual(2, mock_is_cloneable.call_count) mock_is_cloneable.assert_any_call('rbd://bee/bi/bo/bum', image_meta) mock_is_cloneable.assert_any_call('rbd://fee/fi/fo/fum', image_meta) self.assertFalse(mock_clone.called) self.assertFalse(mock_resize.called)
apache-2.0
-407,074,156,635,504,500
40.270936
79
0.555721
false
andMYhacks/infosec_mentors_project
app/config.py
1
1971
# project/config.py import os # from dotenv import load_dotenv, find_dotenv basedir = os.path.abspath(os.path.dirname(__file__)) # load_dotenv(find_dotenv()) class BaseConfig: # Base configuration SECRET_KEY = os.environ.get('APP_SECRET_KEY') PASSWORD_SALT = os.environ.get('APP_PASSWORD_SALT') DEBUG = False BCRYPT_LOG_ROUNDS = 13 WTF_CSRF_ENABLED = True DEBUG_TB_ENABLED = False DEBUG_TB_INTERCEPT_REDIRECTS = False # TODO: Switch Preferred URL Scheme # PREFERRED_URL_SCHEME = 'https' PREFERRED_URL_SCHEME = 'http' # mail settings MAIL_SERVER = 'smtp.gmail.com' MAIL_PORT = 587 MAIL_USE_TLS = True MAIL_USE_SSL = False # mail credentials MAIL_USERNAME = os.environ.get('APP_MAIL_USERNAME') MAIL_PASSWORD = os.environ.get('APP_MAIL_PASSWORD') # mail account(s) MAIL_DEFAULT_SENDER = os.environ.get('APP_MAIL_SENDER') # redis server CELERY_BROKER_URL = 'redis://localhost:6379/0' CELERY_RESULT_BACKEND = 'redis://localhost:6379/0' @staticmethod def init_app(app): pass class DevConfig(BaseConfig): # Development configuration DEBUG = True WTF_CSRF_ENABLED = False SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'database.sqlite') DEBUG_TB_ENABLED = True class ProdConfig(BaseConfig): # Production configuration DEBUG = False SESSION_COOKIE_SECURE = True SECRET_KEY = os.environ.get('APP_SECRET_KEY') DB_NAME = os.environ.get('APP_DB_NAME') DB_USER = os.environ.get('APP_DB_USER') DB_PASSWORD = os.environ.get('APP_DB_PASSWORD') SQLALCHEMY_DATABASE_URI = 'postgresql://' + DB_USER + ':' + DB_PASSWORD + '@localhost/' + DB_NAME DEBUG_TB_ENABLED = False STRIPE_SECRET_KEY = os.environ.get('APP_STRIPE_SECRET_KEY') STRIPE_PUBLISHABLE_KEY = os.environ.get('APP_PUBLISHABLE_KEY') config_type = { 'dev': DevConfig, 'prod': ProdConfig, 'defalt': DevConfig }
gpl-3.0
7,683,234,075,352,378,000
26
101
0.660071
false
gangadharkadam/vlinkfrappe
frappe/model/base_document.py
1
17661
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, sys from frappe import _ from frappe.utils import cint, flt, now, cstr, strip_html, getdate, get_datetime, to_timedelta from frappe.model import default_fields from frappe.model.naming import set_new_name from frappe.modules import load_doctype_module from frappe.model import display_fieldtypes _classes = {} def get_controller(doctype): """Returns the **class** object of the given DocType. For `custom` type, returns `frappe.model.document.Document`. :param doctype: DocType name as string.""" from frappe.model.document import Document if not doctype in _classes: module_name, custom = frappe.db.get_value("DocType", doctype, ["module", "custom"]) \ or ["Core", False] if custom: _class = Document else: module = load_doctype_module(doctype, module_name) classname = doctype.replace(" ", "").replace("-", "") if hasattr(module, classname): _class = getattr(module, classname) if issubclass(_class, BaseDocument): _class = getattr(module, classname) else: raise ImportError, doctype else: raise ImportError, doctype _classes[doctype] = _class return _classes[doctype] class BaseDocument(object): ignore_in_getter = ("doctype", "_meta", "meta", "_table_fields", "_valid_columns") def __init__(self, d): self.update(d) self.dont_update_if_missing = [] if hasattr(self, "__setup__"): self.__setup__() @property def meta(self): if not hasattr(self, "_meta"): self._meta = frappe.get_meta(self.doctype) return self._meta def update(self, d): if "doctype" in d: self.set("doctype", d.get("doctype")) # first set default field values of base document for key in default_fields: if key in d: self.set(key, d.get(key)) for key, value in d.iteritems(): self.set(key, value) return self def update_if_missing(self, d): if isinstance(d, BaseDocument): d = d.get_valid_dict() if "doctype" in d: self.set("doctype", d.get("doctype")) for key, value in d.iteritems(): # dont_update_if_missing is a list of fieldnames, for which, you don't want to set default value if (self.get(key) is None) and (value is not None) and (key not in self.dont_update_if_missing): self.set(key, value) def get_db_value(self, key): return frappe.db.get_value(self.doctype, self.name, key) def get(self, key=None, filters=None, limit=None, default=None): if key: if isinstance(key, dict): return _filter(self.get_all_children(), key, limit=limit) if filters: if isinstance(filters, dict): value = _filter(self.__dict__.get(key, []), filters, limit=limit) else: default = filters filters = None value = self.__dict__.get(key, default) else: value = self.__dict__.get(key, default) if value is None and key not in self.ignore_in_getter \ and key in (d.fieldname for d in self.meta.get_table_fields()): self.set(key, []) value = self.__dict__.get(key) return value else: return self.__dict__ def getone(self, key, filters=None): return self.get(key, filters=filters, limit=1)[0] def set(self, key, value, as_value=False): if isinstance(value, list) and not as_value: self.__dict__[key] = [] self.extend(key, value) else: self.__dict__[key] = value def delete_key(self, key): if key in self.__dict__: del self.__dict__[key] def append(self, key, value=None): if value==None: value={} if isinstance(value, (dict, BaseDocument)): if not self.__dict__.get(key): self.__dict__[key] = [] value = self._init_child(value, key) self.__dict__[key].append(value) # reference parent document value.parent_doc = self return value else: raise ValueError, "Document attached to child table must be a dict or BaseDocument, not " + str(type(value))[1:-1] def extend(self, key, value): if isinstance(value, list): for v in value: self.append(key, v) else: raise ValueError def remove(self, doc): self.get(doc.parentfield).remove(doc) def _init_child(self, value, key): if not self.doctype: return value if not isinstance(value, BaseDocument): if "doctype" not in value: value["doctype"] = self.get_table_field_doctype(key) if not value["doctype"]: raise AttributeError, key value = get_controller(value["doctype"])(value) value.init_valid_columns() value.parent = self.name value.parenttype = self.doctype value.parentfield = key if not getattr(value, "idx", None): value.idx = len(self.get(key) or []) + 1 if not getattr(value, "name", None): value.__dict__['__islocal'] = 1 return value def get_valid_dict(self): d = {} for fieldname in self.meta.get_valid_columns(): d[fieldname] = self.get(fieldname) if d[fieldname]=="": df = self.meta.get_field(fieldname) if df and df.fieldtype in ("Datetime", "Date"): d[fieldname] = None return d def init_valid_columns(self): for key in default_fields: if key not in self.__dict__: self.__dict__[key] = None for key in self.get_valid_columns(): if key not in self.__dict__: self.__dict__[key] = None def get_valid_columns(self): if self.doctype not in frappe.local.valid_columns: if self.doctype in ("DocField", "DocPerm") and self.parent in ("DocType", "DocField", "DocPerm"): from frappe.model.meta import get_table_columns valid = get_table_columns(self.doctype) else: valid = self.meta.get_valid_columns() frappe.local.valid_columns[self.doctype] = valid return frappe.local.valid_columns[self.doctype] def is_new(self): return self.get("__islocal") def as_dict(self, no_nulls=False, no_default_fields=False): doc = self.get_valid_dict() doc["doctype"] = self.doctype for df in self.meta.get_table_fields(): children = self.get(df.fieldname) or [] doc[df.fieldname] = [d.as_dict(no_nulls=no_nulls) for d in children] if no_nulls: for k in doc.keys(): if doc[k] is None: del doc[k] if no_default_fields: for k in doc.keys(): if k in default_fields: del doc[k] for key in ("_user_tags", "__islocal", "__onload", "_starred_by"): if self.get(key): doc[key] = self.get(key) return frappe._dict(doc) def as_json(self): return frappe.as_json(self.as_dict()) def get_table_field_doctype(self, fieldname): return self.meta.get_field(fieldname).options def get_parentfield_of_doctype(self, doctype): fieldname = [df.fieldname for df in self.meta.get_table_fields() if df.options==doctype] return fieldname[0] if fieldname else None def db_insert(self): """INSERT the document (with valid columns) in the database.""" if not self.name: # name will be set by document class in most cases set_new_name(self) d = self.get_valid_dict() columns = d.keys() try: frappe.db.sql("""insert into `tab{doctype}` ({columns}) values ({values})""".format( doctype = self.doctype, columns = ", ".join(["`"+c+"`" for c in columns]), values = ", ".join(["%s"] * len(columns)) ), d.values()) except Exception, e: if e.args[0]==1062 and "PRIMARY" in cstr(e.args[1]): if self.meta.autoname=="hash": # hash collision? try again self.name = None self.db_insert() return type, value, traceback = sys.exc_info() frappe.msgprint(_("Duplicate name {0} {1}").format(self.doctype, self.name)) raise frappe.NameError, (self.doctype, self.name, e), traceback else: raise self.set("__islocal", False) def db_update(self): if self.get("__islocal") or not self.name: self.db_insert() return d = self.get_valid_dict() columns = d.keys() try: frappe.db.sql("""update `tab{doctype}` set {values} where name=%s""".format( doctype = self.doctype, values = ", ".join(["`"+c+"`=%s" for c in columns]) ), d.values() + [d.get("name")]) except Exception, e: if e.args[0]==1062: type, value, traceback = sys.exc_info() fieldname = str(e).split("'")[-2] frappe.msgprint(_("{0} must be unique".format(self.meta.get_label(fieldname)))) raise frappe.ValidationError, (self.doctype, self.name, e), traceback else: raise def db_set(self, fieldname, value, update_modified=True): self.set(fieldname, value) self.set("modified", now()) self.set("modified_by", frappe.session.user) frappe.db.set_value(self.doctype, self.name, fieldname, value, self.modified, self.modified_by, update_modified=update_modified) def _fix_numeric_types(self): for df in self.meta.get("fields"): if df.fieldtype == "Check": self.set(df.fieldname, cint(self.get(df.fieldname))) elif self.get(df.fieldname) is not None: if df.fieldtype == "Int": self.set(df.fieldname, cint(self.get(df.fieldname))) elif df.fieldtype in ("Float", "Currency", "Percent"): self.set(df.fieldname, flt(self.get(df.fieldname))) if self.docstatus is not None: self.docstatus = cint(self.docstatus) def _get_missing_mandatory_fields(self): """Get mandatory fields that do not have any values""" def get_msg(df): if df.fieldtype == "Table": return "{}: {}: {}".format(_("Error"), _("Data missing in table"), _(df.label)) elif self.parentfield: return "{}: {} #{}: {}: {}".format(_("Error"), _("Row"), self.idx, _("Value missing for"), _(df.label)) else: return "{}: {}: {}".format(_("Error"), _("Value missing for"), _(df.label)) missing = [] for df in self.meta.get("fields", {"reqd": 1}): if self.get(df.fieldname) in (None, []) or not strip_html(cstr(self.get(df.fieldname))).strip(): missing.append((df.fieldname, get_msg(df))) return missing def get_invalid_links(self, is_submittable=False): def get_msg(df, docname): if self.parentfield: return "{} #{}: {}: {}".format(_("Row"), self.idx, _(df.label), docname) else: return "{}: {}".format(_(df.label), docname) invalid_links = [] cancelled_links = [] for df in self.meta.get_link_fields() + self.meta.get("fields", {"fieldtype":"Dynamic Link"}): docname = self.get(df.fieldname) if docname: if df.fieldtype=="Link": doctype = df.options if not doctype: frappe.throw(_("Options not set for link field {0}").format(df.fieldname)) else: doctype = self.get(df.options) if not doctype: frappe.throw(_("{0} must be set first").format(self.meta.get_label(df.options))) # MySQL is case insensitive. Preserve case of the original docname in the Link Field. value = frappe.db.get_value(doctype, docname, "name", cache=True) setattr(self, df.fieldname, value) if not value: invalid_links.append((df.fieldname, docname, get_msg(df, docname))) elif (df.fieldname != "amended_from" and (is_submittable or self.meta.is_submittable) and frappe.get_meta(doctype).is_submittable and cint(frappe.db.get_value(doctype, docname, "docstatus"))==2): cancelled_links.append((df.fieldname, docname, get_msg(df, docname))) return invalid_links, cancelled_links def _validate_selects(self): if frappe.flags.in_import: return for df in self.meta.get_select_fields(): if df.fieldname=="naming_series" or not (self.get(df.fieldname) and df.options): continue options = (df.options or "").split("\n") # if only empty options if not filter(None, options): continue # strip and set self.set(df.fieldname, cstr(self.get(df.fieldname)).strip()) value = self.get(df.fieldname) if value not in options and not (frappe.flags.in_test and value.startswith("_T-")): # show an elaborate message prefix = _("Row #{0}:").format(self.idx) if self.get("parentfield") else "" label = _(self.meta.get_label(df.fieldname)) comma_options = '", "'.join(_(each) for each in options) frappe.throw(_('{0} {1} cannot be "{2}". It should be one of "{3}"').format(prefix, label, value, comma_options)) def _validate_constants(self): if frappe.flags.in_import or self.is_new(): return constants = [d.fieldname for d in self.meta.get("fields", {"set_only_once": 1})] if constants: values = frappe.db.get_value(self.doctype, self.name, constants, as_dict=True) for fieldname in constants: if self.get(fieldname) != values.get(fieldname): frappe.throw(_("Value cannot be changed for {0}").format(self.meta.get_label(fieldname)), frappe.CannotChangeConstantError) def _validate_update_after_submit(self): db_values = frappe.db.get_value(self.doctype, self.name, "*", as_dict=True) for key, db_value in db_values.iteritems(): df = self.meta.get_field(key) if df and not df.allow_on_submit and (self.get(key) or db_value): self_value = self.get_value(key) if self_value != db_value: frappe.throw(_("Not allowed to change {0} after submission").format(df.label), frappe.UpdateAfterSubmitError) def precision(self, fieldname, parentfield=None): """Returns float precision for a particular field (or get global default). :param fieldname: Fieldname for which precision is required. :param parentfield: If fieldname is in child table.""" from frappe.model.meta import get_field_precision if parentfield and not isinstance(parentfield, basestring): parentfield = parentfield.parentfield cache_key = parentfield or "main" if not hasattr(self, "_precision"): self._precision = frappe._dict() if cache_key not in self._precision: self._precision[cache_key] = frappe._dict() if fieldname not in self._precision[cache_key]: self._precision[cache_key][fieldname] = None doctype = self.meta.get_field(parentfield).options if parentfield else self.doctype df = frappe.get_meta(doctype).get_field(fieldname) if df.fieldtype in ("Currency", "Float", "Percent"): self._precision[cache_key][fieldname] = get_field_precision(df, self) return self._precision[cache_key][fieldname] def get_formatted(self, fieldname, doc=None, currency=None): from frappe.utils.formatters import format_value df = self.meta.get_field(fieldname) if not df and fieldname in default_fields: from frappe.model.meta import get_default_df df = get_default_df(fieldname) return format_value(self.get(fieldname), df=df, doc=doc or self, currency=currency) def is_print_hide(self, fieldname, df=None, for_print=True): """Returns true if fieldname is to be hidden for print. Print Hide can be set via the Print Format Builder or in the controller as a list of hidden fields. Example class MyDoc(Document): def __setup__(self): self.print_hide = ["field1", "field2"] :param fieldname: Fieldname to be checked if hidden. """ meta_df = self.meta.get_field(fieldname) if meta_df and meta_df.get("__print_hide"): return True if df: return df.print_hide if meta_df: return meta_df.print_hide def in_format_data(self, fieldname): """Returns True if shown via Print Format::`format_data` property. Called from within standard print format.""" doc = getattr(self, "parent_doc", self) if hasattr(doc, "format_data_map"): return fieldname in doc.format_data_map else: return True def reset_values_if_no_permlevel_access(self, has_access_to, high_permlevel_fields): """If the user does not have permissions at permlevel > 0, then reset the values to original / default""" to_reset = [] for df in high_permlevel_fields: if df.permlevel not in has_access_to and df.fieldtype not in display_fieldtypes: to_reset.append(df) if to_reset: if self.is_new(): # if new, set default value ref_doc = frappe.new_doc(self.doctype) else: # get values from old doc if self.parent: self.parent_doc.get_latest() ref_doc = [d for d in self.parent_doc.get(self.parentfield) if d.name == self.name][0] else: ref_doc = self.get_latest() for df in to_reset: self.set(df.fieldname, ref_doc.get(df.fieldname)) def get_value(self, fieldname): df = self.meta.get_field(fieldname) val = self.get(fieldname) return self.cast(val, df) def cast(self, val, df): if df.fieldtype in ("Currency", "Float", "Percent"): val = flt(val, self.precision(df.fieldname)) elif df.fieldtype in ("Int", "Check"): val = cint(val) elif df.fieldtype in ("Data", "Text", "Small Text", "Long Text", "Text Editor", "Select", "Link", "Dynamic Link"): val = cstr(val) elif df.fieldtype == "Date": val = getdate(val) elif df.fieldtype == "Datetime": val = get_datetime(val) elif df.fieldtype == "Time": val = to_timedelta(val) return val def _extract_images_from_text_editor(self): from frappe.utils.file_manager import extract_images_from_doc if self.doctype != "DocType": for df in self.meta.get("fields", {"fieldtype":"Text Editor"}): extract_images_from_doc(self, df.fieldname) def _filter(data, filters, limit=None): """pass filters as: {"key": "val", "key": ["!=", "val"], "key": ["in", "val"], "key": ["not in", "val"], "key": "^val", "key" : True (exists), "key": False (does not exist) }""" out = [] for d in data: add = True for f in filters: fval = filters[f] if fval is True: fval = ("not None", fval) elif fval is False: fval = ("None", fval) elif not isinstance(fval, (tuple, list)): if isinstance(fval, basestring) and fval.startswith("^"): fval = ("^", fval[1:]) else: fval = ("=", fval) if not frappe.compare(getattr(d, f, None), fval[0], fval[1]): add = False break if add: out.append(d) if limit and (len(out)-1)==limit: break return out
mit
-4,082,703,577,335,195,600
29.189744
117
0.658173
false
aferrugento/SemLDA
wsd.py
1
15115
from pywsd.lesk import adapted_lesk from nltk.corpus import wordnet as wn import pickle import time import sys def main(file_name): start = time.time() #string = '/home/adriana/Dropbox/mine/Tese/preprocessing/data_output/' #string = '/home/aferrugento/Desktop/' string = '' h = open(string + file_name + '_proc.txt') sentences = h.read() h.close() extra_synsets = {} sentences = sentences.split("\n") for i in range(len(sentences)): sentences[i] = sentences[i].split(" ") for j in range(len(sentences[i])): if sentences[i][j] == '': continue sentences[i][j] = sentences[i][j].split("_")[0] for i in range(len(sentences)): aux = '' for j in range(len(sentences[i])): aux += sentences[i][j] + ' ' sentences[i] = aux word_count = pickle.load(open('word_count_new.p')) synset_count = pickle.load(open('synset_count.p')) word_count_corpus = calculate_word_frequency(sentences) sum_word_corpus = 0 for key in word_count_corpus.keys(): sum_word_corpus += word_count_corpus.get(key) sum_word = 0 for key in word_count.keys(): sum_word += word_count.get(key) sum_synset = 0 for key in synset_count.keys(): sum_synset += synset_count.get(key) word_list = [] for key in word_count.keys(): word_list.append(word_count.get(key)) synset_list = [] for key in synset_count.keys(): synset_list.append(synset_count.get(key)) word_list.sort() synset_list.sort() #print len(word_list), len(synset_list) #print len(word_list)/2., len(synset_list)/2., (len(word_list)/2.) -1, (len(synset_list)/2.) -1 #print word_list[len(word_list)/2], word_list[(len(word_list)/2)-1] #print synset_list[len(synset_list)/2], synset_list[(len(synset_list)/2)-1] word_median = round(2./sum_word, 5) synset_median = round(2./sum_synset, 5) #print word_median, synset_median #print sum_word, sum_synset #return #f = open(string + 'preprocess_semLDA_EPIA/NEWS2_snowballstopword_wordnetlemma_pos_freq.txt') f = open(string + file_name +'_freq.txt') m = f.read() f.close() m = m.split("\n") for i in range(len(m)): m[i] = m[i].split(" ") count = 0 imag = -1 #f = open(string + 'preprocess_semLDA_EPIA/znew_eta_NEWS2.txt') f = open(string + file_name + '_eta.txt') g = f.read() f.close() g = g.split("\n") for i in range(len(g)): g[i] = g[i].split(" ") dic_g = create_dicio(g) g = open(string + file_name +'_wsd.txt','w') #dictio = pickle.load(open(string + 'preprocess_semLDA_EPIA/NEWS2_snowballstopword_wordnetlemma_pos_vocab.p')) dictio = pickle.load(open(string + file_name +'_vocab.p')) nn = open(string + file_name +'_synsetVoc.txt','w') synsets = {} to_write = [] p = open(string + 'NEWS2_wsd.log','w') for i in range(len(m)): nana = str(m[i][0]) + ' ' print 'Doc ' + str(i) p.write('---------- DOC ' +str(i) + ' ----------\n') #words_probs = bayes_theorem(sentences[i], dictio, word_count, sum_word, word_median) #return #g.write(str(m[i][0]) + ' ') for k in range(1, len(m[i])): #print sentences[i] if m[i][k] == '': continue #print dictio.get(int(m[i][k].split(":")[0])) + str(m[i][k].split(":")[0]) #print wn.synsets(dictio.get(int(m[i][k].split(":")[0])).split("_")[0], penn_to_wn(dictio.get(int(m[i][k].split(":")[0])).split("_")[1])) #caso nao existam synsets para aquela palavra if len(wn.synsets(dictio.get(int(m[i][k].split(":")[0])).split("_")[0], penn_to_wn(dictio.get(int(m[i][k].split(":")[0])).split("_")[1]))) == 0: nana += m[i][k]+":1[" +str(count)+":"+str(1)+"] " synsets[imag] = count extra_synsets[imag] = dictio.get(int(m[i][k].split(":")[0])) #g.write(m[i][k]+":1[" +str(imag)+":"+str(1)+"] ") imag -= 1 count += 1 continue sent = sentences[i] ambiguous = dictio.get(int(m[i][k].split(":")[0])).split("_")[0] post = dictio.get(int(m[i][k].split(":")[0])).split("_")[1] try: answer = adapted_lesk(sent, ambiguous, pos= penn_to_wn(post), nbest=True) except Exception, e: #caso o lesk se arme em estupido s = wn.synsets(dictio.get(int(m[i][k].split(":")[0])).split("_")[0], penn_to_wn(dictio.get(int(m[i][k].split(":")[0])).split("_")[1])) if len(s) != 0: count2 = 0 #ver quantos synsets existem no semcor #for n in range(len(s)): # if dic_g.has_key(str(s[n].offset)): # words = dic_g.get(str(s[n].offset)) # for j in range(len(words)): # if words[j].split(":")[0] == m[i][k].split(":")[0]: # count2 += 1 # se nao existir nenhum criar synset imaginario #if count2 == 0: # nana += m[i][k]+":1[" +str(count)+":"+str(1)+"] " # synsets[imag] = count # extra_synsets[imag] = dictio.get(int(m[i][k].split(":")[0])) #g.write(m[i][k]+":1[" +str(imag)+":"+str(1)+"] ") # count += 1 # imag -= 1 # continue #caso existam ir buscar as suas probabilidades ao semcor nana += m[i][k] +':'+ str(len(s)) + '[' c = 1 prob = 1.0/len(s) for n in range(len(s)): #print answer[n][1].offset #print 'Coco ' + str(s[n].offset) #if dic_g.has_key(str(s[n].offset)): #words = dic_g.get(str(s[n].offset)) #for j in range(len(words)): # if words[j].split(":")[0] == m[i][k].split(":")[0]: # aux = 0 a = (s[n].offset()) #print s[n].offset() if synsets.has_key(a): aux = synsets.get(a) else: synsets[a] = count aux = count count += 1 if n == len(s) - 1: nana += str(aux) + ':' + str(prob) + '] ' else: nana += str(aux) + ':' + str(prob) + ' ' else: nana += m[i][k]+":1[" +str(count)+":"+str(1)+"] " synsets[imag] = count extra_synsets[imag] = dictio.get(int(m[i][k].split(":")[0])) #g.write(m[i][k]+":1[" +str(imag)+":"+str(1)+"] ") count += 1 imag -= 1 continue #g.write(m[i][k] +':'+ str(len(answer)) + '[') total = 0 for j in range(len(answer)): total += answer[j][0] #caso lesk nao devolva nenhuma resposta criar synset imaginario if len(answer) == 0: nana += m[i][k]+":1[" +str(count)+":"+str(1)+"] " synsets[imag] = count extra_synsets[imag] = dictio.get(int(m[i][k].split(":")[0])) #g.write(m[i][k]+":1[" +str(imag)+":"+str(1)+"] ") count += 1 imag -= 1 continue #print ambiguous #print total #print answer #caso nenhum dos synsets tenha overlap ir ver ao semcor as suas probabilidades if total == 0: #print 'ZERO' count2 = 0 #for n in range(len(answer)): # if dic_g.has_key(str(answer[n][1].offset)): # words = dic_g.get(str(answer[n][1].offset)) # for j in range(len(words)): # if words[j].split(":")[0] == m[i][k].split(":")[0]: # count2 += 1 #if count2 == 0: # nana += m[i][k]+":1[" +str(count)+":"+str(1)+"] " # synsets[imag] = count # extra_synsets[imag] = dictio.get(int(m[i][k].split(":")[0])) #g.write(m[i][k]+":1[" +str(imag)+":"+str(1)+"] ") # count += 1 # imag -= 1 # continue s = wn.synsets(dictio.get(int(m[i][k].split(":")[0])).split("_")[0], penn_to_wn(dictio.get(int(m[i][k].split(":")[0])).split("_")[1])) nana += m[i][k] +':'+ str(len(s)) + '[' c = 1 prob = 1.0/len(s) for n in range(len(s)): #print answer[n][1].offset #print 'Coco ' + str(s[n].offset) #if dic_g.has_key(str(s[n].offset)): #words = dic_g.get(str(s[n].offset)) #for j in range(len(words)): # if words[j].split(":")[0] == m[i][k].split(":")[0]: # aux = 0 a = (s[n].offset()) #print s[n].offset() if synsets.has_key(a): aux = synsets.get(a) else: synsets[a] = count aux = count count += 1 if n == len(s) - 1: nana += str(aux) + ':' + str(prob) + '] ' else: nana += str(aux) + ':' + str(prob) + ' ' #print nana continue #contar quantos synsets e que nao estao a zero count2 = 0 for j in range(len(answer)): if answer[j][0] == 0: continue else: count2 += 1 c = 1 nana += m[i][k] +':'+ str(count2) + '[' for j in range(len(answer)): #words_synsets = words_probs.get(int(m[i][k].split(':')[0])) #s.write(answer[j][1].offset+"\n") if answer[j][0] == 0: continue aux = 0 a = (answer[j][1].offset()) #print 'Coco '+ str(answer[j][1].offset()) if synsets.has_key(a): aux = synsets.get(a) else: synsets[a] = count aux = count count += 1 prob_s = 0.0 prob_w = 0.0 prob_s_w = float(answer[j][0])/total #if synset_count.has_key(str(answer[j][1].offset)): # prob_s = synset_count.get(str(answer[j][1].offset))/float(sum_synset) #else: # prob_s = 0.1 prob_s_s = 1.0/count2 #if word_count.has_key(dictio.get(int(m[i][k].split(":")[0]))): # prob_w = word_count.get(dictio.get(int(m[i][k].split(":")[0])))/float(sum_word) #else: # prob_w = 0.1 if word_count_corpus.has_key(dictio.get(int(m[i][k].split(":")[0])).split("_")[0]): prob_w = word_count_corpus.get(dictio.get(int(m[i][k].split(":")[0])).split("_")[0])/float(sum_word_corpus) else: prob_w = 0.1 prob_w_s = (prob_w * prob_s_w) / prob_s_s if j == len(answer) - 1 or count2 == c: if prob_w_s > 1.0: #print 'Word: 'dictio.get(int(m[i][k].split(":")[0])) + ' Synset: ' + str(answer[j][1]) p.write('Word: '+ dictio.get(int(m[i][k].split(":")[0])) + ' Synset: ' + str(answer[j][1])) #print 'Synsets disambiguated: ' + str(answer) p.write('---- Synsets disambiguated: ' + str(answer)) #print synset_count.get(str(answer[j][1].offset)), word_count.get(dictio.get(int(m[i][k].split(":")[0]))), sum_synset, sum_word #print 'P(s)=' +prob_s +', P(w)='+prob_w +', P(s|w)='+ prob_s_w +', P(w|s)='+ prob_w_s p.write('---- P(s)=' +str(prob_s) +', P(w)='+ str(prob_w) +', P(s|w)='+ str(prob_s_w) +', P(w|s)='+ str(prob_w_s)) p.write("\n") nana += str(aux) + ':' + str(1) + '] ' #nana += str(aux) + ':' + str(words_synsets.get(answer[j][1].offset)) + '] ' else: nana += str(aux) + ':' + str(prob_w_s) + '] ' #g.write(str(aux) + ':' + str(float(answer[j][0]/total)) + '] ') else: c += 1 if prob_w_s > 1.0: #print 'Word: 'dictio.get(int(m[i][k].split(":")[0])) + ' Synset: ' + str(answer[j][1]) p.write('Word: '+ dictio.get(int(m[i][k].split(":")[0])) + ' Synset: ' + str(answer[j][1])) #print 'Synsets disambiguated: ' + str(answer) p.write('---- Synsets disambiguated: ' + str(answer)) #print synset_count.get(str(answer[j][1].offset)), word_count.get(dictio.get(int(m[i][k].split(":")[0]))), sum_synset, sum_word #print 'P(s)=' +prob_s +', P(w)='+prob_w +', P(s|w)='+ prob_s_w +', P(w|s)='+ prob_w_s p.write('---- P(s)=' +str(prob_s) +', P(w)='+ str(prob_w) +', P(s|w)='+ str(prob_s_w) +', P(w|s)='+ str(prob_w_s)) p.write("\n") nana += str(aux) + ':' + str(1) + '] ' #nana += str(aux) + ':' + str(words_synsets.get(answer[j][1].offset)) +' ' else: nana += str(aux) + ':' + str(prob_w_s) +' ' #g.write(str(aux) + ':' + str(float(answer[j][0]/total)) +' ') nana += '\n' #print nana #return to_write.append(nana) #g.write("\n") ne = revert_dicio(synsets) for i in range(len(ne)): #print ne.get(i), type(ne.get(i)) nn.write(str(ne.get(i))+'\n') g.write(str(len(ne))+"\n") for i in range(len(to_write)): g.write(to_write[i]) nn.close() p.close() g.close() end = time.time() pickle.dump(extra_synsets, open(string + file_name +"_imag.p","w")) print end - start def calculate_word_frequency(corpus): word_count_dict = {} for i in range(len(corpus)): for j in range(len(corpus[i])): if word_count_dict.has_key(corpus[i][j]): aux = word_count_dict.get(corpus[i][j]) word_count_dict[corpus[i][j]] = aux + 1 else: word_count_dict[corpus[i][j]] = 1 return word_count_dict #bayes_theorem(sentences[i], dictio, synset_count, word_count, sum_synset, sum_word, synset_median, word_median) def bayes_theorem(context, vocab, word_count, sum_word, word_median): words_probs = {} print len(vocab) count = 0 for word in vocab: if count%1000 == 0: print 'word ' + str(count) count += 1 sent = context ambiguous = vocab.get(word).split("_")[0] post = vocab.get(word).split("_")[1] #print ambiguous, post try: answer = adapted_lesk(sent, ambiguous, pos= penn_to_wn(post), nbest=True) except Exception, e: continue total = 0 for j in range(len(answer)): total += answer[j][0] if total == 0: continue for j in range(len(answer)): if answer[j][0] == 0: continue prob_w = 0.0 prob_s_w = float(answer[j][0])/total if word_count.has_key(vocab.get(word)): prob_w = word_count.get(vocab.get(word))/float(sum_word) else: prob_w = word_median prob_w_s = prob_s_w * prob_w if words_probs.has_key(word): aux = words_probs.get(word) aux[int(answer[j][1].offset)] = prob_w_s words_probs[word] = aux else: aux = {} aux[int(answer[j][1].offset)] = prob_w_s words_probs[word] = aux #print words_probs synsets_probs = {} for word in words_probs: for synset in words_probs.get(word): if synsets_probs.has_key(synset): aux = synsets_probs.get(synset) aux[word] = words_probs.get(word).get(synset) synsets_probs[synset] = aux else: aux = {} aux[word] = words_probs.get(word).get(synset) synsets_probs[synset] = aux for synset in synsets_probs: sum_words = 0.0 for word in synsets_probs.get(synset): sum_words += synsets_probs.get(synset).get(word) for word in synsets_probs.get(synset): aux = synsets_probs.get(synset).get(word) synsets_probs.get(synset)[word] = float(aux)/sum_words new_word_probs = {} for word in synsets_probs: for synset in synsets_probs.get(word): if new_word_probs.has_key(synset): aux = new_word_probs.get(synset) aux[word] = synsets_probs.get(word).get(synset) new_word_probs[synset] = aux else: aux = {} aux[word] = synsets_probs.get(word).get(synset) new_word_probs[synset] = aux return new_word_probs def create_dicio(eta): dictio = {} for i in range(len(eta)-1): for j in range(2, len(eta[i])): if dictio.has_key(eta[i][0]): aux = dictio.get(eta[i][0]) aux.append(eta[i][j]) dictio[eta[i][0]] = aux else: aux = [] aux.append(eta[i][j]) dictio[eta[i][0]] = aux return dictio def revert_dicio(words_ids): new_dictio = {} for key in words_ids: new_dictio[words_ids[key]] = key return new_dictio def is_noun(tag): return tag in ['NN', 'NNS', 'NNP', 'NNPS'] def is_verb(tag): return tag in ['VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ'] def is_adverb(tag): return tag in ['RB', 'RBR', 'RBS'] def is_adjective(tag): return tag in ['JJ', 'JJR', 'JJS'] def penn_to_wn(tag): if is_adjective(tag): return wn.ADJ elif is_noun(tag): return wn.NOUN elif is_adverb(tag): return wn.ADV elif is_verb(tag): return wn.VERB return None if __name__ == "__main__": main(sys.argv[1])
lgpl-2.1
8,973,805,166,957,558,000
30.100823
147
0.557327
false
akirk/youtube-dl
youtube_dl/extractor/dreisat.py
1
3607
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unified_strdate, determine_ext, ) class DreiSatIE(InfoExtractor): IE_NAME = '3sat' _VALID_URL = r'(?:http://)?(?:www\.)?3sat\.de/mediathek/(?:index\.php|mediathek\.php)?\?(?:(?:mode|display)=[^&]+&)*obj=(?P<id>[0-9]+)$' _TESTS = [ { 'url': 'http://www.3sat.de/mediathek/index.php?mode=play&obj=45918', 'md5': 'be37228896d30a88f315b638900a026e', 'info_dict': { 'id': '45918', 'ext': 'mp4', 'title': 'Waidmannsheil', 'description': 'md5:cce00ca1d70e21425e72c86a98a56817', 'uploader': '3sat', 'upload_date': '20140913' } }, { 'url': 'http://www.3sat.de/mediathek/mediathek.php?mode=play&obj=51066', 'only_matching': True, }, ] def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') details_url = 'http://www.3sat.de/mediathek/xmlservice/web/beitragsDetails?ak=web&id=%s' % video_id details_doc = self._download_xml(details_url, video_id, 'Downloading video details') status_code = details_doc.find('./status/statuscode') if status_code is not None and status_code.text != 'ok': code = status_code.text if code == 'notVisibleAnymore': message = 'Video %s is not available' % video_id else: message = '%s returned error: %s' % (self.IE_NAME, code) raise ExtractorError(message, expected=True) thumbnail_els = details_doc.findall('.//teaserimage') thumbnails = [{ 'width': int(te.attrib['key'].partition('x')[0]), 'height': int(te.attrib['key'].partition('x')[2]), 'url': te.text, } for te in thumbnail_els] information_el = details_doc.find('.//information') video_title = information_el.find('./title').text video_description = information_el.find('./detail').text details_el = details_doc.find('.//details') video_uploader = details_el.find('./channel').text upload_date = unified_strdate(details_el.find('./airtime').text) format_els = details_doc.findall('.//formitaet') formats = [] for fe in format_els: if fe.find('./url').text.startswith('http://www.metafilegenerator.de/'): continue url = fe.find('./url').text # ext = determine_ext(url, None) # if ext == 'meta': # doc = self._download_xml(url, video_id, 'Getting rtmp URL') # url = doc.find('./default-stream-url').text formats.append({ 'format_id': fe.attrib['basetype'], 'width': int(fe.find('./width').text), 'height': int(fe.find('./height').text), 'url': url, 'filesize': int(fe.find('./filesize').text), 'video_bitrate': int(fe.find('./videoBitrate').text), }) self._sort_formats(formats) return { '_type': 'video', 'id': video_id, 'title': video_title, 'formats': formats, 'description': video_description, 'thumbnails': thumbnails, 'thumbnail': thumbnails[-1]['url'], 'uploader': video_uploader, 'upload_date': upload_date, }
unlicense
-2,878,699,225,443,779,000
35.806122
140
0.524258
false
svr93/node-gyp
gyp/pylib/gyp/easy_xml.py
1
4891
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. Visual Studio files have a lot of pre-defined structures. This function makes it easy to represent these structures as Python data structures, instead of having to create a lot of function calls. Each XML element of the content is represented as a list composed of: 1. The name of the element, a string, 2. The attributes of the element, a dictionary (optional), and 3+. The content of the element, if any. Strings are simple text nodes and lists are child elements. Example 1: <test/> becomes ['test'] Example 2: <myelement a='value1' b='value2'> <childtype>This is</childtype> <childtype>it!</childtype> </myelement> becomes ['myelement', {'a':'value1', 'b':'value2'}, ['childtype', 'This is'], ['childtype', 'it!'], ] Args: content: The structured content to be converted. encoding: The encoding to report on the first XML line. pretty: True if we want pretty printing with indents and new lines. Returns: The XML content as a string. """ # We create a huge list of all the elements of the file. xml_parts = ['<?xml version="1.0" encoding="%s"?>' % encoding] if pretty: xml_parts.append('\n') _ConstructContentList(xml_parts, content, pretty) # Convert it to a string return ''.join(xml_parts) def _ConstructContentList(xml_parts, specification, pretty, level=0): """ Appends the XML parts corresponding to the specification. Args: xml_parts: A list of XML parts to be appended to. specification: The specification of the element. See EasyXml docs. pretty: True if we want pretty printing with indents and new lines. level: Indentation level. """ # The first item in a specification is the name of the element. if pretty: indentation = ' ' * level new_line = '\n' else: indentation = '' new_line = '' name = specification[0] if not isinstance(name, str): raise Exception('The first item of an EasyXml specification should be ' 'a string. Specification was ' + str(specification)) xml_parts.append(indentation + '<' + name) # Optionally in second position is a dictionary of the attributes. rest = specification[1:] if rest and isinstance(rest[0], dict): for at, val in sorted(rest[0].iteritems()): xml_parts.append(' %s="%s"' % (at, _XmlEscape(val, attr=True))) rest = rest[1:] if rest: xml_parts.append('>') all_strings = reduce(lambda x, y: x and isinstance(y, str), rest, True) multi_line = not all_strings if multi_line and new_line: xml_parts.append(new_line) for child_spec in rest: # If it's a string, append a text node. # Otherwise recurse over that child definition if isinstance(child_spec, str): xml_parts.append(_XmlEscape(child_spec)) else: _ConstructContentList(xml_parts, child_spec, pretty, level + 1) if multi_line and indentation: xml_parts.append(indentation) xml_parts.append('</%s>%s' % (name, new_line)) else: xml_parts.append('/>%s' % new_line) def WriteXmlIfChanged(content, path, encoding='utf-8', pretty=False, win32=False): """ Writes the XML content to disk, touching the file only if it has changed. Args: content: The structured content to be written. path: Location of the file. encoding: The encoding to report on the first line of the XML file. pretty: True if we want pretty printing with indents and new lines. """ xml_string = XmlToString(content, encoding, pretty) if win32 and os.linesep != '\r\n': xml_string = xml_string.replace('\n', '\r\n') # Fix encoding xml_string = unicode(xml_string, 'Windows-1251').encode(encoding) # Get the old content try: f = open(path, 'r') existing = f.read() f.close() except: existing = None # It has changed, write it if existing != xml_string: f = open(path, 'w') f.write(xml_string) f.close() _xml_escape_map = { '"': '&quot;', "'": '&apos;', '<': '&lt;', '>': '&gt;', '&': '&amp;', '\n': '&#xA;', '\r': '&#xD;', } _xml_escape_re = re.compile( "(%s)" % "|".join(map(re.escape, _xml_escape_map.keys()))) def _XmlEscape(value, attr=False): """ Escape a string for inclusion in XML.""" def replace(match): m = match.string[match.start() : match.end()] # don't replace single quotes in attrs if attr and m == "'": return m return _xml_escape_map[m] return _xml_escape_re.sub(replace, value)
mit
-6,326,042,995,111,190,000
29.56875
80
0.639951
false
simphony/simphony-remote
jupyterhub/remoteappmanager_config.py
1
2462
# # -------------------- # # Docker configuration # # -------------------- # # # # Configuration options for connecting to the docker machine. # # These options override the default provided by the local environment # # variables. # # # # The endpoint of the docker machine, specified as a URL. # # By default, it is obtained by DOCKER_HOST envvar. On Linux in a vanilla # # install, the connection uses a unix socket by default. # # docker_host = "tcp://192.168.99.100:2376" # # Docker realm is used to identify the containers that are managed by this # # particular instance of simphony-remote. It will be the first entry in # # the container name, and will also be added as part of a run-time container # # label. You generally should not change this unless you have multiple # # installations of simphony-remote all using the same docker host. # # docker_realm = "whatever" # # # TLS configuration # # ----------------- # # # # Set this to True to enable TLS connection with the docker client # # tls = True # # # Enables verification of the certificates. By default, this is the # # result of the DOCKER_TLS_VERIFY envvar. Set to False to skip verification/ # # tls_verify = True # # # Full paths of the CA certificate, certificate and key of the docker # # machine. Normally these are computed from the DOCKER_CERT_PATH. # # If you want to use a recognised CA for verification, set the tls_ca to # # an empty string # # tls_ca = "/path/to/ca.pem" # tls_cert = "/path/to/cert.pem" # tls_key = "/path/to/key.pem" # # # ---------- # # Accounting # # ---------- # # Notes on os.path: # # 1. When running with system-user mode, both the current directory and '~' # # are the system user's home directory. # # 2. When running in virtual-user mode, the current directory is the # # directory where jupyterhub is started, '~' would be evaluated according to # # the spawned process's owner's home directory (not the virtual user's # # home directory) # # # CSV database support # # database_class = "remoteappmanager.db.csv_db.CSVDatabase" # database_kwargs = { # "csv_file_path": os.path.abspath("./remoteappmanager.csv")} # # # Sqlite database support # # database_class = "remoteappmanager.db.orm.ORMDatabase" # database_kwargs = { # "url": "sqlite:///"+os.path.abspath('./remoteappmanager.db')} # # ---------------- # # Google Analytics # # ---------------- # # Put your tracking id from Google Analytics here. # ga_tracking_id = "UA-XXXXXX-X"
bsd-3-clause
-61,252,048,939,831,944
33.676056
79
0.672624
false
jolid/script.module.donnie
lib/donnie/tvrelease.py
1
4966
import urllib2, urllib, sys, os, re, random, copy from BeautifulSoup import BeautifulSoup, Tag, NavigableString import xbmc,xbmcplugin,xbmcgui,xbmcaddon from t0mm0.common.net import Net from t0mm0.common.addon import Addon from scrapers import CommonScraper net = Net() try: import json except: # pre-frodo and python 2.4 import simplejson as json ''' ########################################################### Usage and helper functions ############################################################''' class TVReleaseServiceSracper(CommonScraper): def __init__(self, settingsid, DB=None, REG=None): if DB: self.DB=DB if REG: self.REG=REG self.addon_id = 'script.module.donnie' self.service='tvrelease' self.name = 'tv-release.net' self.raiseError = False self.referrer = 'http://tv-release.net/' self.base_url = 'http://tv-release.net/' self.user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' self.provides = [] self.settingsid = settingsid self._loadsettings() self.settings_addon = self.addon def _getShows(self, silent=False): self.log('Do Nothing here') def _getRecentShows(self, silent=False): self.log('Do Nothing here') def _getEpisodes(self, showid, show, url, pDialog, percent, silent): self.log('Do Nothing here') def _getMovies(self, silent=False): self.log('Do Nothing here') def _getRecentMovies(self, silent): self.log('Do Nothing here') def _getStreams(self, episodeid=None, movieid=None): query = "" if episodeid: row = self.DB.query("SELECT rw_shows.showname, season, episode FROM rw_episodes JOIN rw_shows ON rw_shows.showid=rw_episodes.showid WHERE episodeid=?", [episodeid]) name = row[0].replace("'", "") if re.search('\\(\\d\\d\\d\\d\\)$', row[0]): name = name[0:len(name)-7] season = row[1].zfill(2) episode = row[2] #query = str("%s S%sE%s" % (name, season, episode)) uri = "" elif movieid: row = self.DB.query("SELECT movie, year FROM rw_movies WHERE imdb=? LIMIT 1", [movieid]) movie = self.cleanQuery(row[0]) query = "%s %s" %(movie, row[1]) '''streams = [] url = "%splugins/metasearch" % self.base_url params = {"type": "video", "filter": "cached", "api_key": api_key, "q": query} pagedata = net.http_POST(url, params).content if pagedata=='': return False data = json.loads(pagedata) try: files = data['files'] for f in files: if f['type'] == 'video': raw_url = f['id'] name = f['name'] size = int(f['size']) / (1024 * 1024) if size > 2000: size = size / 1024 unit = 'GB' else : unit = 'MB' self.getStreamByPriority('Furk - %s ([COLOR blue]%s %s[/COLOR])' %(name, size, unit), self.service + '://' + raw_url) except: pass self.DB.commit()''' def getStreamByPriority(self, link, stream): self.log(link) host = 'tv-release.net' SQL = "INSERT INTO rw_stream_list(stream, url, priority, machineid) " \ "SELECT ?, ?, priority, ? " \ "FROM rw_providers " \ "WHERE mirror=? and provider=?" self.DB.execute(SQL, [link, stream, self.REG.getSetting('machine-id'), host, self.service]) def _getServicePriority(self, link): self.log(link) host = 'tv-release.net' row = self.DB.query("SELECT priority FROM rw_providers WHERE mirror=? and provider=?", [host, self.service]) return row[0] def _resolveStream(self, stream): raw_url = stream.replace(self.service + '://', '') resolved_url = '' t_files = [] t_options = [] sdialog = xbmcgui.Dialog() api_key = self._getKey() params = {"type": "video", "id": raw_url, "api_key": api_key, 't_files': 1} url = "%sfile/get" % self.base_url pagedata = net.http_POST(url, params).content if pagedata=='': return False #print pagedata data = json.loads(str(pagedata)) try: files = data['files'][0]['t_files'] for f in files: if re.search('^video/', f['ct']): size = int(f['size']) / (1024 * 1024) if size > 2000: size = size / 1024 unit = 'GB' else : unit = 'MB' t_files.append("%s ([COLOR blue]%s %s[/COLOR])" %(f['name'], size, unit)) t_options.append(f['url_dl']) file_select = sdialog.select('Select Furk Stream', t_files) if file_select < 0: return resolved_url resolved_url = str(t_options[file_select]) except: pass self.log("Furk retruned: %s", resolved_url, level=0) return resolved_url def _resolveIMDB(self, uri): #Often needed if a sites movie index does not include imdb links but the movie page does imdb = '' print uri pagedata = self.getURL(uri, append_base_url=True) if pagedata=='': return imdb = re.search('http://www.imdb.com/title/(.+?)/', pagedata).group(1) return imdb def whichHost(self, host): #Sometimes needed table = { 'Watch Blah' : 'blah.com', 'Watch Blah2' : 'blah2.com', } try: host_url = table[host] return host_url except: return 'Unknown'
gpl-2.0
6,514,483,047,913,878,000
27.872093
167
0.620217
false
sobjornstad/esc
tests/esc/test_helpme.py
1
3706
""" Tests for the on-line help system. """ from decimal import Decimal import pytest from esc import builtin_stubs from esc import display from esc import helpme from esc.status import status from esc.commands import main_menu from esc.registers import Registry from esc.stack import StackState # pylint: disable=redefined-outer-name def test_status_message_anonymous(): """ Anonymous functions should use their key as a status description. """ add_func = main_menu.child('+') assert helpme.status_message(add_func) == "Help: '+' (press any key to return)" def test_status_message_nonanonymous(): "Named functions should use their description instead." exchange_func = main_menu.child('x') assert (helpme.status_message(exchange_func) == "Help: 'exchange bos, sos' (press any key to return)") def test_status_message_builtin(): "Builtins have a description." quit_func = builtin_stubs.Quit() assert helpme.status_message(quit_func) == "Help: 'quit' (press any key to return)" class MockScreen: "Mock for screen()." helpw = None called = set() def getch_status(self): self.called.add('getch_status') return ord('q') # get back out of help def refresh_stack(self, ss): self.called.add('refresh_stack') def refresh_status(self): self.called.add('refresh_status') def show_help_window(self, is_menu, help_title, signature_info, doc, simulated_result): self.called.add('show_help_window') def display_menu(self, command): self.called.add('display_menu') def mock_screen(self): """ Fast way to create a callable that can return a singleton-ish thing, to monkey-patch the global screen() object. """ return self @pytest.fixture def help_test_case(monkeypatch): "Set up environment for a get_help() test case." ss = StackState() ss.push((Decimal(2), Decimal(3))) registry = Registry() mock_screen = MockScreen() monkeypatch.setattr(helpme, 'screen', mock_screen.mock_screen) monkeypatch.setattr(display, 'screen', mock_screen.mock_screen) return ss, registry, mock_screen default_call_set = { 'getch_status', 'refresh_stack', 'refresh_status', 'show_help_window', } def test_get_help_simple(help_test_case): "We can get help on a simple (non-menu) function." ss, registry, mock_screen = help_test_case helpme.get_help('+', main_menu, ss, registry) assert mock_screen.called == default_call_set def test_get_help_menu_item(help_test_case): "We can get help on a function in a menu." ss, registry, mock_screen = help_test_case constants_menu = main_menu.child('i') helpme.get_help('p', constants_menu, ss, registry) assert mock_screen.called == default_call_set def test_get_help_menu(help_test_case): "We can get help on a menu itself." ss, registry, mock_screen = help_test_case helpme.get_help('i', main_menu, ss, registry) assert mock_screen.called == default_call_set.union({'display_menu'}) def test_get_help_invalid_key(help_test_case, monkeypatch): """ An error message is printed to the status bar when we ask for help on a nonexistent menu item. """ ss, registry, mock_screen = help_test_case the_error = None def my_error(msg): nonlocal the_error the_error = msg monkeypatch.setattr(status, 'error', my_error) helpme.get_help('Q', main_menu, ss, registry) assert the_error == "There's no option 'Q' in this menu."
gpl-3.0
-7,871,875,019,351,276,000
27.953125
87
0.64463
false
kpiorno/kivy3dgui
kivy3dgui/objloader.py
1
5490
from kivy.logger import Logger import os class MeshData(object): def __init__(self, **kwargs): self.name = kwargs.get("name") self.vertex_format = [ ('v_pos', 3, 'float'), ('v_normal', 3, 'float'), ('v_tc0', 2, 'float')] self.vertices = [] self.indices = [] def calculate_normals(self): for i in range(len(self.indices) / (3)): fi = i * 3 v1i = self.indices[fi] v2i = self.indices[fi + 1] v3i = self.indices[fi + 2] vs = self.vertices p1 = [vs[v1i + c] for c in range(3)] p2 = [vs[v2i + c] for c in range(3)] p3 = [vs[v3i + c] for c in range(3)] u,v = [0,0,0], [0,0,0] for j in range(3): v[j] = p2[j] - p1[j] u[j] = p3[j] - p1[j] n = [0,0,0] n[0] = u[1] * v[2] - u[2] * v[1] n[1] = u[2] * v[0] - u[0] * v[2] n[2] = u[0] * v[1] - u[1] * v[0] for k in range(3): self.vertices[v1i + 3 + k] = n[k] self.vertices[v2i + 3 + k] = n[k] self.vertices[v3i + 3 + k] = n[k] class ObjFile: def finish_object(self): if self._current_object == None: return mesh = [MeshData()] cont_mesh=0 idx = 0 for f in self.faces: verts = f[0] norms = f[1] tcs = f[2] material_ = list(map(float, f[3])) if len(mesh[cont_mesh].indices) == 65535: mesh.append(MeshData()) cont_mesh+=1 idx=0 for i in range(3): #get normal components n = (0.0, 0.0, 0.0) if norms[i] != -1: n = self.normals[norms[i]-1] #get texture coordinate components t = (0.4, 0.4) if tcs[i] != -1: t = self.texcoords[tcs[i]-1] #get vertex components v = self.vertices[verts[i]-1] data = [v[0], v[1], v[2], n[0], n[1], n[2], t[0], t[1], material_[0], material_[1], material_[2]] mesh[cont_mesh].vertices.extend(data) tri = [idx, idx+1, idx+2] mesh[cont_mesh].indices.extend(tri) idx += 3 self.objects[self._current_object] = mesh #mesh.calculate_normals() self.faces = [] def __init__(self, filename, swapyz=False): """Loads a Wavefront OBJ file. """ self.objects = {} self.vertices = [] self.normals = [] self.texcoords = [] self.faces = [] self.mtl = None self._current_object = None material = None for line in open(filename, "r"): if line.startswith('#'): continue if line.startswith('s'): continue values = line.split() if not values: continue if values[0] == 'o': self.finish_object() self._current_object = values[1] elif values[0] == 'mtllib': mtl_path = mtl_filename = values[1] if (os.path.isabs(filename) and not os.path.isabs(mtl_filename)) or \ (os.path.dirname(filename) and not os.path.dirname(mtl_filename)): # if needed, correct the mtl path to be relative or same-dir to/as the object path mtl_path = os.path.join(os.path.dirname(filename), mtl_filename) self.mtl = MTL(mtl_path) elif values[0] in ('usemtl', 'usemat'): material = values[1] if values[0] == 'v': v = list(map(float, values[1:4])) if swapyz: v = v[0], v[2], v[1] self.vertices.append(v) elif values[0] == 'vn': v = list(map(float, values[1:4])) if swapyz: v = v[0], v[2], v[1] self.normals.append(v) elif values[0] == 'vt': self.texcoords.append(list(map(float, values[1:3]))) elif values[0] == 'f': face = [] texcoords = [] norms = [] for v in values[1:]: w = v.split('/') face.append(int(w[0])) if len(w) >= 2 and len(w[1]) > 0: texcoords.append(int(w[1])) else: texcoords.append(-1) if len(w) >= 3 and len(w[2]) > 0: norms.append(int(w[2])) else: norms.append(-1) self.faces.append((face, norms, texcoords, self.mtl[material]["Kd"] if self.mtl!=None else [1., 1., 1.])) self.finish_object() def MTL(filename): contents = {} mtl = None if not os.path.exists(filename): return for line in open(filename, "r"): if line.startswith('#'): continue values = line.split() if not values: continue if values[0] == 'newmtl': mtl = contents[values[1]] = {} elif mtl is None: raise ValueError("mtl file doesn't start with newmtl stmt") mtl[values[0]] = values[1:] return contents
mit
-678,245,770,594,618,000
32.47561
121
0.428597
false
bmentges/django-cart
cart/cart.py
1
2554
import datetime from django.db.models import Sum from django.db.models import F from . import models CART_ID = 'CART-ID' class ItemAlreadyExists(Exception): pass class ItemDoesNotExist(Exception): pass class Cart: def __init__(self, request): cart_id = request.session.get(CART_ID) if cart_id: cart = models.Cart.objects.filter(id=cart_id, checked_out=False).first() if cart is None: cart = self.new(request) else: cart = self.new(request) self.cart = cart def __iter__(self): for item in self.cart.item_set.all(): yield item def new(self, request): cart = models.Cart.objects.create(creation_date=datetime.datetime.now()) request.session[CART_ID] = cart.id return cart def add(self, product, unit_price, quantity=1): item = models.Item.objects.filter(cart=self.cart, product=product).first() if item: item.unit_price = unit_price item.quantity += int(quantity) item.save() else: models.Item.objects.create(cart=self.cart, product=product, unit_price=unit_price, quantity=quantity) def remove(self, product): item = models.Item.objects.filter(cart=self.cart, product=product).first() if item: item.delete() else: raise ItemDoesNotExist def update(self, product, quantity, unit_price=None): item = models.Item.objects.filter(cart=self.cart, product=product).first() if item: if quantity == 0: item.delete() else: item.unit_price = unit_price item.quantity = int(quantity) item.save() else: raise ItemDoesNotExist def count(self): return self.cart.item_set.all().aggregate(Sum('quantity')).get('quantity__sum', 0) def summary(self): return self.cart.item_set.all().aggregate(total=Sum(F('quantity')*F('unit_price'))).get('total', 0) def clear(self): self.cart.item_set.all().delete() def is_empty(self): return self.count() == 0 def cart_serializable(self): representation = {} for item in self.cart.item_set.all(): item_id = str(item.object_id) item_dict = { 'total_price': item.total_price, 'quantity': item.quantity } representation[item_id] = item_dict return representation
lgpl-3.0
-4,190,622,972,837,579,300
28.697674
113
0.577525
false
librallu/cohorte-herald
python/herald/remote/herald_xmlrpc.py
1
10255
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Pelix remote services implementation based on Herald messaging and xmlrpclib :author: Thomas Calmant :copyright: Copyright 2014, isandlaTech :license: Apache License 2.0 :version: 0.0.3 :status: Alpha .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ # Module version __version_info__ = (0, 0, 3) __version__ = ".".join(str(x) for x in __version_info__) # Documentation strings format __docformat__ = "restructuredtext en" # ------------------------------------------------------------------------------ # Herald import herald.beans as beans import herald.remote # iPOPO decorators from pelix.ipopo.decorators import ComponentFactory, Requires, Validate, \ Invalidate, Property, Provides, Instantiate # Pelix constants import pelix.remote import pelix.remote.transport.commons as commons # Standard library import logging # XML RPC modules try: # Python 3 # pylint: disable=F0401 from xmlrpc.server import SimpleXMLRPCDispatcher import xmlrpc.client as xmlrpclib except ImportError: # Python 2 # pylint: disable=F0401 from SimpleXMLRPCServer import SimpleXMLRPCDispatcher import xmlrpclib # ------------------------------------------------------------------------------ HERALDRPC_CONFIGURATION = 'herald-xmlrpc' """ Remote Service configuration constant """ PROP_HERALDRPC_PEER = "herald.rpc.peer" """ UID of the peer exporting a service """ PROP_HERALDRPC_SUBJECT = 'herald.rpc.subject' """ Subject to contact the exporter """ SUBJECT_REQUEST = 'herald/rpc/xmlrpc' """ Subject to use for requests """ SUBJECT_REPLY = 'herald/rpc/xmlrpc/reply' """ Subject to use for replies """ _logger = logging.getLogger(__name__) # ------------------------------------------------------------------------------ class _XmlRpcDispatcher(SimpleXMLRPCDispatcher): """ A XML-RPC dispatcher with a custom dispatch method Calls the dispatch method given in the constructor """ def __init__(self, dispatch_method, encoding=None): """ Sets up the servlet """ SimpleXMLRPCDispatcher.__init__(self, allow_none=True, encoding=encoding) # Register the system.* functions self.register_introspection_functions() # Make a link to the dispatch method self._dispatch_method = dispatch_method def _simple_dispatch(self, name, params): """ Dispatch method """ try: # Internal method return self.funcs[name](*params) except KeyError: # Other method pass # Call the other method outside the except block, to avoid messy logs # in case of error return self._dispatch_method(name, params) def dispatch(self, data): """ Handles a HTTP POST request :param data: The string content of the request :return: The XML-RPC response as a string """ # Dispatch return self._marshaled_dispatch(data, self._simple_dispatch) @ComponentFactory(herald.remote.FACTORY_HERALD_XMLRPC_EXPORTER) @Requires('_directory', herald.SERVICE_DIRECTORY) # SERVICE_EXPORT_PROVIDER is provided by the parent class @Provides(herald.SERVICE_LISTENER) @Property('_filters', herald.PROP_FILTERS, [SUBJECT_REQUEST]) @Property('_kinds', pelix.remote.PROP_REMOTE_CONFIGS_SUPPORTED, (HERALDRPC_CONFIGURATION,)) @Instantiate('herald-rpc-exporter-xmlrpc') class HeraldRpcServiceExporter(commons.AbstractRpcServiceExporter): """ Herald Remote Services exporter """ def __init__(self): """ Sets up the exporter """ # Call parent super(HeraldRpcServiceExporter, self).__init__() # Herald directory self._directory = None # Herald filters self._filters = None # Handled configurations self._kinds = None # Dispatcher self._dispatcher = None def make_endpoint_properties(self, svc_ref, name, fw_uid): """ Prepare properties for the ExportEndpoint to be created :param svc_ref: Service reference :param name: Endpoint name :param fw_uid: Framework UID :return: A dictionary of extra endpoint properties """ return {PROP_HERALDRPC_PEER: self._directory.local_uid, PROP_HERALDRPC_SUBJECT: SUBJECT_REQUEST} @Validate def validate(self, context): """ Component validated """ # Call parent super(HeraldRpcServiceExporter, self).validate(context) # Setup the dispatcher self._dispatcher = _XmlRpcDispatcher(self.dispatch) @Invalidate def invalidate(self, context): """ Component invalidated """ # Call parent super(HeraldRpcServiceExporter, self).invalidate(context) # Clean up self._dispatcher = None def herald_message(self, herald_svc, message): """ Received a message from Herald :param herald_svc: The Herald service :param message: A message bean """ result = self._dispatcher.dispatch(message.content) # answer to the message reply_msg = beans.Message(SUBJECT_REPLY, result) reply_msg.add_header('replies-to', message.uid) origin = message.get_header('original_sender') if origin is None: # in the case it was not routed origin = message.sender herald_svc.fire(origin, reply_msg) # ------------------------------------------------------------------------------ class _XmlRpcEndpointProxy(object): """ Proxy to use XML-RPC over Herald """ def __init__(self, name, peer, subject, send_method): """ Sets up the endpoint proxy :param name: End point name :param peer: UID of the peer to contact :param subject: Subject to use for RPC :param send_method: Method to use to send a request """ self.__name = name self.__peer = peer self.__subject = subject self.__send = send_method self.__cache = {} def __getattr__(self, name): """ Prefixes the requested attribute name by the endpoint name """ return self.__cache.setdefault( name, _XmlRpcMethod("{0}.{1}".format(self.__name, name), self.__peer, self.__subject, self.__send)) class _XmlRpcMethod(object): """ Represents a method in a call proxy """ def __init__(self, method_name, peer, subject, send_method): """ Sets up the method :param method_name: Full method name :param peer: UID of the peer to contact :param subject: Subject to use for RPC :param send_method: Method to use to send a request """ self.__name = method_name self.__peer = peer self.__subject = subject self.__send = send_method def __call__(self, *args): """ Method is being called """ # Forge the request request = xmlrpclib.dumps(args, self.__name, encoding='utf-8', allow_none=True) # Send it reply_message = self.__send(self.__peer, self.__subject, request) # Parse the reply parser, unmarshaller = xmlrpclib.getparser() parser.feed(reply_message.content) parser.close() return unmarshaller.close() @ComponentFactory(herald.remote.FACTORY_HERALD_XMLRPC_IMPORTER) @Requires('_herald', herald.SERVICE_HERALD) @Requires('_directory', herald.SERVICE_DIRECTORY) @Provides(pelix.remote.SERVICE_IMPORT_ENDPOINT_LISTENER) @Property('_kinds', pelix.remote.PROP_REMOTE_CONFIGS_SUPPORTED, (HERALDRPC_CONFIGURATION,)) @Instantiate('herald-rpc-importer-xmlrpc') class HeraldRpcServiceImporter(commons.AbstractRpcServiceImporter): """ XML-RPC Remote Services importer """ def __init__(self): """ Sets up the exporter """ # Call parent super(HeraldRpcServiceImporter, self).__init__() # Herald service self._herald = None # Component properties self._kinds = None def __call(self, peer, subject, content): """ Method called by the proxy to send a message over Herald """ msg = beans.Message(subject, content) msg.add_header('original_sender', self._directory.local_uid) return self._herald.send(peer, msg) def make_service_proxy(self, endpoint): """ Creates the proxy for the given ImportEndpoint :param endpoint: An ImportEndpoint bean :return: A service proxy """ # Get Peer UID information peer_uid = endpoint.properties.get(PROP_HERALDRPC_PEER) if not peer_uid: _logger.warning("Herald-RPC endpoint without peer UID: %s", endpoint) return # Get request subject information subject = endpoint.properties.get(PROP_HERALDRPC_SUBJECT) if not subject: _logger.warning("Herald-RPC endpoint without subject: %s", endpoint) return # Return the proxy return _XmlRpcEndpointProxy(endpoint.name, peer_uid, subject, self.__call) def clear_service_proxy(self, endpoint): """ Destroys the proxy made for the given ImportEndpoint :param endpoint: An ImportEndpoint bean """ # Nothing to do return
apache-2.0
7,400,921,342,612,229,000
28.724638
80
0.603608
false
mediachain/cccoin
node/node_temporal.py
1
24616
#!/usr/bin/env python """ Maintains a stable view of / access to state: - Combines multiple underlying blockchain sources, - Temporally tracks degrees of confidence based on age, with chain reorg support. """ ## ## Note: BUG1 refers to, ## ## When you have nested manager.dict()'s, instead of: ## h['a']['b'] = 'c' ## ## You must instead do this: ## y = h['a'] ## y['b'] = 'c' ## h = y ## from sys import maxint import threading import multiprocessing class TemporalTable: """ Temporal in-memory database. Update and lookup historical values of a key. TODO: - Also create version with SQL backend. """ def __init__(self, process_safe = True, manager = False, ): self.process_safe = process_safe assert process_safe, 'TODO - double check thread-based concurrency support by TemporalForks & TemporalDB' if self.process_safe: if manager is not False: self.manager = manager else: self.manager = multiprocessing.Manager() self.process_safe = True self.the_lock = self.manager.RLock() self.hh = self.manager.dict() self.current_latest = self.manager.dict() self.all_block_nums = self.manager.dict() self.largest_pruned = self.manager.Value('i', -maxint) else: self.process_safe = False self.the_lock = threading.RLock() self.hh = {} ## {key:{block_num:value}} self.current_latest = {} ## {key:block_num} self.all_block_nums = {} ## set, but have to use dict self.largest_pruned = -maxint def _get_largest_pruned(self): if self.process_safe: return self.largest_pruned.value else: return self.largest_pruned def _set_largest_pruned(self, val): if self.process_safe: self.largest_pruned.value = val else: self.largest_pruned = val def store(self, key, value, start_block, as_set_op = False, remove_set_op = False): """ """ print ('TemporalTable.store()', locals()) assert start_block != -maxint, 'ERROR: -MAXINT IS RESERVED' print ('STORE', key, value) with self.the_lock: if key not in self.hh: if self.process_safe: self.hh[key] = self.manager.dict() if not as_set_op: #self.hh[key][start_block] = value ## BUG1: tm = self.hh[key] tm[start_block] = value self.hh[key] = tm else: self.hh[key] = {} if as_set_op: if start_block not in self.hh[key]: if self.process_safe: if as_set_op: ## copy whole previous in: tm = self.hh[key] if key in self.current_latest: tm[start_block] = self.hh[key][self.current_latest[key]].copy() else: tm[start_block] = self.manager.dict() self.hh[key] = tm else: ## BUG1: #self.hh[key][start_block] = self.manager.dict() tm = self.hh[key] tm[start_block] = self.manager.dict() self.hh[key] = tm else: self.hh[key][start_block] = {} ## BUG1: #self.hh[key][start_block][value] = True ## Must have already setup in previous call. tm = self.hh[key] tm2 = tm[start_block] #print 'aa', key ,start_block, self.hh #print 'hh', self.hh[key][start_block] if remove_set_op: tm2[value] = False ## Must have already setup in previous call. else: tm2[value] = True ## Must have already setup in previous call. tm[start_block] = tm2 self.hh[key] = tm else: #self.hh[key][start_block] = value ## BUG1: tm = self.hh[key] tm[start_block] = value self.hh[key] = tm self.current_latest[key] = max(start_block, self.current_latest.get(key, -maxint)) self.all_block_nums[start_block] = True def remove(self, key, value, start_block, as_set_op = False): print ('REMOVE', locals()) with self.the_lock: if as_set_op: self.store(key, value, start_block, as_set_op = True, remove_set_op = True) return if False: ### if start_block not in self.hh[key]: if self.process_safe: if as_set_op: ## copy whole previous in: tm = self.hh[key] if key in self.current_latest: tm[start_block] = self.hh[key][self.current_latest[key]].copy() else: tm[start_block] = self.manager.dict() self.hh[key] = tm else: ## BUG1: #self.hh[key][start_block] = self.manager.dict() tm = self.hh[key] tm[start_block] = self.manager.dict() self.hh[key] = tm else: self.hh[key][start_block] = {} ### ## BUG1: #del self.hh[key][start_block][value] ## Must have already setup in previous call. tm = self.hh[key] tm2 = tm[start_block] del tm2[value] tm[start_block] = tm2 self.hh[key] = tm else: ## BUG1: #del self.hh[key][start_block] tm = self.hh[key] del tm[start_block] self.hh[key] = tm self.current_latest[key] = max(start_block, self.current_latest.get(key, -maxint)) def lookup(self, key, start_block = -maxint, end_block = 'latest', default = KeyError, with_block_num = True): """ Return only latest, between start_block and end_block. """ assert with_block_num with self.the_lock: if (start_block > -maxint) and (start_block <= self._get_largest_pruned()): assert False, ('PREVIOUSLY_PRUNED_REQUESTED_BLOCK', start_block, self._get_largest_pruned()) if (key not in self.hh) or (not self.hh[key]): if default is KeyError: raise KeyError if with_block_num: return default, False else: return default ## Latest: if end_block == 'latest': end_block = max(end_block, self.current_latest[key]) ## Exactly end_block: if start_block == end_block: if end_block in self.hh[key]: if with_block_num: return self.hh[key][end_block], start_block else: return self.hh[key][end_block] ## Closest <= block_num: for xx in sorted(self.hh.get(key,{}).keys(), reverse = True): if xx > end_block: continue if xx < start_block: continue if with_block_num: return self.hh[key][xx], xx else: return self.hh[key][xx] else: if default is KeyError: raise KeyError if with_block_num: return default, False else: return default assert False,'should not reach' def iterate_set_depth(self, start_block = -maxint, end_block = 'latest'): ## TODO ## [x.keys() for x in xx.tables['table2'].forks['fork1'].hh['z'].values()] pass def iterate_block_items(self, start_block = -maxint, end_block = 'latest'): """ Iterate latest version of all known keys, between start_block and end_block. """ with self.the_lock: for kk in self.current_latest.keys(): try: rr, bn = self.lookup(kk, start_block, end_block) except: ## not yet present in db continue yield (kk, rr) def prune_historical(self, end_block): """ Prune ONLY OUTDATED records prior to and including `end_block`, e.g. to clear outdated historical state. """ with self.the_lock: for key in self.hh.keys(): for bn in sorted(self.hh.get(key,{}).keys()): if bn > end_block: break ## BUG1: #del self.hh[key][bn] tm = self.hh[key] del tm[bn] self.hh[key] = tm self._set_largest_pruned(max(end_block, self.largest_pruned)) def wipe_newer(self, start_block): """ Wipe blocks newer than and and including `start_block` e.g. for blockchain reorganization. """ with self.the_lock: for key in self.hh.keys(): for bn in sorted(self.hh.get(key,{}).keys(), reverse = True): if bn < start_block: break ## BUG1: #del self.hh[key][bn] tm = self.hh[key] del tm[bn] self.hh[key] = tm T_ANY_FORK = 'T_ANY_FORK' class TemporalForks: """ A collection of `TemporalTable`s, one for each fork being tracked. Lookup latest state, resolved from multiple forks. Discard keys from direct that never got confirmed within max_confirm_time. Use 'ANY_FORK' to indicate that action should be applied to all / consider all forks. """ def __init__(self, master_fork_name, ## 'name' fork_names, ## ['name'] max_non_master_age = False, manager = False, CONST_ANY_FORK = T_ANY_FORK, ## just in case you really need to change it ): """ - master_fork_name: name of master fork - max_non_master_age: number of blocks before non-master blocks expire. """ assert master_fork_name in fork_names assert CONST_ANY_FORK not in fork_names self.T_ANY_FORK = CONST_ANY_FORK if manager is not False: self.manager = manager else: self.manager = multiprocessing.Manager() self.forks = {} ## Doesn't ever change after this function, so regular dict. for fork in fork_names: self.forks[fork] = TemporalTable(process_safe = True, manager = self.manager) self.master_fork_name = master_fork_name self.max_non_master_age = max_non_master_age self.latest_master_block_num = self.manager.Value('i', -maxint) self.the_lock = self.manager.RLock() def update_latest_master_block_num(self, block_num): with self.the_lock: self.latest_master_block_num.value = max(block_num, self.latest_master_block_num.value) def store(self, fork_name, *args, **kw): """ store in specific fork """ print ('TemporalForks.store()', locals()) with self.the_lock: if True: ## You should still do this manually too: if 'start_block' in kw: sb = kw['start_block'] else: sb = args[2] self.update_latest_master_block_num(sb) if fork_name == self.T_ANY_FORK: assert False, 'really store in all forks?' else: assert fork_name in self.forks self.forks[fork_name].store(*args, **kw) def remove(self, fork_name, *args, **kw): """ remove just from specific fork """ with self.the_lock: if fork_name == self.T_ANY_FORK: for fork_name, fork in self.forks.items(): fork.remove(*args, **kw) else: assert fork_name in self.forks self.forks[fork_name].remove(*args, **kw) def lookup(self, fork_name, key, start_block = -maxint, end_block = 'latest', default = KeyError): """ Lookup latest non-expired from any fork. """ with self.the_lock: if fork_name != self.T_ANY_FORK: assert fork_name in self.forks, repr(fork_name) return self.forks[fork_name].lookup(key = key, start_block = start_block, end_block = end_block, default = default, ) assert self.latest_master_block_num.value != -maxint, 'Must call self.update_latest_master_block_num() first.' biggest_num = -maxint biggest_val = False start_block_non_master = start_block if self.max_non_master_age is not False: start_block_non_master = max(self.latest_master_block_num.value - self.max_non_master_age, start_block, ) for fork_name, fork in self.forks.items(): if fork_name != self.master_fork_name: x_start_block = start_block_non_master else: x_start_block = start_block try: val, block_num = fork.lookup(key = key, start_block = x_start_block, end_block = end_block, default = KeyError, ) except KeyError: continue if block_num > biggest_num: biggest_num = block_num biggest_val = val if biggest_num == -maxint: if default is KeyError: raise KeyError return default, False return biggest_val, biggest_num def iterate_block_items(self, fork_name, start_block = -maxint, end_block = 'latest'): with self.the_lock: if fork_name != self.T_ANY_FORK: assert fork_name in self.forks, repr(fork_name) for xx in self.forks[fork_name].iterate_block_items(start_block, end_block): yield xx return do_keys = set() for fork in self.forks.values(): do_keys.update(fork.current_latest.keys()) for kk in do_keys: try: rr, bn = self.lookup(fork_name, kk, start_block = start_block, end_block = end_block) except KeyError: ## not yet present in db continue yield (kk, rr) def prune_historical(self, fork_name, *args, **kw): with self.the_lock: if fork_name != self.T_ANY_FORK: assert fork_name in self.forks, repr(fork_name) return self.forks[fork_name].prune_historical(*args, **kw) for fork_name, fork in self.forks.items(): fork.prune_historical(*args, **kw) def wipe_newer(self, fork_name, *args, **kw): with self.the_lock: if fork_name != self.T_ANY_FORK: assert fork_name in self.forks, repr(fork_name) return self.forks[fork_name].wipe_newer(*args, **kw) for fork_name, fork in self.forks.items(): fork.wipe_newer(*args, **kw) class TemporalDB: """ Synchronizes creation / access / updates to a collection of TemporalForks. """ def __init__(self, table_names, master_fork_name, fork_names, ): self.manager = multiprocessing.Manager() self.the_lock = self.manager.RLock() self.tables = {} for table_name in table_names: self.tables[table_name] = TemporalForks(master_fork_name = master_fork_name, fork_names = fork_names, manager = self.manager, ) def __getattr__(self, func_name): """ Proxy everything else through to appropriate TemporalForks. """ if func_name.startswith('all_'): ## Apply to all TemporalForks. Note, not for functions with return values: def handle(*args, **kw): x_func_name = func_name[4:] print ('HANDLE_ALL', x_func_name, args, kw) for table_name, table in self.tables.iteritems(): getattr(self.tables[table_name], x_func_name)(*args, **kw) elif func_name.startswith('iterate_'): ## Apply to all TemporalForks. Note, not for functions with return values: def handle(table_name, *args, **kw): print ('HANDLE_ITER', table_name, func_name, args, kw) return list(getattr(self.tables[table_name], func_name)(*args, **kw)) else: ## Proxy the rest to individual TemporalForks: def handle(table_name, *args, **kw): #print ('HANDLE', func_name, table_name, args, kw) r = getattr(self.tables[table_name], func_name)(*args, **kw) #print ('DONE_HANDLE', r) return r return handle def test_temporal_table(): print ('START test_temporal_table()') xx = TemporalTable() xx.store('a', 'b', start_block = 1) assert xx.lookup('a')[0] == 'b', xx.lookup('a')[0] xx.store('a', 'c', start_block = 3) assert xx.lookup('a')[0] == 'c', xx.lookup('a')[0] xx.store('a', 'd', start_block = 2) assert xx.lookup('a')[0] == 'c', xx.lookup('a')[0] assert xx.lookup('a', end_block = 2)[0] == 'd', xx.lookup('a', end_block = 2)[0] xx.store('e','h',1) xx.store('e','f',2) xx.store('e','g',3) assert tuple(xx.iterate_block_items()) == (('a', 'c'), ('e', 'g')) assert tuple(xx.iterate_block_items(end_block = 1)) == (('a', 'b'), ('e', 'h')) print ('PASSED') def test_temporal_forks(): print ('START test_temporal_forks()') xx = TemporalForks(master_fork_name = 'fork1', fork_names = ['fork1', 'fork2']) xx.update_latest_master_block_num(1) xx.store('fork1', 'a', 'b', start_block = 1) assert xx.lookup('fork1', 'a')[0] == 'b' xx.update_latest_master_block_num(3) xx.store('fork1', 'a', 'c', start_block = 3) assert xx.lookup('fork1', 'a')[0] == 'c' xx.update_latest_master_block_num(2) xx.store('fork1', 'a', 'd', start_block = 2) assert xx.lookup('fork1', 'a')[0] == 'c' assert xx.lookup('fork1', 'a', end_block = 2)[0] == 'd' xx.update_latest_master_block_num(1) xx.store('fork1', 'e','h',1) xx.update_latest_master_block_num(2) xx.store('fork1', 'e','f',2) xx.update_latest_master_block_num(3) xx.store('fork1', 'e','g',3) assert tuple(xx.iterate_block_items('fork1')) == (('a', 'c'), ('e', 'g')) assert tuple(xx.iterate_block_items('fork1', end_block = 1)) == (('a', 'b'), ('e', 'h')) print ('PASSED_FORKS_BASIC') xx = TemporalForks(master_fork_name = 'fork1', fork_names = ['fork1', 'fork2'], max_non_master_age = 5) xx.update_latest_master_block_num(1) xx.store('fork1', 'z', 'e', start_block = 1) xx.update_latest_master_block_num(2) xx.store('fork2', 'z', 'g', start_block = 2) assert xx.lookup(T_ANY_FORK, 'z')[0] == 'g' xx.update_latest_master_block_num(50) assert xx.lookup(T_ANY_FORK, 'z')[0] == 'e' print ('PASSED_FORKS') def test_temporal_db(): print ('START test_temporal_db()') xx = TemporalDB(table_names = ['table1', 'table2'], master_fork_name = 'fork1', fork_names = ['fork1', 'fork2']) xx.all_update_latest_master_block_num(1) xx.store('table1', 'fork1', 'a', 'b', start_block = 1) assert xx.lookup('table1', 'fork1', 'a')[0] == 'b' xx.all_update_latest_master_block_num(3) xx.store('table1', 'fork1', 'a', 'c', start_block = 3) assert xx.lookup('table1', 'fork1', 'a')[0] == 'c' xx.all_update_latest_master_block_num(2) xx.store('table1', 'fork1', 'a', 'd', start_block = 2) assert xx.lookup('table1', 'fork1', 'a')[0] == 'c' assert xx.lookup('table1', 'fork1', 'a', end_block = 2)[0] == 'd' xx.all_update_latest_master_block_num(1) xx.store('table1', 'fork1', 'e','h',1) xx.all_update_latest_master_block_num(2) xx.store('table1', 'fork1', 'e','f',2) xx.all_update_latest_master_block_num(3) xx.store('table1', 'fork1', 'e','g',3) assert tuple(xx.iterate_block_items('table1', 'fork1')) == (('a', 'c'), ('e', 'g')) assert tuple(xx.iterate_block_items('table1', 'fork1', end_block = 1)) == (('a', 'b'), ('e', 'h')) assert tuple(xx.iterate_block_items('table1', T_ANY_FORK, end_block = 1)) == (('a', 'b'), ('e', 'h')) xx.store('table2', 'fork1', 'z', '1', start_block = 55, as_set_op = True,) assert tuple(sorted(xx.lookup('table2', 'fork1', 'z', end_block = 57)[0].keys())) == ('1',) xx.store('table2', 'fork1', 'z', '2', start_block = 56, as_set_op = True,) assert tuple(sorted(xx.lookup('table2', 'fork1', 'z', end_block = 57)[0].keys())) == ('1','2',) xx.store('table2', 'fork1', 'z', '3', start_block = 57, as_set_op = True,) assert tuple(sorted(xx.lookup('table2', 'fork1', 'z', start_block = 57)[0].keys())) == ('1', '2', '3') xx.remove('table2', 'fork1', 'z', '3', start_block = 58, as_set_op = True,) assert tuple([a for a,b in xx.lookup('table2', 'fork1', 'z', start_block = 58)[0].items() if b]) == ('1', '2') assert tuple([a for a,b in xx.lookup('table2', 'fork1', 'z', start_block = 56)[0].items() if b]) == ('1', '2') assert tuple([a for a,b in xx.lookup('table2', 'fork1', 'z', end_block = 55)[0].items() if b]) == ('1',) xx.remove('table2', 'fork1', 'z', '2', start_block = 59, as_set_op = True,) assert tuple([a for a,b in xx.lookup('table2', 'fork1', 'z', end_block = 59)[0].items() if b]) == ('1',) xx.remove('table2', 'fork1', 'z', '1', start_block = 60, as_set_op = True,) assert tuple([a for a,b in xx.lookup('table2', 'fork1', 'z', end_block = 60)[0].items() if b]) == tuple() xx.all_wipe_newer(T_ANY_FORK, start_block = 58) assert tuple(sorted([a for a,b in xx.lookup('table2', 'fork1', 'z', end_block = 59)[0].items() if b])) == ('1','2','3') #print '===FOUR ', list(sorted([(x,[a for a,b in y.items() if b]) for x,y in xx.tables['table2'].forks['fork1'].hh['z'].items()])) print ('PASSED_DB_BASIC') if __name__ == '__main__': test_temporal_table() test_temporal_forks() test_temporal_db()
mit
4,051,674,677,321,693,700
39.958403
134
0.479729
false
nemesiscodex/JukyOS-sugar
extensions/deviceicon/touchpad.py
1
4769
# Copyright (C) 2010, Walter Bender, Sugar Labs # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA from gettext import gettext as _ import os import gtk import gconf import glib import logging from sugar.graphics.tray import TrayIcon from sugar.graphics.xocolor import XoColor from sugar.graphics.palette import Palette from sugar.graphics import style from jarabe.frame.frameinvoker import FrameWidgetInvoker TOUCHPAD_MODE_MOUSE = 'mouse' TOUCHPAD_MODE_PENTABLET = 'pentablet' TOUCHPAD_MODES = (TOUCHPAD_MODE_MOUSE, TOUCHPAD_MODE_PENTABLET) STATUS_TEXT = (_('finger'), _('stylus')) STATUS_ICON = ('touchpad-capacitive', 'touchpad-resistive') # NODE_PATH is used to communicate with the touchpad device. NODE_PATH = '/sys/devices/platform/i8042/serio1/hgpk_mode' class DeviceView(TrayIcon): """ Manage the touchpad mode from the device palette on the Frame. """ FRAME_POSITION_RELATIVE = 500 def __init__(self): """ Create the icon that represents the touchpad. """ icon_name = STATUS_ICON[_read_touchpad_mode()] client = gconf.client_get_default() color = XoColor(client.get_string('/desktop/sugar/user/color')) TrayIcon.__init__(self, icon_name=icon_name, xo_color=color) self.set_palette_invoker(FrameWidgetInvoker(self)) self.connect('button-release-event', self.__button_release_event_cb) def create_palette(self): """ Create a palette for this icon; called by the Sugar framework when a palette needs to be displayed. """ label = glib.markup_escape_text(_('My touchpad')) self.palette = ResourcePalette(label, self.icon) self.palette.set_group_id('frame') return self.palette def __button_release_event_cb(self, widget, event): """ Callback for button release event; used to invoke touchpad-mode change. """ self.palette.toggle_mode() return True class ResourcePalette(Palette): """ Palette attached to the decive icon that represents the touchpas. """ def __init__(self, primary_text, icon): """ Create the palette and initilize with current touchpad status. """ Palette.__init__(self, label=primary_text) self._icon = icon vbox = gtk.VBox() self.set_content(vbox) self._status_text = gtk.Label() vbox.pack_start(self._status_text, padding=style.DEFAULT_PADDING) self._status_text.show() vbox.show() self._mode = _read_touchpad_mode() self._update() def _update(self): """ Update the label and icon based on the current mode. """ self._status_text.set_label(STATUS_TEXT[self._mode]) self._icon.props.icon_name = STATUS_ICON[self._mode] def toggle_mode(self): """ Toggle the touchpad mode. """ self._mode = 1 - self._mode _write_touchpad_mode(self._mode) self._update() def setup(tray): """ Initialize the devic icon; called by the shell when initializing the Frame. """ if os.path.exists(NODE_PATH): tray.add_device(DeviceView()) _write_touchpad_mode_str(TOUCHPAD_MODE_MOUSE) def _read_touchpad_mode_str(): """ Read the touchpad mode string from the node path. """ node_file_handle = open(NODE_PATH, 'r') text = node_file_handle.read().strip().lower() node_file_handle.close() return text def _read_touchpad_mode(): """ Read the touchpad mode and return the mode index. """ mode_str = _read_touchpad_mode_str() if mode_str not in TOUCHPAD_MODES: return None return TOUCHPAD_MODES.index(mode_str) def _write_touchpad_mode_str(mode_str): """ Write the touchpad mode to the node path. """ try: node_file_handle = open(NODE_PATH, 'w') except IOError, e: logging.error('Error opening %s for writing: %s', NODE_PATH, e) return node_file_handle.write(mode_str) node_file_handle.close() def _write_touchpad_mode(mode_num): """ Look up the mode (by index) and write to node path. """ return _write_touchpad_mode_str(TOUCHPAD_MODES[mode_num])
gpl-2.0
4,583,050,605,971,774,500
31.664384
78
0.672678
false
janschulz/igraph
interfaces/python/igraph/nexus.py
1
21903
# vim:ts=4:sw=4:sts=4:et # -*- coding: utf-8 -*- """Interface to the Nexus online graph repository. The classes in this file facilitate access to the Nexus online graph repository at U{http://nexus.igraph.org}. The main entry point of this package is the C{Nexus} variable, which is an instance of L{NexusConnection}. Use L{NexusConnection.get} to get a particular network from Nexus, L{NexusConnection.list} to list networks having a given set of tags, L{NexusConnection.search} to search in the dataset descriptions, or L{NexusConnection.info} to show the info sheet of a dataset.""" from cStringIO import StringIO from gzip import GzipFile from itertools import izip from textwrap import TextWrapper from urllib import urlencode from urlparse import urlparse, urlunparse from textwrap import TextWrapper from igraph.compat import property from igraph.configuration import Configuration from igraph.utils import multidict import re import urllib2 __all__ = ["Nexus", "NexusConnection"] __license__ = u"""\ Copyright (C) 2006-2012 Tamás Nepusz <[email protected]> Pázmány Péter sétány 1/a, 1117 Budapest, Hungary This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA """ class NexusConnection(object): """Connection to a remote Nexus server. In most cases, you will not have to instantiate this object, just use the global L{Nexus} variable which is an instance of L{NexusConnection} and connects to the Nexus repository at U{http://nexus.igraph.org}. Example: >>> print Nexus.info("karate") # doctest:+ELLIPSIS Nexus dataset 'karate' (#1) vertices/edges: 34/78 name: Zachary's karate club tags: social network; undirected; weighted ... >>> karate = Nexus.get("karate") >>> from igraph import summary >>> summary(karate) IGRAPH UNW- 34 78 -- Zachary's karate club network + attr: Author (g), Citation (g), name (g), Faction (v), id (v), name (v), weight (e) @undocumented: _get_response, _parse_dataset_id, _parse_text_response, _ensure_uncompressed""" def __init__(self, nexus_url=None): """Constructs a connection to a remote Nexus server. @param nexus_url: the root URL of the remote server. Leave it at its default value (C{None}) unless you have set up your own Nexus server and you want to connect to that. C{None} fetches the URL from igraph's configuration file or uses the default URL if no URL is specified in the configuration file. """ self.debug = False self.url = nexus_url self._opener = urllib2.build_opener() def get(self, id): """Retrieves the dataset with the given ID from Nexus. Dataset IDs are formatted as follows: the name of a dataset on its own means that a single network should be returned if the dataset contains a single network, or multiple networks should be returned if the dataset contains multiple networks. When the name is followed by a dot and a network ID, only a single network will be returned: the one that has the given network ID. When the name is followed by a dot and a star, a dictionary mapping network IDs to networks will be returned even if the original dataset contains a single network only. E.g., getting C{"karate"} would return a single network since the Zachary karate club dataset contains one network only. Getting C{"karate.*"} on the other hand would return a dictionary with one entry that contains the Zachary karate club network. @param id: the ID of the dataset to retrieve. @return: an instance of L{Graph} (if a single graph has to be returned) or a dictionary mapping network IDs to instances of L{Graph}. """ from igraph import load dataset_id, network_id = self._parse_dataset_id(id) params = dict(format="Python-igraph", id=dataset_id) response = self._get_response("/api/dataset", params, compressed=True) response = self._ensure_uncompressed(response) result = load(response, format="pickle") if network_id is None: # If result contains a single network only, return that network. # Otherwise return the whole dictionary if not isinstance(result, dict): return result if len(result) == 1: return result[result.keys()[0]] return result if network_id == "*": # Return a dict no matter what if not isinstance(result, dict): result = dict(dataset_id=result) return result return result[network_id] def info(self, id): """Retrieves informations about the dataset with the given numeric or string ID from Nexus. @param id: the numeric or string ID of the dataset to retrieve. @return: an instance of L{NexusDatasetInfo}. """ params = dict(format="text", id=id) response = self._get_response("/api/dataset_info", params) return NexusDatasetInfo.FromMultiDict(self._parse_text_response(response)) def list(self, tags=None, operator="or", order="date"): """Retrieves a list of datasets matching a set of tags from Nexus. @param tags: the tags the returned datasets should have. C{None} retrieves all the datasets, a single string retrieves datasets having that given tag. Multiple tags may also be specified as a list, tuple or any other iterable. @param operator: when multiple tags are given, this argument specifies whether the retrieved datasets should match all the tags (C{"and"}) or any of them (C{"or"}). @param order: the order of entries; it must be one of C{"date"}, C{"name"} or C{"popularity"}. @return: a L{NexusDatasetInfoList} object, which basically acts like a list and yields L{NexusDatasetInfo} objects. The list is populated lazily; i.e. the requests will be fired only when needed. """ params = dict(format="text", order=order) if tags is not None: if not hasattr(tags, "__iter__") or isinstance(tags, basestring): params["tag"] = str(tags) else: params["tag"] = "|".join(str(tag) for tag in tags) params["operator"] = operator return NexusDatasetInfoList(self, "/api/dataset_info", params) def search(self, query, order="date"): """Retrieves a list of datasets matching a query string from Nexus. @param query: the query string. Searches are case insensitive and Nexus searches for complete words only. The special word OR can be used to find datasets that contain any of the given words (instead of all of them). Exact phrases must be enclosed in quotes in the search string. See the Nexus webpage for more information at U{http://nexus.igraph.org/web/docs#searching}. @param order: the order of entries; it must be one of C{"date"}, C{"name"} or C{"popularity"}. @return: a L{NexusDatasetInfoList} object, which basically acts like a list and yields L{NexusDatasetInfo} objects. The list is populated lazily; i.e. the requests will be fired only when needed. """ params = dict(q=query, order=order, format="text") return NexusDatasetInfoList(self, "/api/search", params) @staticmethod def _ensure_uncompressed(response): """Expects an HTTP response object, checks its Content-Encoding header, decompresses the data and returns an in-memory buffer holding the uncompressed data.""" compressed = response.headers.get("Content-Encoding") == "gzip" if not compressed: content_disp = response.headers.get("Content-Disposition", "") compressed = bool(re.match(r'attachment; *filename=.*\.gz\"?$', content_disp)) if compressed: return GzipFile(fileobj=StringIO(response.read()), mode="rb") print response.headers return response def _get_response(self, path, params={}, compressed=False): """Sends a request to Nexus at the given path with the given parameters and returns a file-like object for the response. `compressed` denotes whether we accept compressed responses.""" if self.url is None: url = Configuration.instance()["remote.nexus.url"] else: url = self.url url = "%s%s?%s" % (url, path, urlencode(params)) request = urllib2.Request(url) if compressed: request.add_header("Accept-Encoding", "gzip") if self.debug: print "[debug] Sending request: %s" % url return self._opener.open(request) @staticmethod def _parse_dataset_id(id): """Parses a dataset ID used in the `get` request. Returns the dataset ID and the network ID (the latter being C{None} if the original ID did not contain a network ID ). """ dataset_id, _, network_id = str(id).partition(".") if not network_id: network_id = None return dataset_id, network_id @staticmethod def _parse_text_response(response): """Parses a plain text formatted response from Nexus. Plain text formatted responses consist of key-value pairs, separated by C{":"}. Values may span multiple lines; in this case, the key is omitted after the first line and the extra lines start with whitespace. Examples: >>> d = Nexus._parse_text_response("Id: 17\\nName: foo") >>> sorted(d.items()) [('Id', '17'), ('Name', 'foo')] >>> d = Nexus._parse_text_response("Id: 42\\nName: foo\\n .\\n bar") >>> sorted(d.items()) [('Id', '42'), ('Name', 'foo\\n\\nbar')] """ if isinstance(response, basestring): response = response.split("\n") result = multidict() key, value = None, [] for line in response: line = line.rstrip() if not line: continue if key is not None and line[0] in ' \t': # Line continuation line = line.lstrip() if line == '.': line = '' value.append(line) else: # Key-value pair if key is not None: result.add(key, "\n".join(value)) key, value = line.split(":", 1) value = [value.strip()] if key is not None: result.add(key, "\n".join(value)) return result @property def url(self): """Returns the root URL of the Nexus repository the connection is communicating with.""" return self._url @url.setter def url(self, value): """Sets the root URL of the Nexus repository the connection is communicating with.""" if value is None: self._url = None else: value = str(value) parts = urlparse(value, "http", False) self._url = urlunparse(parts) if self._url and self._url[-1] == "/": self._url = self._url[:-1] class NexusDatasetInfo(object): """Information about a dataset in the Nexus repository. @undocumented: _update_from_multidict, vertices_edges""" def __init__(self, id=None, sid=None, name=None, networks=None, vertices=None, edges=None, tags=None, attributes=None, rest=None): self._conn = None self.id = id self.sid = sid self.name = name self.vertices = vertices self.edges = edges self.tags = tags self.attributes = attributes if networks is None: self.networks = [] elif not isinstance(networks, (str, unicode)): self.networks = list(networks) else: self.networks = [networks] if rest: self.rest = multidict(rest) else: self.rest = None @property def vertices_edges(self): if self.vertices is None or self.edges is None: return "" elif isinstance(self.vertices, (list, tuple)) and isinstance(self.edges, (list, tuple)): return " ".join("%s/%s" % (v,e) for v, e in izip(self.vertices, self.edges)) else: return "%s/%s" % (self.vertices, self.edges) @vertices_edges.setter def vertices_edges(self, value): if value is None: self.vertices, self.edges = None, None return value = value.strip().split(" ") if len(value) == 0: self.vertices, self.edges = None, None elif len(value) == 1: self.vertices, self.edges = map(int, value[0].split("/")) else: self.vertices = [] self.edges = [] for ve in value: v, e = ve.split("/", 1) self.vertices.append(int(v)) self.edges.append(int(e)) def __repr__(self): params = "(id=%(id)r, sid=%(sid)r, name=%(name)r, networks=%(networks)r, "\ "vertices=%(vertices)r, edges=%(edges)r, tags=%(tags)r, "\ "attributes=%(attributes)r, rest=%(rest)r)" % self.__dict__ return "%s%s" % (self.__class__.__name__, params) def __str__(self): if self.networks and len(self.networks) > 1: lines = ["Nexus dataset '%s' (#%s) with %d networks" % \ (self.sid, self.id, len(self.networks))] else: lines = ["Nexus dataset '%(sid)s' (#%(id)s)" % self.__dict__] lines.append("vertices/edges: %s" % self.vertices_edges) if self.name: lines.append("name: %s" % self.name) if self.tags: lines.append("tags: %s" % "; ".join(self.tags)) if self.rest: wrapper = TextWrapper(width=76, subsequent_indent=' ') keys = sorted(self.rest.iterkeys()) if "attribute" in self.rest: keys.remove("attribute") keys.append("attribute") for key in keys: for value in self.rest.getlist(key): paragraphs = str(value).splitlines() wrapper.initial_indent = "%s: " % key for paragraph in paragraphs: ls = wrapper.wrap(paragraph) if ls: lines.extend(wrapper.wrap(paragraph)) else: lines.append(" .") wrapper.initial_indent = " " return "\n".join(lines) def _update_from_multidict(self, params): """Updates the dataset object from a multidict representation of key-value pairs, similar to the ones provided by the Nexus API in plain text response.""" self.id = params.get("id") self.sid = params.get("sid") self.name = params.get("name") self.vertices = params.get("vertices") self.edges = params.get("edges") self.tags = params.get("tags") networks = params.get("networks") if networks: self.networks = networks.split() keys_to_ignore = set("id sid name vertices edges tags networks".split()) if self.vertices is None and self.edges is None: # Try "vertices/edges" self.vertices_edges = params.get("vertices/edges") keys_to_ignore.add("vertices/edges") if self.rest is None: self.rest = multidict() for k in set(params.iterkeys()) - keys_to_ignore: for v in params.getlist(k): self.rest.add(k, v) if self.id: self.id = int(self.id) if self.vertices and not isinstance(self.vertices, (list, tuple)): self.vertices = int(self.vertices) if self.edges and not isinstance(self.edges, (list, tuple)): self.edges = int(self.edges) if self.tags is not None: self.tags = self.tags.split(";") @classmethod def FromMultiDict(cls, dict): """Constructs a Nexus dataset object from a multidict representation of key-value pairs, similar to the ones provided by the Nexus API in plain text response.""" result = cls() result._update_from_multidict(dict) return result def download(self, network_id=None): """Retrieves the actual dataset from Nexus. @param network_id: if the dataset contains multiple networks, the ID of the network to be retrieved. C{None} returns a single network if the dataset contains a single network, or a dictionary of networks if the dataset contains more than one network. C{"*"} retrieves a dictionary even if the dataset contains a single network only. @return: a L{Graph} instance or a dictionary mapping network names to L{Graph} instances. """ if self.id is None: raise ValueError("dataset ID is empty") conn = self._conn or Nexus if network_id is None: return conn.get(self.id) return conn.get("%s.%s" % (self.id, network_id)) get = download class NexusDatasetInfoList(object): """A read-only list-like object that can be used to retrieve the items from a Nexus search result. """ def __init__(self, connection, method, params): """Constructs a Nexus dataset list that will use the given connection and the given parameters to retrieve the search results. @param connection: a Nexus connection object @param method: the URL of the Nexus API method to call @param params: the parameters to pass in the GET requests, in the form of a Python dictionary. """ self._conn = connection self._method = str(method) self._params = params self._length = None self._datasets = [] self._blocksize = 10 def _fetch_results(self, index): """Fetches the results from Nexus such that the result item with the given index will be available (unless the result list is shorter than the given index of course).""" # Calculate the start offset page = index // self._blocksize offset = page * self._blocksize self._params["offset"] = offset self._params["limit"] = self._blocksize # Ensure that self._datasets has the necessary length diff = (page+1) * self._blocksize - len(self._datasets) if diff > 0: self._datasets.extend([None] * diff) response = self._conn._get_response(self._method, self._params) current_dataset = None for line in response: key, value = line.strip().split(": ", 1) key = key.lower() if key == "totalsize": # Total number of items in the search result self._length = int(value) elif key == "id": # Starting a new dataset if current_dataset: self._datasets[offset] = current_dataset offset += 1 current_dataset = NexusDatasetInfo(id=int(value)) current_dataset._conn = self._conn elif key == "sid": current_dataset.sid = value elif key == "name": current_dataset.name = value elif key == "vertices": current_dataset.vertices = int(value) elif key == "edges": current_dataset.edges = int(value) elif key == "vertices/edges": current_dataset.vertices_edges = value elif key == "tags": current_dataset.tags = value.split(";") if current_dataset: self._datasets[offset] = current_dataset def __getitem__(self, index): if len(self._datasets) <= index: self._fetch_results(index) elif self._datasets[index] is None: self._fetch_results(index) return self._datasets[index] def __iter__(self): for i in xrange(len(self)): yield self[i] def __len__(self): """Returns the number of result items.""" if self._length is None: self._fetch_results(0) return self._length def __str__(self): """Converts the Nexus result list into a nice human-readable format.""" max_index_length = len(str(len(self))) + 2 indent = "\n" + " " * (max_index_length+1) result = [] for index, item in enumerate(self): formatted_item = ("[%d]" % index).rjust(max_index_length) + " " + \ str(item).replace("\n", indent) result.append(formatted_item) return "\n".join(result) Nexus = NexusConnection()
gpl-2.0
82,784,205,133,577,890
38.103571
96
0.59241
false
Joergen/zamboni
mkt/fireplace/tests/test_api.py
1
1450
import json from nose.tools import eq_ import amo from addons.models import AddonUpsell from mkt.api.base import get_url, list_url from mkt.api.tests import BaseAPI from mkt.api.tests.test_oauth import get_absolute_url from mkt.webapps.models import Webapp from mkt.site.fixtures import fixture class TestAppDetail(BaseAPI): fixtures = fixture('webapp_337141') def setUp(self): super(TestAppDetail, self).setUp() self.url = get_absolute_url(get_url('app', pk=337141), api_name='fireplace') def test_get(self): res = self.client.get(self.url) data = json.loads(res.content) eq_(data['id'], '337141') def test_get_slug(self): Webapp.objects.get(pk=337141).update(app_slug='foo') res = self.client.get(get_absolute_url(('api_dispatch_detail', {'resource_name': 'app', 'app_slug': 'foo'}), api_name='fireplace')) data = json.loads(res.content) eq_(data['id'], '337141') def test_others(self): url = get_absolute_url(list_url('app'), api_name='fireplace') self._allowed_verbs(self.url, ['get']) self._allowed_verbs(url, []) def test_get_no_upsold(self): free = Webapp.objects.create(status=amo.STATUS_PUBLIC) AddonUpsell.objects.create(premium_id=337141, free=free) res = self.client.get(self.url) assert 'upsold' not in res.content
bsd-3-clause
4,532,927,964,654,308,000
31.222222
70
0.628966
false
jepcastelein/marketopy
marketo.py
1
9277
import requests import logging import time class MarketoClient: """Basic Marketo Client""" def __init__(self, identity, client_id, client_secret, api): self.api_endpoint = api self.identity_endpoint = identity self.client_id = client_id self.client_secret = client_secret self.api_version = "v1" self._fields = None self._session = requests.Session() self.refresh_auth_token() def refresh_auth_token(self): auth_url = "%s/oauth/token?grant_type=client_credentials" % ( self.identity_endpoint) auth_url += "&client_id=%s&client_secret=%s" % (self.client_id, self.client_secret) debug("Calling %s" % auth_url) r = requests.get(auth_url) r.raise_for_status() auth_data = r.json() log("Access token acquired: %s expiring in %s" % (auth_data['access_token'], auth_data['expires_in'])) self.auth_token = auth_data['access_token'] @property def fields(self): if self._fields is None: res = "leads/describe.json" fields = self.auth_get(res)["result"] fields = [f["rest"]["name"] for f in fields] self._fields = fields return self._fields def get_paging_token(self, since): """ Get a paging token. Format expeced: 2014-10-06. """ resource = "activities/pagingtoken.json" params = {"sinceDatetime": since} data = self.auth_get(resource, params) return data["nextPageToken"] def get_leadchanges(self, since, fields): """ Get lead changes. Params: fields = ["company", "score", "firstName"] """ return LeadChangeSet(self, since, fields, page_size=300) def get_lead_by_id(self, id, fields=None): """Get a lead by its ID""" resource = "lead/%i.json" % id data = self.auth_get(resource) return data def get_leads_by_id(self, ids, fields=None): params = {"filterType": "id", "filterValues": ",".join(ids), "fields": ",".join(fields) } resource = "leads.json" data = self.auth_get(resource, params=params) return data["result"] def query_leads(self, query, return_fields=None): """Query leads by any parameters. query: dict of fields / value to query on return fields: array of which fields should be requested from marketo """ resource = "leads.json" params = { "filterType": ",".join(query.keys()), "filterValues": ",".join(query.values())} if return_fields is not None: params["fields"] = return_fields data = self.auth_get(resource, params=params) return data["result"] def build_resource_url(self, resource): res_url = "%s/%s/%s" % (self.api_endpoint, self.api_version, resource) return res_url def auth_get(self, resource, params=[], page_size=None): """ Make an authenticated GET to Marketo, check success and return dict from json response. page_size: page size, max and default 300 """ headers = {"Authorization": "Bearer %s" % self.auth_token} if page_size is not None: params['batchSize'] = page_size res_url = self.build_resource_url(resource) r = self._session.get(res_url, headers=headers, params=params) r.raise_for_status() data = r.json() if data["success"] is False: err = data["errors"][0] raise Exception("Error %s - %s, calling %s" % (err["code"], err["message"], r.url)) time.sleep(20/80) return data class Lead(object): def __init__(self, client, id): self._client = client self._resource = "leads.json" self.id = id self._data_cache = None self._default_fields = None def __getattr__(self, name): log("Looking for %s" % name) if name not in self.fields: raise AttributeError if name in self._data: return self._data[name] elif name in self.fields: self._load_data(name) return self._data[name] else: raise AttributeError @property def fields(self): return self._client.fields @property def _data(self): if self._data_cache is None: if self._default_fields is not None: self._load_data(self._default_fields) else: self._load_data() return self._data_cache def _load_data(self, fields=None): "Load lead data for fields provided, or use default fields." resource = "leads/%s.json" % (self.id) params = {} if fields is not None: if type(fields) is str: fields = [fields] params = {"fields": ",".join(fields)} result = self._client.auth_get(resource, params)["result"][0] if self._data_cache is not None: newdata = self._data_cache.copy() newdata.update(result) self._data_cache = newdata else: self._data_cache = result class LeadChangeSet: """ REST Resource: activities/leadchanges.json Represent a set of changed leads, only taking into account changed leads, not new leads. TODO: handle new leads """ def __init__(self, client, since, fields, page_size): self.resource = "activities/leadchanges.json" self.client = client self.since = since self.fields = fields self.page_size = page_size self.has_more_result = False self.next_page_token = None self.changes = [] self.fetch_next_page() def __iter__(self): return self def __next__(self): if len(self.changes) == 0 and not self.has_more_result: raise StopIteration if len(self.changes) == 0 and self.has_more_result: self.fetch_next_page() return self.changes.pop(0) def fetch_next_page(self): debug("[mkto] Fetching next page for LeadChangeSet") if self.next_page_token is None: self.next_page_token = self.client.get_paging_token( since=self.since) params = { "fields": ','.join(self.fields), "nextPageToken": self.next_page_token} data = self.client.auth_get(self.resource, params, self.page_size) # If moreResult is true, set flag on object and next page token, if # not, reset them if data["moreResult"]: self.has_more_result = True self.next_page_token = data["nextPageToken"] else: self.has_more_result = False self.next_page_token = None for lead in self.prepare_results(data["result"]): self.changes.append(lead) def prepare_results(self, results): """ Iterates over change results and output an array with changed fields and values """ for c in results: changed_fields = {} changed_fields["id"] = c['leadId'] # if no fields updated -> new lead -> skip if len(c["fields"]) == 0: continue for f in c["fields"]: changed_fields[f["name"]] = f["newValue"] yield changed_fields class PagedMarketoResult: def __init__(self, client, resource, since, fields, page_size): self.resource = resource self.client = client self.since = since self.fields = fields self.page_size = page_size self.has_more_result = False self.next_page_token = None self.changes = [] self.fetch_next_page() def __iter__(self): return self def __next__(self): if len(self.changes) == 0 and not self.has_more_result: raise StopIteration if len(self.changes) == 0 and self.has_more_result: self.fetch_next_page() return self.changes.pop(0) def fetch_next_page(self): debug("fetching next page") if self.next_page_token is None: self.next_page_token = self.client.get_paging_token( since=self.since) params = { "fields": ','.join(self.fields), "nextPageToken": self.next_page_token} data = self.client.auth_get(self.resource, params, self.page_size) # If moreResult is true, set flag on object and next page token, if # not, reset them if data["moreResult"]: self.has_more_result = True self.next_page_token = data["nextPageToken"] else: self.has_more_result = False self.next_page_token = None for lead in self.prepare_results(data["result"]): self.changes.append(lead) def debug(msg): logger = logging.getLogger(__name__) logger.debug(msg) def log(msg): logger = logging.getLogger(__name__) logger.info(msg)
apache-2.0
-1,778,801,031,148,775,700
29.12013
78
0.555244
false
jcassee/django-analytical
tests/unit/test_tag_hubspot.py
1
1602
""" Tests for the HubSpot template tags and filters. """ import pytest from django.http import HttpRequest from django.template import Context from django.test.utils import override_settings from utils import TagTestCase from analytical.templatetags.hubspot import HubSpotNode from analytical.utils import AnalyticalException @override_settings(HUBSPOT_PORTAL_ID='1234') class HubSpotTagTestCase(TagTestCase): """ Tests for the ``hubspot`` template tag. """ def test_tag(self): r = self.render_tag('hubspot', 'hubspot') assert ( "n.id=i;n.src='//js.hs-analytics.net/analytics/'" "+(Math.ceil(new Date()/r)*r)+'/1234.js';" ) in r def test_node(self): r = HubSpotNode().render(Context()) assert ( "n.id=i;n.src='//js.hs-analytics.net/analytics/'" "+(Math.ceil(new Date()/r)*r)+'/1234.js';" ) in r @override_settings(HUBSPOT_PORTAL_ID=None) def test_no_portal_id(self): with pytest.raises(AnalyticalException): HubSpotNode() @override_settings(HUBSPOT_PORTAL_ID='wrong') def test_wrong_portal_id(self): with pytest.raises(AnalyticalException): HubSpotNode() @override_settings(ANALYTICAL_INTERNAL_IPS=['1.1.1.1']) def test_render_internal_ip(self): req = HttpRequest() req.META['REMOTE_ADDR'] = '1.1.1.1' context = Context({'request': req}) r = HubSpotNode().render(context) assert r.startswith('<!-- HubSpot disabled on internal IP address') assert r.endswith('-->')
mit
2,214,514,004,506,412,000
29.807692
75
0.631086
false
walty8/trac
tracopt/ticket/deleter.py
1
7165
# -*- coding: utf-8 -*- # # Copyright (C) 2010 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consists of voluntary contributions made by many # individuals. For the exact contribution history, see the revision # history and logs, available at http://trac.edgewall.org/log/. from genshi.builder import tag from genshi.filters import Transformer from genshi.filters.transform import StreamBuffer from trac.attachment import Attachment from trac.core import Component, TracError, implements from trac.ticket.model import Ticket from trac.ticket.web_ui import TicketModule from trac.util import get_reporter_id from trac.util.datefmt import from_utimestamp from trac.util.presentation import captioned_button from trac.util.translation import _ from trac.web.api import IRequestFilter, IRequestHandler, ITemplateStreamFilter from trac.web.chrome import ITemplateProvider, add_notice, add_stylesheet class TicketDeleter(Component): """Ticket and ticket comment deleter. This component allows deleting ticket comments and complete tickets. For users having `TICKET_ADMIN` permission, it adds a "Delete" button next to each "Reply" button on the page. The button in the ticket description requests deletion of the complete ticket, and the buttons in the change history request deletion of a single comment. '''Comment and ticket deletion are irreversible (and therefore ''dangerous'') operations.''' For that reason, a confirmation step is requested. The confirmation page shows the ticket box (in the case of a ticket deletion) or the ticket change (in the case of a comment deletion). """ implements(ITemplateProvider, ITemplateStreamFilter, IRequestFilter, IRequestHandler) # ITemplateProvider methods def get_htdocs_dirs(self): return [] def get_templates_dirs(self): from pkg_resources import resource_filename return [resource_filename(__name__, 'templates')] # ITemplateStreamFilter methods def filter_stream(self, req, method, filename, stream, data): if filename not in ('ticket.html', 'ticket_preview.html'): return stream ticket = data.get('ticket') if not (ticket and ticket.exists and 'TICKET_ADMIN' in req.perm(ticket.resource)): return stream # Insert "Delete" buttons for ticket description and each comment def delete_ticket(): return tag.form( tag.div( tag.input(type='hidden', name='action', value='delete'), tag.input(type='submit', value=captioned_button(req, u'–', # 'EN DASH' _("Delete")), title=_('Delete ticket'), class_="trac-delete"), class_="inlinebuttons"), action='#', method='get') def delete_comment(): for event in buffer: cnum, cdate = event[1][1].get('id')[12:].split('-', 1) return tag.form( tag.div( tag.input(type='hidden', name='action', value='delete-comment'), tag.input(type='hidden', name='cnum', value=cnum), tag.input(type='hidden', name='cdate', value=cdate), tag.input(type='submit', value=captioned_button(req, u'–', # 'EN DASH' _("Delete")), title=_('Delete comment %(num)s', num=cnum), class_="trac-delete"), class_="inlinebuttons"), action='#', method='get') buffer = StreamBuffer() return stream | Transformer('//div[@class="description"]' '/h3[@id="comment:description"]') \ .after(delete_ticket).end() \ .select('//div[starts-with(@class, "change")]/@id') \ .copy(buffer).end() \ .select('//div[starts-with(@class, "change") and @id]' '//div[@class="trac-ticket-buttons"]') \ .append(delete_comment) # IRequestFilter methods def pre_process_request(self, req, handler): if handler is not TicketModule(self.env): return handler action = req.args.get('action') if action in ('delete', 'delete-comment'): return self else: return handler def post_process_request(self, req, template, data, content_type): return template, data, content_type # IRequestHandler methods def match_request(self, req): return False def process_request(self, req): id = int(req.args.get('id')) req.perm('ticket', id).require('TICKET_ADMIN') ticket = Ticket(self.env, id) action = req.args['action'] cnum = req.args.get('cnum') if req.method == 'POST': if 'cancel' in req.args: href = req.href.ticket(id) if action == 'delete-comment': href += '#comment:%s' % cnum req.redirect(href) if action == 'delete': ticket.delete() add_notice(req, _('The ticket #%(id)s has been deleted.', id=ticket.id)) req.redirect(req.href()) elif action == 'delete-comment': cdate = from_utimestamp(long(req.args.get('cdate'))) ticket.delete_change(cdate=cdate) add_notice(req, _('The ticket comment %(num)s on ticket ' '#%(id)s has been deleted.', num=cnum, id=ticket.id)) req.redirect(req.href.ticket(id)) tm = TicketModule(self.env) data = tm._prepare_data(req, ticket) tm._insert_ticket_data(req, ticket, data, get_reporter_id(req, 'author'), {}) data.update(action=action, cdate=None) if action == 'delete-comment': data['cdate'] = req.args.get('cdate') cdate = from_utimestamp(long(data['cdate'])) for change in data['changes']: if change.get('date') == cdate: data['change'] = change data['cnum'] = change.get('cnum') break else: raise TracError(_('Comment %(num)s not found', num=cnum)) elif action == 'delete': attachments = Attachment.select(self.env, ticket.realm, ticket.id) data.update(attachments=list(attachments)) add_stylesheet(req, 'common/css/ticket.css') return 'ticket_delete.html', data, None
bsd-3-clause
-3,726,745,054,534,510,600
40.155172
79
0.561933
false
ggaughan/dee
darwen.py
1
3332
from Dee import Relation, Key, Tuple, QUOTA, MAX, MIN, IS_EMPTY, COUNT, GENERATE from DeeDatabase import Database class darwen_Database(Database): def __init__(self, name): """Define initial relvars and their initial values here (Called once on database creation)""" Database.__init__(self, name) if 'IS_CALLED' not in self: print "Adding IS_CALLED..." self.IS_CALLED = Relation(['StudentId', 'Name'], [('S1', 'Anne'), ('S2', 'Boris'), ('S3', 'Cindy'), ('S4', 'Devinder'), ('S5', 'Boris'), ] ) if 'IS_ENROLLED_ON' not in self: print "Adding IS_ENROLLED_ON..." self.IS_ENROLLED_ON = Relation(['StudentId', 'CourseId'], [('S1', 'C1'), ('S1', 'C2'), ('S2', 'C1'), ('S3', 'C3'), ('S4', 'C1'), ] ) if 'COURSE' not in self: print "Adding COURSE..." self.COURSE = Relation(['CourseId', 'Title'], [('C1', 'Database'), ('C2', 'HCI'), ('C3', 'Op Systems'), ('C4', 'Programming'), ] ) if 'EXAM_MARK' not in self: print "Adding EXAM_MARK..." self.EXAM_MARK = Relation(['StudentId', 'CourseId', 'Mark'], [('S1', 'C1', 85), ('S1', 'C2', 49), ('S2', 'C1', 49), ('S3', 'C3', 66), ('S4', 'C1', 93), ] ) def _vinit(self): """Define virtual relvars/relconsts (Called repeatedly, e.g. after database load from disk or commit) """ Database._vinit(self) if 'C_ER' not in self: print "Defining C_ER..." #this will always be the case, even when re-loading: we don't store relations with callable bodies self.C_ER = Relation(['CourseId', 'Exam_Result'], self.vC_ER, {'pk':(Key,['CourseId'])}) def vC_ER(self): return self.COURSE.extend(['Exam_Result'], lambda t:{'Exam_Result': (self.EXAM_MARK & GENERATE({'CourseId':t.CourseId}) )(['StudentId', 'Mark'])} )(['CourseId', 'Exam_Result']) #fixed #Load or create the database darwen = Database.open(darwen_Database, "darwen") ################################### if __name__=="__main__": print darwen.relations
mit
8,448,689,067,475,852,000
40.717949
112
0.344238
false
diofeher/django-nfa
django/contrib/admin/widgets.py
1
8956
""" Form Widget classes specific to the Django admin site. """ import copy from django import newforms as forms from django.newforms.widgets import RadioFieldRenderer from django.newforms.util import flatatt from django.utils.datastructures import MultiValueDict from django.utils.text import capfirst, truncate_words from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe from django.utils.encoding import force_unicode from django.conf import settings class FilteredSelectMultiple(forms.SelectMultiple): """ A SelectMultiple with a JavaScript filter interface. Note that the resulting JavaScript assumes that the SelectFilter2.js library and its dependencies have been loaded in the HTML page. """ def __init__(self, verbose_name, is_stacked, attrs=None, choices=()): self.verbose_name = verbose_name self.is_stacked = is_stacked super(FilteredSelectMultiple, self).__init__(attrs, choices) def render(self, name, value, attrs=None, choices=()): from django.conf import settings output = [super(FilteredSelectMultiple, self).render(name, value, attrs, choices)] output.append(u'<script type="text/javascript">addEvent(window, "load", function(e) {') # TODO: "id_" is hard-coded here. This should instead use the correct # API to determine the ID dynamically. output.append(u'SelectFilter.init("id_%s", "%s", %s, "%s"); });</script>\n' % \ (name, self.verbose_name.replace('"', '\\"'), int(self.is_stacked), settings.ADMIN_MEDIA_PREFIX)) return mark_safe(u''.join(output)) class AdminDateWidget(forms.TextInput): class Media: js = (settings.ADMIN_MEDIA_PREFIX + "js/calendar.js", settings.ADMIN_MEDIA_PREFIX + "js/admin/DateTimeShortcuts.js") def __init__(self, attrs={}): super(AdminDateWidget, self).__init__(attrs={'class': 'vDateField', 'size': '10'}) class AdminTimeWidget(forms.TextInput): class Media: js = (settings.ADMIN_MEDIA_PREFIX + "js/calendar.js", settings.ADMIN_MEDIA_PREFIX + "js/admin/DateTimeShortcuts.js") def __init__(self, attrs={}): super(AdminTimeWidget, self).__init__(attrs={'class': 'vTimeField', 'size': '8'}) class AdminSplitDateTime(forms.SplitDateTimeWidget): """ A SplitDateTime Widget that has some admin-specific styling. """ def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs) def format_output(self, rendered_widgets): return mark_safe(u'<p class="datetime">%s %s<br />%s %s</p>' % \ (_('Date:'), rendered_widgets[0], _('Time:'), rendered_widgets[1])) class AdminRadioFieldRenderer(RadioFieldRenderer): def render(self): """Outputs a <ul> for this set of radio fields.""" return mark_safe(u'<ul%s>\n%s\n</ul>' % ( flatatt(self.attrs), u'\n'.join([u'<li>%s</li>' % force_unicode(w) for w in self])) ) class AdminRadioSelect(forms.RadioSelect): renderer = AdminRadioFieldRenderer class AdminFileWidget(forms.FileInput): """ A FileField Widget that shows its current value if it has one. """ def __init__(self, attrs={}): super(AdminFileWidget, self).__init__(attrs) def render(self, name, value, attrs=None): from django.conf import settings output = [] if value: output.append('%s <a target="_blank" href="%s%s">%s</a> <br />%s ' % \ (_('Currently:'), settings.MEDIA_URL, value, value, _('Change:'))) output.append(super(AdminFileWidget, self).render(name, value, attrs)) return mark_safe(u''.join(output)) class ForeignKeyRawIdWidget(forms.TextInput): """ A Widget for displaying ForeignKeys in the "raw_id" interface rather than in a <select> box. """ def __init__(self, rel, attrs=None): self.rel = rel super(ForeignKeyRawIdWidget, self).__init__(attrs) def render(self, name, value, attrs=None): from django.conf import settings related_url = '../../../%s/%s/' % (self.rel.to._meta.app_label, self.rel.to._meta.object_name.lower()) if self.rel.limit_choices_to: url = '?' + '&amp;'.join(['%s=%s' % (k, v) for k, v in self.rel.limit_choices_to.items()]) else: url = '' if not attrs.has_key('class'): attrs['class'] = 'vForeignKeyRawIdAdminField' # The JavaScript looks for this hook. output = [super(ForeignKeyRawIdWidget, self).render(name, value, attrs)] # TODO: "id_" is hard-coded here. This should instead use the correct # API to determine the ID dynamically. output.append('<a href="%s%s" class="related-lookup" id="lookup_id_%s" onclick="return showRelatedObjectLookupPopup(this);"> ' % \ (related_url, url, name)) output.append('<img src="%simg/admin/selector-search.gif" width="16" height="16" alt="Lookup" /></a>' % settings.ADMIN_MEDIA_PREFIX) if value: output.append(self.label_for_value(value)) return mark_safe(u''.join(output)) def label_for_value(self, value): return '&nbsp;<strong>%s</strong>' % \ truncate_words(self.rel.to.objects.get(pk=value), 14) class ManyToManyRawIdWidget(ForeignKeyRawIdWidget): """ A Widget for displaying ManyToMany ids in the "raw_id" interface rather than in a <select multiple> box. """ def __init__(self, rel, attrs=None): super(ManyToManyRawIdWidget, self).__init__(rel, attrs) def render(self, name, value, attrs=None): attrs['class'] = 'vManyToManyRawIdAdminField' if value: value = ','.join([str(v) for v in value]) else: value = '' return super(ManyToManyRawIdWidget, self).render(name, value, attrs) def label_for_value(self, value): return '' def value_from_datadict(self, data, files, name): value = data.get(name, None) if value and ',' in value: return data[name].split(',') if value: return [value] return None def _has_changed(self, initial, data): if initial is None: initial = [] if data is None: data = [] if len(initial) != len(data): return True for pk1, pk2 in zip(initial, data): if force_unicode(pk1) != force_unicode(pk2): return True return False class RelatedFieldWidgetWrapper(forms.Widget): """ This class is a wrapper to a given widget to add the add icon for the admin interface. """ def __init__(self, widget, rel, admin_site): self.is_hidden = widget.is_hidden self.needs_multipart_form = widget.needs_multipart_form self.attrs = widget.attrs self.choices = widget.choices self.widget = widget self.rel = rel # so we can check if the related object is registered with this AdminSite self.admin_site = admin_site def __deepcopy__(self, memo): obj = copy.copy(self) obj.widget = copy.deepcopy(self.widget, memo) obj.attrs = self.widget.attrs memo[id(self)] = obj return obj def render(self, name, value, *args, **kwargs): from django.conf import settings rel_to = self.rel.to related_url = '../../../%s/%s/' % (rel_to._meta.app_label, rel_to._meta.object_name.lower()) self.widget.choices = self.choices output = [self.widget.render(name, value, *args, **kwargs)] if rel_to in self.admin_site._registry: # If the related object has an admin interface: # TODO: "id_" is hard-coded here. This should instead use the correct # API to determine the ID dynamically. output.append(u'<a href="%sadd/" class="add-another" id="add_id_%s" onclick="return showAddAnotherPopup(this);"> ' % \ (related_url, name)) output.append(u'<img src="%simg/admin/icon_addlink.gif" width="10" height="10" alt="Add Another"/></a>' % settings.ADMIN_MEDIA_PREFIX) return mark_safe(u''.join(output)) def build_attrs(self, extra_attrs=None, **kwargs): "Helper function for building an attribute dictionary." self.attrs = self.widget.build_attrs(extra_attrs=None, **kwargs) return self.attrs def value_from_datadict(self, data, files, name): return self.widget.value_from_datadict(data, files, name) def _has_changed(self, initial, data): return self.widget._has_changed(initial, data) def id_for_label(self, id_): return self.widget.id_for_label(id_)
bsd-3-clause
2,662,747,587,263,736,300
40.655814
146
0.621706
false
chdb/DhammaMap
app/cryptoken.py
1
6464
#!/usr/bin/python # -*- coding: utf-8 -*- #from __future__ import unicode_literals import hashlib import hmac import os import json import utils as u import widget as W import logging from base64 import urlsafe_b64encode\ , urlsafe_b64decode class Base64Error (Exception): '''invalid Base64 character or incorrect padding''' def decodeToken (token, expected): try: td = _decode (token) valid, expired = td.valid (expected) if valid: if expected == 'session': td.data['_ts'] = td.timeStamp return td.data, expired except Base64Error: logging.warning ('invalid Base64 in %s Token: %r', type, token) except: logging.exception('unexpected exception decoding %s token : %r', type, token) return None, False def encodeVerifyToken (data, tt): # tt = _tokenType (tt) assert tt in ['signUp' ,'pw1' ,'pw2' ], 'invalid TokenType: %s' % tt return _encode (tt, data) def encodeSessionToken (ssn):#, user=None): data = dict(ssn) if '_userID' in ssn: return _encode ('auth', data) return _encode ('anon', data) TokenTypes = ( 'anon' , 'auth' , 'signUp' , 'pw1' ) def _tokenTypeCode (tt): return TokenTypes.index(tt) def _tokenType (code): return TokenTypes [code] #......................................... class _TokenData (object): def __init__ (_s, token, tt, obj, bM, ts): _s.badMac = bM _s.tokenType = tt _s.timeStamp = ts _s.token = token _s.data = obj def maxAge (_s): if _s.tokenType =='auth' : return u.config('maxIdleAuth') elif _s.tokenType =='signUp': return u.config('maxAgeSignUpTok') elif _s.tokenType =='pw1' : return u.config('maxAgePasswordTok') else: raise RuntimeError ('invalid token type') def valid (_s, expected): """ Checks encryption validity and expiry: whether the token is younger than maxAge seconds. Use neutral evaluation pathways to beat timing attacks. NB: return only success or failure - log shows why it failed but user mustn't know ! """ if expected == 'session': badType = (_s.tokenType != 'anon' and _s.tokenType != 'auth') else: badType = _s.tokenType != expected if _s.tokenType == 'anon': expired = False else: expired = not u.validTimeStamp (_s.timeStamp, _s.maxAge()) badData = _s.data is None # and (type(_s.data) == dict) isValid = False # check booleans in order of their initialisation if _s.badMac: x ='Invalid MAC' elif badType: x ='Invalid token type:{} expected:{}'.format(_s.tokenType, expected) elif badData: x ='Invalid data object' else: isValid = True if expired: logging.debug ('Token expired: %r', _s.token) #no warning log if merely expired if not isValid: logging.warning ('%s in Token: %r', x, _s.token) return isValid, expired #......................................... # Some global constants to hold the lengths of component substrings of the token CH = 1 TS = 4 UID = 8 MAC = 20 def _hash (msg, ts): """hmac output of sha1 is 20 bytes irrespective of msg length""" k = W.W.keys (ts) return hmac.new (k, msg, hashlib.sha1).digest() def _serialize (data): '''Generic data is stored in the token. The data could be a dict or any other serialisable type. However the data size is limited because currently it all goes into one cookie and there is a max cookie size for some browsers so we place a limit in session.save() ''' # ToDo: replace json with binary protocol cpickle # ToDo compression of data thats too long to fit otherwise: # data = json.encode (data) # if len(data) > data_max: # 4K minus the other fields # level = (len(data) - data_max) * K # experiment! or use level = 9 # data = zlib.compress( data, level) # if len(data) > data_max: # assert False, 'oh dear!' todo - save some? data in datastore # return data, True # return data, False # todo: encode a boolean in kch to indicate whether compressed #logging.debug ('serializing data = %r', data) s = json.dumps (data, separators=(',',':')) #logging.debug('serialized data: %r', s) return s.encode('utf-8') #byte str def _deserialize (data): try: # logging.debug('data1: %r', data) obj = json.loads (data) # logging.debug('obj: %r', obj) return obj # byteify(obj) except Exception, e: logging.exception(e) return None def _encode (tokentype, obj): """ obj is serializable session data returns a token string of base64 chars with iv and encrypted tokentype and data """ tt = _tokenTypeCode (tokentype) logging.debug ('encode tokentype = %r tt = %r',tokentype, tt) now = u.sNow() #logging.debug ('encode tokentype = %r tt = %r',tokentype, tt) data = W._iB.pack (now, tt) # ts + tt data += _serialize (obj) # ts + tt + data h20 = _hash (data, now) return urlsafe_b64encode (data + h20) # ts + tt + data + mac def _decode (token): """inverse of encode: return _TokenData""" try: bytes = urlsafe_b64decode (token) # ts + tt + data + mac except TypeError: logging.warning('Base64 Error: token = %r', token) logging.exception('Base64 Error: ') raise Base64Error ts, tt = W._iB.unpack_from (bytes) ttype = _tokenType (tt) #logging.debug ('decode tokentype = %r tt = %r token = %s',ttype, tt, token) preDataLen = TS+CH data = bytes[ :-MAC] mac1 = bytes[-MAC: ] mac2 = _hash (data, ts) badMac = not u.sameStr (mac1, mac2) data = _deserialize (data [preDataLen: ]) # logging.debug('data: %r', data) return _TokenData (token, ttype, data, badMac, ts)
mit
-6,609,240,872,610,904,000
35.942857
100
0.550124
false
SciLifeLab/bcbio-nextgen
bcbio/rnaseq/count.py
1
12286
""" count number of reads mapping to features of transcripts """ import os import sys import itertools # soft imports try: import HTSeq import pandas as pd import gffutils except ImportError: HTSeq, pd, gffutils = None, None, None from bcbio.utils import file_exists from bcbio.distributed.transaction import file_transaction from bcbio.log import logger from bcbio import bam import bcbio.pipeline.datadict as dd def _get_files(data): mapped = bam.mapped(data["work_bam"], data["config"]) in_file = bam.sort(mapped, data["config"], order="queryname") gtf_file = dd.get_gtf_file(data) work_dir = dd.get_work_dir(data) out_dir = os.path.join(work_dir, "htseq-count") sample_name = dd.get_sample_name(data) out_file = os.path.join(out_dir, sample_name + ".counts") stats_file = os.path.join(out_dir, sample_name + ".stats") return in_file, gtf_file, out_file, stats_file def invert_strand(iv): iv2 = iv.copy() if iv2.strand == "+": iv2.strand = "-" elif iv2.strand == "-": iv2.strand = "+" else: raise ValueError("Illegal strand") return iv2 class UnknownChrom(Exception): pass def _get_stranded_flag(data): strand_flag = {"unstranded": "no", "firststrand": "reverse", "secondstrand": "yes"} stranded = dd.get_strandedness(data, "unstranded").lower() assert stranded in strand_flag, ("%s is not a valid strandedness value. " "Valid values are 'firststrand', 'secondstrand', " "and 'unstranded") return strand_flag[stranded] def htseq_count(data): """ adapted from Simon Anders htseq-count.py script http://www-huber.embl.de/users/anders/HTSeq/doc/count.html """ sam_filename, gff_filename, out_file, stats_file = _get_files(data) stranded = _get_stranded_flag(data["config"]) overlap_mode = "union" feature_type = "exon" id_attribute = "gene_id" minaqual = 0 if file_exists(out_file): return out_file logger.info("Counting reads mapping to exons in %s using %s as the " "annotation and strandedness as %s." % (os.path.basename(sam_filename), os.path.basename(gff_filename), dd.get_strandedness(data))) features = HTSeq.GenomicArrayOfSets("auto", stranded != "no") counts = {} # Try to open samfile to fail early in case it is not there open(sam_filename).close() gff = HTSeq.GFF_Reader(gff_filename) i = 0 try: for f in gff: if f.type == feature_type: try: feature_id = f.attr[id_attribute] except KeyError: sys.exit("Feature %s does not contain a '%s' attribute" % (f.name, id_attribute)) if stranded != "no" and f.iv.strand == ".": sys.exit("Feature %s at %s does not have strand " "information but you are running htseq-count " "in stranded mode. Use '--stranded=no'." % (f.name, f.iv)) features[f.iv] += feature_id counts[f.attr[id_attribute]] = 0 i += 1 if i % 100000 == 0: sys.stderr.write("%d GFF lines processed.\n" % i) except: sys.stderr.write("Error occured in %s.\n" % gff.get_line_number_string()) raise sys.stderr.write("%d GFF lines processed.\n" % i) if len(counts) == 0: sys.stderr.write("Warning: No features of type '%s' found.\n" % feature_type) try: align_reader = htseq_reader(sam_filename) first_read = iter(align_reader).next() pe_mode = first_read.paired_end except: sys.stderr.write("Error occured when reading first line of sam " "file.\n") raise try: if pe_mode: read_seq_pe_file = align_reader read_seq = HTSeq.pair_SAM_alignments(align_reader) empty = 0 ambiguous = 0 notaligned = 0 lowqual = 0 nonunique = 0 i = 0 for r in read_seq: i += 1 if not pe_mode: if not r.aligned: notaligned += 1 continue try: if r.optional_field("NH") > 1: nonunique += 1 continue except KeyError: pass if r.aQual < minaqual: lowqual += 1 continue if stranded != "reverse": iv_seq = (co.ref_iv for co in r.cigar if co.type == "M" and co.size > 0) else: iv_seq = (invert_strand(co.ref_iv) for co in r.cigar if co.type == "M" and co.size > 0) else: if r[0] is not None and r[0].aligned: if stranded != "reverse": iv_seq = (co.ref_iv for co in r[0].cigar if co.type == "M" and co.size > 0) else: iv_seq = (invert_strand(co.ref_iv) for co in r[0].cigar if co.type == "M" and co.size > 0) else: iv_seq = tuple() if r[1] is not None and r[1].aligned: if stranded != "reverse": iv_seq = itertools.chain(iv_seq, (invert_strand(co.ref_iv) for co in r[1].cigar if co.type == "M" and co.size > 0)) else: iv_seq = itertools.chain(iv_seq, (co.ref_iv for co in r[1].cigar if co.type == "M" and co.size > 0)) else: if (r[0] is None) or not (r[0].aligned): notaligned += 1 continue try: if (r[0] is not None and r[0].optional_field("NH") > 1) or \ (r[1] is not None and r[1].optional_field("NH") > 1): nonunique += 1 continue except KeyError: pass if (r[0] and r[0].aQual < minaqual) or (r[1] and r[1].aQual < minaqual): lowqual += 1 continue try: if overlap_mode == "union": fs = set() for iv in iv_seq: if iv.chrom not in features.chrom_vectors: raise UnknownChrom for iv2, fs2 in features[iv].steps(): fs = fs.union(fs2) elif (overlap_mode == "intersection-strict" or overlap_mode == "intersection-nonempty"): fs = None for iv in iv_seq: if iv.chrom not in features.chrom_vectors: raise UnknownChrom for iv2, fs2 in features[iv].steps(): if (len(fs2) > 0 or overlap_mode == "intersection-strict"): if fs is None: fs = fs2.copy() else: fs = fs.intersection(fs2) else: sys.exit("Illegal overlap mode.") if fs is None or len(fs) == 0: empty += 1 elif len(fs) > 1: ambiguous += 1 else: counts[list(fs)[0]] += 1 except UnknownChrom: if not pe_mode: rr = r else: rr = r[0] if r[0] is not None else r[1] empty += 1 if i % 100000 == 0: sys.stderr.write("%d sam %s processed.\n" % (i, "lines " if not pe_mode else "line pairs")) except: if not pe_mode: sys.stderr.write("Error occured in %s.\n" % read_seq.get_line_number_string()) else: sys.stderr.write("Error occured in %s.\n" % read_seq_pe_file.get_line_number_string()) raise sys.stderr.write("%d sam %s processed.\n" % (i, "lines " if not pe_mode else "line pairs")) with file_transaction(data, out_file) as tmp_out_file: with open(tmp_out_file, "w") as out_handle: on_feature = 0 for fn in sorted(counts.keys()): on_feature += counts[fn] out_handle.write("%s\t%d\n" % (fn, counts[fn])) with file_transaction(data, stats_file) as tmp_stats_file: with open(tmp_stats_file, "w") as out_handle: out_handle.write("on_feature\t%d\n" % on_feature) out_handle.write("no_feature\t%d\n" % empty) out_handle.write("ambiguous\t%d\n" % ambiguous) out_handle.write("too_low_aQual\t%d\n" % lowqual) out_handle.write("not_aligned\t%d\n" % notaligned) out_handle.write("alignment_not_unique\t%d\n" % nonunique) return out_file def combine_count_files(files, out_file=None, ext=".fpkm"): """ combine a set of count files into a single combined file """ assert all([file_exists(x) for x in files]), \ "Some count files in %s do not exist." % files for f in files: assert file_exists(f), "%s does not exist or is empty." % f col_names = [os.path.basename(x.split(ext)[0]) for x in files] if not out_file: out_dir = os.path.join(os.path.dirname(files[0])) out_file = os.path.join(out_dir, "combined.counts") if file_exists(out_file): return out_file df = pd.io.parsers.read_table(f, sep="\t", index_col=0, header=None, names=[col_names[0]]) for i, f in enumerate(files): if i == 0: df = pd.io.parsers.read_table(f, sep="\t", index_col=0, header=None, names=[col_names[0]]) else: df = df.join(pd.io.parsers.read_table(f, sep="\t", index_col=0, header=None, names=[col_names[i]])) df.to_csv(out_file, sep="\t", index_label="id") return out_file def annotate_combined_count_file(count_file, gtf_file, out_file=None): dbfn = gtf_file + ".db" if not file_exists(dbfn): return None if not gffutils: return None db = gffutils.FeatureDB(dbfn, keep_order=True) if not out_file: out_dir = os.path.dirname(count_file) out_file = os.path.join(out_dir, "annotated_combined.counts") # if the genes don't have a gene_id or gene_name set, bail out try: symbol_lookup = {f['gene_id'][0]: f['gene_name'][0] for f in db.features_of_type('exon')} except KeyError: return None df = pd.io.parsers.read_table(count_file, sep="\t", index_col=0, header=0) df['symbol'] = df.apply(lambda x: symbol_lookup.get(x.name, ""), axis=1) df.to_csv(out_file, sep="\t", index_label="id") return out_file def htseq_reader(align_file): """ returns a read-by-read sequence reader for a BAM or SAM file """ if bam.is_sam(align_file): read_seq = HTSeq.SAM_Reader(align_file) elif bam.is_bam(align_file): read_seq = HTSeq.BAM_Reader(align_file) else: logger.error("%s is not a SAM or BAM file" % (align_file)) sys.exit(1) return read_seq
mit
-7,574,525,932,074,615,000
36.006024
108
0.47664
false
hotdoc/hotdoc_gi_extension
setup.py
1
1887
# -*- coding: utf-8 -*- # # Copyright © 2015,2016 Mathieu Duponchelle <[email protected]> # Copyright © 2015,2016 Collabora Ltd # # This library is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your option) # any later version. # # This library is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see <http://www.gnu.org/licenses/>. import os from setuptools import setup, find_packages with open(os.path.join('hotdoc_gi_extension', 'VERSION.txt'), 'r') as _: VERSION = _.read().strip() setup( name = "hotdoc_gi_extension", version = VERSION, keywords = "gobject-introspection C hotdoc", url='https://github.com/hotdoc/hotdoc_gi_extension', author_email = '[email protected]', license = 'LGPLv2.1+', description = "An extension for hotdoc that parses gir files", author = "Mathieu Duponchelle", packages = find_packages(), package_data = { '': ['*.html'], 'hotdoc_gi_extension': ['VERSION.txt'], 'hotdoc_gi_extension.transition_scripts': ['translate_sections.sh'], }, scripts=['hotdoc_gi_extension/transition_scripts/hotdoc_gtk_doc_porter', 'hotdoc_gi_extension/transition_scripts/hotdoc_gtk_doc_scan_parser'], entry_points = {'hotdoc.extensions': 'get_extension_classes = hotdoc_gi_extension.gi_extension:get_extension_classes'}, install_requires = [ 'lxml', 'pyyaml', ], )
lgpl-2.1
-3,706,372,489,089,509,000
35.960784
123
0.69443
false
pugpe/pugpe
apps/cert/management/commands/send_certificates.py
1
2215
# -*- coding: utf-8 -*- import traceback from datetime import timedelta from django.core import mail from django.core.mail import EmailMultiAlternatives, mail_admins from django.core.management.base import BaseCommand from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ from django.contrib.sites.models import Site from django.conf import settings from django.utils import translation from django.utils import timezone from cert.models import Attendee class Command(BaseCommand): help = u'Send certificate e-mails' def get_email(self, attendee): translation.activate(settings.LANGUAGE_CODE) subject = _(u'Certificado de participação | PUG-PE') from_email = settings.DEFAULT_FROM_EMAIL ctx = { 'site': Site.objects.get_current().domain, 'event': attendee.event, 'attendee': attendee, } text_content = render_to_string('cert/cert_email.txt', ctx) html_content = render_to_string('cert/cert_email.html', ctx) msg = EmailMultiAlternatives( subject, text_content, from_email, [attendee.email], ) msg.attach_alternative(html_content, "text/html") return msg def handle(self, *args, **options): connection = mail.get_connection() num_emails = 0 attendees = Attendee.objects.filter(sent_date__isnull=True) # Evitar envio para eventos muito antigos attendees = attendees.filter( pub_date__gte=timezone.now() - timedelta(days=10), ) for attendee in attendees: msg = self.get_email(attendee) try: num_emails += connection.send_messages([msg]) except Exception as exc: subject = _(u'PUG-PE: Problema envio certificado') body = 'except: '.format(exc) body += traceback.format_exc() mail_admins(subject, body) else: attendee.sent_date = timezone.now() attendee.save() self.stdout.write( unicode(_(u'Foram enviados {0} emails\n'.format(num_emails))), )
mit
7,008,236,078,179,404,000
31.072464
74
0.623588
false
kodat/odoo-module-template
odoo_module_template/model.py
1
1936
# -*- coding: utf-8 -*- # Bashir Idirs (Alsuty) # Copyright (C) 2016. # # This Code is free: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from openerp import models,fields class FirstModel(models.Model): _name= 'template.firstmodel' image = fields.Binary('Image') name = fields.Char('Name', required=True) select_field = fields.Selection(string="Type", selection=[('type1', 'Type1'), ('type2', 'Type2'), ('type3', 'Type3'),], required=True) boolean_field = fields.Boolean('Check') integer_field = fields.Integer('Integer Number') float_field = fields.Float('Float Value') many2one_field = fields.Many2one('template.secondmodel', 'Many2one') many2many_ids = fields.Many2many('template.thirdmodel', 'many2many_relation', 'firstmodel_id', 'thirdmodel_id', string='Many2many') ony2many_fields = fields.One2many('template.forthmodel', 'firstmodel_id', string='One2many') class SecondModel(models.Model): _name = 'template.secondmodel' name = fields.Char('Name') class ThirdModel(models.Model): _name = 'template.thirdmodel' name = fields.Char('Name') class ForthModel(models.Model): _name = 'template.forthmodel' name = fields.Char('Name') firstmodel_id= fields.Many2one('template.firstmodel')
gpl-3.0
7,697,741,544,575,525,000
30.813559
77
0.681818
false
sixfeetup/cloud-custodian
c7n/resources/waf.py
1
1475
# Copyright 2016-2017 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import, division, print_function, unicode_literals from c7n.manager import resources from c7n.query import QueryResourceManager @resources.register('waf') class WAF(QueryResourceManager): class resource_type(object): service = "waf" enum_spec = ("list_web_acls", "WebACLs", None) detail_spec = ("get_web_acl", "WebACLId", "WebACLId", "WebACL") name = "Name" id = "WebACLId" dimension = "WebACL" filter_name = None @resources.register('waf-regional') class RegionalWAF(QueryResourceManager): class resource_type(object): service = "waf-regional" enum_spec = ("list_web_acls", "WebACLs", None) detail_spec = ("get_web_acl", "WebACLId", "WebACLId", "WebACL") name = "Name" id = "WebACLId" dimension = "WebACL" filter_name = None
apache-2.0
-2,341,126,569,578,517,500
33.302326
82
0.684068
false
JoseBlanca/vcf_crumbs
test/test_utils.py
1
4369
# Copyright 2013 Jose Blanca, Peio Ziarsolo, COMAV-Univ. Politecnica Valencia # This file is part of seq_crumbs. # vcf_crumbs is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # vcf_crumbs is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with vcf_crumbs. If not, see <http://www.gnu.org/licenses/>. import unittest from tempfile import NamedTemporaryFile from os.path import exists from os.path import join as pjoin from os import remove from StringIO import StringIO import gzip from vcf_crumbs.utils.file_utils import (compress_with_bgzip, uncompress_gzip, index_vcf_with_tabix, TEST_DATA_DIR, _build_template_fhand) # Method could be a function # pylint: disable=R0201 # Too many public methods # pylint: disable=R0904 # Missing docstring # pylint: disable=C0111 VCF = '''##fileformat=VCFv4.1 ##fileDate=20090805 ##source=myImputationProgramV3.1 ##reference=file:///seq/references/1000GenomesPilot-NCBI36.fasta ##contig=<ID=20,length=62435964,assembly=B36> ##phasing=partial ##INFO=<ID=NS,Number=1,Type=Integer,Description="Number_of_Samples_With_Data"> ##INFO=<ID=DP,Number=1,Type=Integer,Description="Total_Depth"> ##INFO=<ID=AF,Number=A,Type=Float,Description="Allele_Frequency"> ##INFO=<ID=AA,Number=1,Type=String,Description="Ancestral_Allele"> ##INFO=<ID=DB,Number=0,Type=Flag,Description="dbSNP membership,build_129"> ##INFO=<ID=H2,Number=0,Type=Flag,Description="HapMap2_membership"> ##FILTER=<ID=q10,Description="Quality_below_10"> ##FILTER=<ID=s50,Description="Less_than_50%_of_samples_have_data"> ##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype"> ##FORMAT=<ID=GQ,Number=1,Type=Integer,Description="Genotype_Quality"> ##FORMAT=<ID=DP,Number=1,Type=Integer,Description="Read_Depth"> ##FORMAT=<ID=HQ,Number=2,Type=Integer,Description="Haplotype_Quality"> #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA00001 NA00002 NA00003 20 14370 rs6054257 G A 29 PASS NS=3;DP=14;AF=0.5;DB;H2 GT:GQ:DP:HQ 0|0:48:1:51,51 1|0:48:8:51,51 1/1:43:5:.,. 20 17330 . T A 3 q10 NS=3;DP=11;AF=0.017 GT:GQ:DP:HQ 0|0:49:3:58,50 0|1:3:5:65,3 0/0:41:3 ''' class CompressTest(unittest.TestCase): def test_bgzip_compression(self): orig = 'hola\ncaracola\n' orig_fhand = NamedTemporaryFile() orig_fhand.write(orig) orig_fhand.flush() compressed_fhand = NamedTemporaryFile(suffix='.gz') compress_with_bgzip(orig_fhand, compressed_fhand) compressed_fhand.seek(0) compressed = compressed_fhand.read() orig_fhand.seek(0) assert orig_fhand.read() == orig uncompressed_fhand = NamedTemporaryFile() uncompress_gzip(compressed_fhand, uncompressed_fhand) compressed_fhand.seek(0) assert compressed_fhand.read() == compressed uncompressed_fhand.seek(0) assert uncompressed_fhand.read() == orig def test_vcf_index(self): vcf = VCF.replace(' ', '\t') vcf_fhand = NamedTemporaryFile(suffix='.vcf') vcf_fhand.write(vcf) vcf_fhand.flush() compressed_fhand = NamedTemporaryFile(suffix='.vcf.gz') compress_with_bgzip(vcf_fhand, compressed_fhand) index_vcf_with_tabix(compressed_fhand.name) assert exists(compressed_fhand.name + '.tbi') remove(compressed_fhand.name + '.tbi') class BuildTemplateTest(unittest.TestCase): def test_build_template(self): vcf = VCF.replace(' ', '\t') in_fhand = StringIO(vcf) t_fhand = _build_template_fhand(in_fhand) assert 'NA00002\tNA00003\n' in t_fhand.read() # compressed file in_fhand = open(pjoin(TEST_DATA_DIR, 'freebayes_multisample.vcf.gz')) t_fhand = _build_template_fhand(in_fhand) assert 'sample12_gbs\n' in t_fhand.read() if __name__ == "__main__": # import sys;sys.argv = ['', 'FilterTest.test_close_to_filter'] unittest.main()
gpl-3.0
-8,135,101,833,004,531,000
38.718182
109
0.690776
false
tuomas2/serviceform
serviceform/serviceform/models/participation.py
1
4015
# -*- coding: utf-8 -*- # (c) 2017 Tuomas Airaksinen # # This file is part of Serviceform. # # Serviceform is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Serviceform is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Serviceform. If not, see <http://www.gnu.org/licenses/>. from typing import Sequence, TYPE_CHECKING from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.functional import cached_property from .. import utils if TYPE_CHECKING: from .people import Participant class ParticipantLog(models.Model): created_at = models.DateTimeField(auto_now_add=True) participant = models.ForeignKey('serviceform.Participant', on_delete=models.CASCADE) writer_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) writer_id = models.PositiveIntegerField() # Can be either responsible or django user written_by = GenericForeignKey('writer_type', 'writer_id') message = models.TextField() class ParticipationActivity(models.Model): class Meta: unique_together = (('participant', 'activity'),) ordering = ( 'activity__category__category__order', 'activity__category__order', 'activity__order',) participant = models.ForeignKey('serviceform.Participant', on_delete=models.CASCADE) activity = models.ForeignKey('serviceform.Activity', on_delete=models.CASCADE) additional_info = models.CharField(max_length=1024, blank=True, null=True) created_at = models.DateTimeField(auto_now_add=True, null=True) @cached_property def cached_participant(self) -> 'Participant': return utils.get_participant(self.participant_id) def __str__(self): return '%s for %s' % (self.activity, self.participant) @property def choices(self) -> 'Sequence[ParticipationActivityChoice]': return self.choices_set.select_related('activity_choice') @property def additional_info_display(self) -> str: return self.additional_info or '-' class ParticipationActivityChoice(models.Model): class Meta: unique_together = (('activity', 'activity_choice'),) ordering = ('activity_choice__order',) activity = models.ForeignKey(ParticipationActivity, related_name='choices_set', on_delete=models.CASCADE) activity_choice = models.ForeignKey('serviceform.ActivityChoice', on_delete=models.CASCADE) additional_info = models.CharField(max_length=1024, blank=True, null=True) created_at = models.DateTimeField(auto_now_add=True, null=True) @cached_property def cached_participant(self) -> 'Participant': return utils.get_participant(self.activity.participant_id) def __str__(self): return '%s for %s' % (self.activity_choice, self.activity.participant) @property def additional_info_display(self) -> str: return self.additional_info or '-' class QuestionAnswer(models.Model): participant = models.ForeignKey('serviceform.Participant', on_delete=models.CASCADE) question = models.ForeignKey('serviceform.Question', on_delete=models.CASCADE) answer = models.TextField() created_at = models.DateTimeField(auto_now_add=True, null=True) class Meta: ordering = ('question__order',) @cached_property def cached_participant(self) -> 'Participant': return utils.get_participant(self.participant_id) def __str__(self): return '%s: %s' % (self.question.question, self.answer)
gpl-3.0
4,722,200,843,626,066,000
37.615385
95
0.714072
false
mancoast/CPythonPyc_test
fail/301_test_urllib2_localnet.py
1
17211
#!/usr/bin/env python import email import threading import urllib.parse import urllib.request import http.server import unittest import hashlib from test import support # Loopback http server infrastructure class LoopbackHttpServer(http.server.HTTPServer): """HTTP server w/ a few modifications that make it useful for loopback testing purposes. """ def __init__(self, server_address, RequestHandlerClass): http.server.HTTPServer.__init__(self, server_address, RequestHandlerClass) # Set the timeout of our listening socket really low so # that we can stop the server easily. self.socket.settimeout(1.0) def get_request(self): """HTTPServer method, overridden.""" request, client_address = self.socket.accept() # It's a loopback connection, so setting the timeout # really low shouldn't affect anything, but should make # deadlocks less likely to occur. request.settimeout(10.0) return (request, client_address) class LoopbackHttpServerThread(threading.Thread): """Stoppable thread that runs a loopback http server.""" def __init__(self, request_handler): threading.Thread.__init__(self) self._stop_server = False self.ready = threading.Event() request_handler.protocol_version = "HTTP/1.0" self.httpd = LoopbackHttpServer(("127.0.0.1", 0), request_handler) #print "Serving HTTP on %s port %s" % (self.httpd.server_name, # self.httpd.server_port) self.port = self.httpd.server_port def stop(self): """Stops the webserver if it's currently running.""" # Set the stop flag. self._stop_server = True self.join() def run(self): self.ready.set() while not self._stop_server: self.httpd.handle_request() # Authentication infrastructure class DigestAuthHandler: """Handler for performing digest authentication.""" def __init__(self): self._request_num = 0 self._nonces = [] self._users = {} self._realm_name = "Test Realm" self._qop = "auth" def set_qop(self, qop): self._qop = qop def set_users(self, users): assert isinstance(users, dict) self._users = users def set_realm(self, realm): self._realm_name = realm def _generate_nonce(self): self._request_num += 1 nonce = hashlib.md5(str(self._request_num).encode("ascii")).hexdigest() self._nonces.append(nonce) return nonce def _create_auth_dict(self, auth_str): first_space_index = auth_str.find(" ") auth_str = auth_str[first_space_index+1:] parts = auth_str.split(",") auth_dict = {} for part in parts: name, value = part.split("=") name = name.strip() if value[0] == '"' and value[-1] == '"': value = value[1:-1] else: value = value.strip() auth_dict[name] = value return auth_dict def _validate_auth(self, auth_dict, password, method, uri): final_dict = {} final_dict.update(auth_dict) final_dict["password"] = password final_dict["method"] = method final_dict["uri"] = uri HA1_str = "%(username)s:%(realm)s:%(password)s" % final_dict HA1 = hashlib.md5(HA1_str.encode("ascii")).hexdigest() HA2_str = "%(method)s:%(uri)s" % final_dict HA2 = hashlib.md5(HA2_str.encode("ascii")).hexdigest() final_dict["HA1"] = HA1 final_dict["HA2"] = HA2 response_str = "%(HA1)s:%(nonce)s:%(nc)s:" \ "%(cnonce)s:%(qop)s:%(HA2)s" % final_dict response = hashlib.md5(response_str.encode("ascii")).hexdigest() return response == auth_dict["response"] def _return_auth_challenge(self, request_handler): request_handler.send_response(407, "Proxy Authentication Required") request_handler.send_header("Content-Type", "text/html") request_handler.send_header( 'Proxy-Authenticate', 'Digest realm="%s", ' 'qop="%s",' 'nonce="%s", ' % \ (self._realm_name, self._qop, self._generate_nonce())) # XXX: Not sure if we're supposed to add this next header or # not. #request_handler.send_header('Connection', 'close') request_handler.end_headers() request_handler.wfile.write(b"Proxy Authentication Required.") return False def handle_request(self, request_handler): """Performs digest authentication on the given HTTP request handler. Returns True if authentication was successful, False otherwise. If no users have been set, then digest auth is effectively disabled and this method will always return True. """ if len(self._users) == 0: return True if "Proxy-Authorization" not in request_handler.headers: return self._return_auth_challenge(request_handler) else: auth_dict = self._create_auth_dict( request_handler.headers["Proxy-Authorization"] ) if auth_dict["username"] in self._users: password = self._users[ auth_dict["username"] ] else: return self._return_auth_challenge(request_handler) if not auth_dict.get("nonce") in self._nonces: return self._return_auth_challenge(request_handler) else: self._nonces.remove(auth_dict["nonce"]) auth_validated = False # MSIE uses short_path in its validation, but Python's # urllib2 uses the full path, so we're going to see if # either of them works here. for path in [request_handler.path, request_handler.short_path]: if self._validate_auth(auth_dict, password, request_handler.command, path): auth_validated = True if not auth_validated: return self._return_auth_challenge(request_handler) return True # Proxy test infrastructure class FakeProxyHandler(http.server.BaseHTTPRequestHandler): """This is a 'fake proxy' that makes it look like the entire internet has gone down due to a sudden zombie invasion. It main utility is in providing us with authentication support for testing. """ digest_auth_handler = DigestAuthHandler() def log_message(self, format, *args): # Uncomment the next line for debugging. # sys.stderr.write(format % args) pass def do_GET(self): (scm, netloc, path, params, query, fragment) = urllib.parse.urlparse( self.path, "http") self.short_path = path if self.digest_auth_handler.handle_request(self): self.send_response(200, "OK") self.send_header("Content-Type", "text/html") self.end_headers() self.wfile.write(bytes("You've reached %s!<BR>" % self.path, "ascii")) self.wfile.write(b"Our apologies, but our server is down due to " b"a sudden zombie invasion.") # Test cases class ProxyAuthTests(unittest.TestCase): URL = "http://localhost" USER = "tester" PASSWD = "test123" REALM = "TestRealm" def setUp(self): FakeProxyHandler.digest_auth_handler.set_users({ self.USER : self.PASSWD }) FakeProxyHandler.digest_auth_handler.set_realm(self.REALM) self.server = LoopbackHttpServerThread(FakeProxyHandler) self.server.start() self.server.ready.wait() proxy_url = "http://127.0.0.1:%d" % self.server.port handler = urllib.request.ProxyHandler({"http" : proxy_url}) self._digest_auth_handler = urllib.request.ProxyDigestAuthHandler() self.opener = urllib.request.build_opener( handler, self._digest_auth_handler) def tearDown(self): self.server.stop() def test_proxy_with_bad_password_raises_httperror(self): self._digest_auth_handler.add_password(self.REALM, self.URL, self.USER, self.PASSWD+"bad") FakeProxyHandler.digest_auth_handler.set_qop("auth") self.assertRaises(urllib.error.HTTPError, self.opener.open, self.URL) def test_proxy_with_no_password_raises_httperror(self): FakeProxyHandler.digest_auth_handler.set_qop("auth") self.assertRaises(urllib.error.HTTPError, self.opener.open, self.URL) def test_proxy_qop_auth_works(self): self._digest_auth_handler.add_password(self.REALM, self.URL, self.USER, self.PASSWD) FakeProxyHandler.digest_auth_handler.set_qop("auth") result = self.opener.open(self.URL) while result.read(): pass result.close() def test_proxy_qop_auth_int_works_or_throws_urlerror(self): self._digest_auth_handler.add_password(self.REALM, self.URL, self.USER, self.PASSWD) FakeProxyHandler.digest_auth_handler.set_qop("auth-int") try: result = self.opener.open(self.URL) except urllib.error.URLError: # It's okay if we don't support auth-int, but we certainly # shouldn't receive any kind of exception here other than # a URLError. result = None if result: while result.read(): pass result.close() def GetRequestHandler(responses): class FakeHTTPRequestHandler(http.server.BaseHTTPRequestHandler): server_version = "TestHTTP/" requests = [] headers_received = [] port = 80 def do_GET(self): body = self.send_head() if body: self.wfile.write(body) def do_POST(self): content_length = self.headers["Content-Length"] post_data = self.rfile.read(int(content_length)) self.do_GET() self.requests.append(post_data) def send_head(self): FakeHTTPRequestHandler.headers_received = self.headers self.requests.append(self.path) response_code, headers, body = responses.pop(0) self.send_response(response_code) for (header, value) in headers: self.send_header(header, value % {'port':self.port}) if body: self.send_header("Content-type", "text/plain") self.end_headers() return body self.end_headers() def log_message(self, *args): pass return FakeHTTPRequestHandler class TestUrlopen(unittest.TestCase): """Tests urllib2.urlopen using the network. These tests are not exhaustive. Assuming that testing using files does a good job overall of some of the basic interface features. There are no tests exercising the optional 'data' and 'proxies' arguments. No tests for transparent redirection have been written. """ def setUp(self): self.server = None def tearDown(self): if self.server is not None: self.server.stop() def urlopen(self, url, data=None): l = [] f = urllib.request.urlopen(url, data) try: # Exercise various methods l.extend(f.readlines(200)) l.append(f.readline()) l.append(f.read(1024)) l.append(f.read()) finally: f.close() return b"".join(l) def start_server(self, responses=None): if responses is None: responses = [(200, [], b"we don't care")] handler = GetRequestHandler(responses) self.server = LoopbackHttpServerThread(handler) self.server.start() self.server.ready.wait() port = self.server.port handler.port = port return handler def test_redirection(self): expected_response = b"We got here..." responses = [ (302, [("Location", "http://localhost:%(port)s/somewhere_else")], ""), (200, [], expected_response) ] handler = self.start_server(responses) data = self.urlopen("http://localhost:%s/" % handler.port) self.assertEquals(data, expected_response) self.assertEquals(handler.requests, ["/", "/somewhere_else"]) def test_chunked(self): expected_response = b"hello world" chunked_start = ( b'a\r\n' b'hello worl\r\n' b'1\r\n' b'd\r\n' b'0\r\n' ) response = [(200, [("Transfer-Encoding", "chunked")], chunked_start)] handler = self.start_server(response) data = self.urlopen("http://localhost:%s/" % handler.port) self.assertEquals(data, expected_response) def test_404(self): expected_response = b"Bad bad bad..." handler = self.start_server([(404, [], expected_response)]) try: self.urlopen("http://localhost:%s/weeble" % handler.port) except urllib.error.URLError as f: data = f.read() f.close() else: self.fail("404 should raise URLError") self.assertEquals(data, expected_response) self.assertEquals(handler.requests, ["/weeble"]) def test_200(self): expected_response = b"pycon 2008..." handler = self.start_server([(200, [], expected_response)]) data = self.urlopen("http://localhost:%s/bizarre" % handler.port) self.assertEquals(data, expected_response) self.assertEquals(handler.requests, ["/bizarre"]) def test_200_with_parameters(self): expected_response = b"pycon 2008..." handler = self.start_server([(200, [], expected_response)]) data = self.urlopen("http://localhost:%s/bizarre" % handler.port, b"get=with_feeling") self.assertEquals(data, expected_response) self.assertEquals(handler.requests, ["/bizarre", b"get=with_feeling"]) def test_sending_headers(self): handler = self.start_server() req = urllib.request.Request("http://localhost:%s/" % handler.port, headers={"Range": "bytes=20-39"}) urllib.request.urlopen(req) self.assertEqual(handler.headers_received["Range"], "bytes=20-39") def test_basic(self): handler = self.start_server() open_url = urllib.request.urlopen("http://localhost:%s" % handler.port) for attr in ("read", "close", "info", "geturl"): self.assert_(hasattr(open_url, attr), "object returned from " "urlopen lacks the %s attribute" % attr) try: self.assert_(open_url.read(), "calling 'read' failed") finally: open_url.close() def test_info(self): handler = self.start_server() try: open_url = urllib.request.urlopen( "http://localhost:%s" % handler.port) info_obj = open_url.info() self.assert_(isinstance(info_obj, email.message.Message), "object returned by 'info' is not an instance of " "email.message.Message") self.assertEqual(info_obj.get_content_subtype(), "plain") finally: self.server.stop() def test_geturl(self): # Make sure same URL as opened is returned by geturl. handler = self.start_server() open_url = urllib.request.urlopen("http://localhost:%s" % handler.port) url = open_url.geturl() self.assertEqual(url, "http://localhost:%s" % handler.port) def test_bad_address(self): # Make sure proper exception is raised when connecting to a bogus # address. self.assertRaises(IOError, # SF patch 809915: In Sep 2003, VeriSign started # highjacking invalid .com and .net addresses to # boost traffic to their own site. This test # started failing then. One hopes the .invalid # domain will be spared to serve its defined # purpose. urllib.request.urlopen, "http://sadflkjsasf.i.nvali.d/") def test_main(): support.run_unittest(ProxyAuthTests) support.run_unittest(TestUrlopen) if __name__ == "__main__": test_main()
gpl-3.0
1,962,584,770,025,527,000
34.781705
79
0.566033
false
thermokarst/qiime2
qiime2/core/type/tests/test_parse.py
1
4541
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2020, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ---------------------------------------------------------------------------- import unittest from qiime2.core.type.parse import ast_to_type, string_to_ast from qiime2.core.testing.type import Foo, Bar, C1, C2 from qiime2.plugin import (Int, Float, Str, Bool, Range, Choices, TypeMap, Properties, List, Set, Visualization, Metadata, MetadataColumn, Categorical, Numeric) class TestParsing(unittest.TestCase): def assert_roundtrip(self, type): ast = string_to_ast(repr(type)) type1 = ast_to_type(ast) type2 = ast_to_type(type1.to_ast()) self.assertEqual(type, type1) self.assertEqual(ast, type1.to_ast()) self.assertEqual(type1, type2) def test_simple_semantic_type(self): self.assert_roundtrip(Foo) self.assert_roundtrip(Bar) self.assert_roundtrip(C1[Foo]) def test_union_semantic_type(self): self.assert_roundtrip(Foo | Bar) self.assert_roundtrip(C1[Foo | Bar]) def test_complicated_semantic_type(self): self.assert_roundtrip(C2[C1[Foo % Properties(["A", "B"]) | Bar], Foo % Properties("A") ] % Properties(exclude=["B", "C"])) def test_collection_semantic_type(self): self.assert_roundtrip(List[Foo | Bar]) self.assert_roundtrip(Set[Bar]) def test_visualization(self): self.assert_roundtrip(Visualization) def test_primitive_simple(self): self.assert_roundtrip(Int) self.assert_roundtrip(Float) self.assert_roundtrip(Str) self.assert_roundtrip(Bool) def test_primitive_predicate(self): self.assert_roundtrip(Int % Range(0, 10)) self.assert_roundtrip( Int % (Range(0, 10) | Range(50, 100, inclusive_end=True))) self.assert_roundtrip(Float % Range(None, 10)) self.assert_roundtrip(Float % Range(0, None)) self.assert_roundtrip(Str % Choices("A")) self.assert_roundtrip(Str % Choices(["A"])) self.assert_roundtrip(Str % Choices("A", "B")) self.assert_roundtrip(Str % Choices(["A", "B"])) self.assert_roundtrip(Bool % Choices(True)) self.assert_roundtrip(Bool % Choices(False)) def test_collection_primitive(self): self.assert_roundtrip(Set[Str % Choices('A', 'B', 'C')]) self.assert_roundtrip(List[Int % Range(1, 3, inclusive_end=True) | Str % Choices('A', 'B', 'C')]) def test_metadata_primitive(self): self.assert_roundtrip(Metadata) self.assert_roundtrip(MetadataColumn[Numeric]) self.assert_roundtrip(MetadataColumn[Categorical]) self.assert_roundtrip(MetadataColumn[Numeric | Categorical]) def test_typevars(self): T, U, V, W, X = TypeMap({ (Foo, Bar, Str % Choices('A', 'B')): (C1[Foo], C1[Bar]), (Foo | Bar, Foo, Str): (C1[Bar], C1[Foo]) }) scope = {} T1 = ast_to_type(T.to_ast(), scope=scope) U1 = ast_to_type(U.to_ast(), scope=scope) V1 = ast_to_type(V.to_ast(), scope=scope) W1 = ast_to_type(W.to_ast(), scope=scope) X1 = ast_to_type(X.to_ast(), scope=scope) self.assertEqual(len(scope), 1) self.assertEqual(scope[id(T.mapping)], [T1, U1, V1, W1, X1]) self.assertEqual(T1.mapping.lifted, T.mapping.lifted) self.assertIs(T1.mapping, U1.mapping) self.assertIs(U1.mapping, V1.mapping) self.assertIs(V1.mapping, W1.mapping) self.assertIs(W1.mapping, X1.mapping) def test_syntax_error(self): with self.assertRaisesRegex(ValueError, "could not be parsed"): string_to_ast('$') def test_bad_juju(self): with self.assertRaisesRegex(ValueError, "one type expression"): string_to_ast('import os; os.rmdir("something-important")') def test_more_bad(self): with self.assertRaisesRegex(ValueError, "Unknown expression"): string_to_ast('lambda x: x') def test_weird(self): with self.assertRaisesRegex(ValueError, "Unknown literal"): string_to_ast('FeatureTable(Foo + Bar)') if __name__ == '__main__': unittest.main()
bsd-3-clause
2,467,362,676,587,686,400
36.841667
78
0.586214
false
owwlo/Courier
src/courier/app/CourierService.py
1
5234
''' Created on Jan 17, 2015 @author: owwlo ''' from PyQt5 import QtGui, QtCore, QtQml, QtQuick from PyQt5.QtCore import QObject, QUrl, Qt, QVariant, QMetaObject, Q_ARG import threading import websocket import json import logging from time import sleep import coloredlogs WS_URL = "ws://localhost:8888/computer" RECONNECT_INTERVAL = 5 logger = logging.getLogger("CourierApp") coloredlogs.install(level = logging.DEBUG, show_hostname = False, show_timestamps = False) class CourierService(threading.Thread, QObject): class WebSocketHandler(): def __init__(self, service): self.__service = service def onMessage(self, ws, message): self.__service.onMessage(message) def onError(self, ws, error): logger.debug("onError " + str(error)) def onClose(self, ws): logger.debug("onCLose") self.__service.ws = None def onOpen(self, ws): logger.debug("onOpen") self.__service.ws = ws self.__service.token = None fetchThread = threading.Thread(target=self.__service.fetchToken) fetchThread.start() # fetchThread.join() onTokenFetched = QtCore.pyqtSignal([str]) onNewMessage = QtCore.pyqtSignal([dict]) def __init__(self, app): threading.Thread.__init__(self) QObject.__init__(self, app) self.__app = app self.handler = self.WebSocketHandler(self) self.token = None # Initialize callback lists for self.__callbacksOnNewMessageFromDevice = [] self.__callbacksOnTokenFetched = [] self.__callbacksOnDeviceConnected = [] def run(self): while(True): ws = websocket.WebSocketApp(WS_URL, on_message=self.handler.onMessage, on_error=self.handler.onError, on_close=self.handler.onClose, on_open=self.handler.onOpen) ws.run_forever() logger.error("Lost connection, will try again in %d seconds." % RECONNECT_INTERVAL) sleep(RECONNECT_INTERVAL) def fetchToken(self): MAX_RETRY_CNT = 5 cnt = MAX_RETRY_CNT while cnt > 0 and self.token == None: if cnt != MAX_RETRY_CNT: logger.warn( "Connect failed, reconnecting... trying count remains: %d" % cnt) self.sendHash(self.getTokenRequestPackage()) sleep(5) cnt -= 1 if self.token == None: logger.error("Cannot connect to server") # else: # self.on def getTokenRequestPackage(self): return {"type": "operation", "command": "request_token"} def getReplyRequestPackage(self, cId, replyText): return {"type": "reply", "cId": str(cId), "content": replyText} def sendReply(self, cId, replyText): pkg = self.getReplyRequestPackage(cId, replyText) self.sendHash(pkg) def parseMessage(self, message): parsed = None try: parsed = json.loads(message) except Exception as e: logger.warn(str(e)) return None return parsed def sendHash(self, h): if self.token: h["token"] = self.token j = json.dumps(h) self.send(j) def send(self, message): if self.ws != None: self.ws.send(message) else: logger.error("Socket Failed.") def onMessage(self, message): logger.debug("Raw Message from Server: " + message) msg = self.parseMessage(message) if msg == None: return mtype = msg["type"] if mtype == "new_msg": self.onNewMessageFromDevice(msg) elif mtype == "token_response": self.onTokenResponse(msg) elif mtype == "info_paired": self.onDeviceConnected(msg) def onTokenResponse(self, message): logger.debug("Get token from server: " + message["token"]) self.token = message["token"] for fn in self.__callbacksOnTokenFetched: fn(self.token) self.onTokenFetched.emit(self.token) def onNewMessageFromDevice(self, message): for fn in self.__callbacksOnNewMessageFromDevice: fn(message) self.onNewMessage.emit(message) def onDeviceConnected(self, message): for fn in self.__callbacksOnDeviceConnected: fn(message) def addOnNewMessageFromDevice(self, callback): self.__callbacksOnNewMessageFromDevice.append(callback) def removeOnNewMessageFromDevice(self, callback): self.__callbacksOnNewMessageFromDevice.remove(callback) def addOnTokenFetched(self, callback): self.__callbacksOnTokenFetched.append(callback) def removeOnTokenFetched(self, callback): self.__callbacksOnTokenFetched.remove(callback) def addOnDeviceConnected(self, callback): self.__callbacksOnDeviceConnected.append(callback) def removeOnDeviceConnected(self, callback): self.__callbacksOnDeviceConnected.remove(callback)
mit
-3,827,367,293,656,535,000
30.341317
95
0.597058
false