本文整理汇总了Python中BaseObject.BaseObject.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python BaseObject.__init__方法的具体用法?Python BaseObject.__init__怎么用?Python BaseObject.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseObject.BaseObject
的用法示例。
在下文中一共展示了BaseObject.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(
self,
accept,
username="",
password="",
uid="",
process_id="",
audioFilename=None,
metadataFilename=None,
transcriptFilename=None,
service=None,
item_id=None,
count=None,
status=None,
):
BaseObject.__init__(
self,
accept,
username=username,
password=password,
uid=uid,
process_id=process_id,
audioFilename=audioFilename,
metadataFilename=metadataFilename,
transcriptFilename=transcriptFilename,
service=service,
item_id=item_id,
count=count,
status=status,
)
self.path = "media/"
self.path_trans = "/transcribe"
self.path_publish = "/publish"
self.path_unpublish = "/unpublish"
示例2: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, accept, username="", password="", uid="", process_id="",
audioFilename="", metadataFilename="", transcriptFilename="",
service=None, item_id=None, count=None):
BaseObject.__init__(self, accept, username=username, password=password, uid=uid, process_id=process_id,
audioFilename=audioFilename, metadataFilename=metadataFilename, transcriptFilename=transcriptFilename,
service=service, item_id=item_id, count=count)
self.path = 'transcripts/'
示例3: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, **kwargs):
BaseObject.__init__(self, **kwargs)
Config.__init__(self, **kwargs)
logger_setup = kwargs.get("logger_setup", self.GLOBAL_CONFIG.get("logger_setup"))
if logger_setup is not None:
kwargs = logger_setup
if not kwargs.get("log_filename"):
appname = self.GLOBAL_CONFIG.get("app_name")
if appname is not None:
kwargs.setdefault("log_filename", os.path.expanduser("~/%s.log" % (appname)))
self._logger = None
use_conf = kwargs.get("use_conf", True)
if use_conf:
d = self.get_conf()
else:
d = {}
for key in self._confkeys:
val = d.get(key)
if val is None:
val = kwargs.get(key)
if val is None:
continue
setattr(self, key, val)
self.logger_kwargs = kwargs.get("logger_kwargs", {})
self.set_logger()
self.bind(property_changed=self._on_own_property_changed)
示例4: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, attr):
BaseObject.__init__(self, attr['name'], 'square')
SfSceneComponent.__init__(self, attr.get('pixmap', ''))
self._min = attr.get('min', 0)
self._max = attr.get('max', 0)
self._value = float(self.getMin())
self._stepSize= 0.01
示例5: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, name, coords = None):
BaseObject.__init__(self)
self.path_id = Path.new_id()
self.name = name
self.coords = coords
# add us
Path.paths.append(self)
示例6: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, trip_route, start, end, headway):
BaseObject.__init__(self)
self.frequency_id = Frequency.new_id()
self.start = start
self.end = end
self.headway = headway
self._trip_route = weakref.ref(trip_route)
# add us
Frequency.frequencies.append(self)
示例7: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, **kwargs):
BaseObject.__init__(self, **kwargs)
Config.__init__(self, **kwargs)
self._default_filetype = None
self._mimetypes = mimetypes.MimeTypes()
self.filetypes = {}
filetype_data = kwargs.get('filetype_data', [])
for data in filetype_data:
self.add_filetype(**data)
self.recent_files = {}
self.files_by_path = {}
self.get_recent_files()
self.bind(current_file=self._on_current_file_set)
示例8: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, name = None, url = None,
timezone = 'America/Chicago', language = 'EN', phone = None, fare_url = None):
BaseObject.__init__(self)
self.agency_id = Agency.new_id()
self.name = name
self.url = url
self.timezone = timezone
self.language = language
self.phone = phone
self.fare_url = fare_url
# add us
Agency.agencies.append(self)
示例9: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, name, trip_route, calendar):
BaseObject.__init__(self)
self.trip_id = Trip.new_id()
self.name = name
self._trip_route = weakref.ref(trip_route)
self._calendar = weakref.ref(calendar)
self.stops = []
self._next_block = None
self._previous_block = None
# add us
Trip.trips.append(self)
示例10: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, service_name, monday = 0,
tuesday = 0, wednesday = 0, thursday = 0,
friday = 0, saturday = 0, sunday = 0,
start_date = '20120101', end_date = '20140101'):
BaseObject.__init__(self)
self.calendar_id = Calendar.new_id()
self.name = service_name
self.days = [monday, tuesday, wednesday,
thursday, friday, saturday,
sunday]
#self.start_date = start_date or datetime.now()
#self.end_date = end_date or datetime.now() + relativedelta(years=+1)
self.start_date = start_date
self.end_date = end_date
# add us
Calendar.calendars.append(self)
示例11: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, service_name,
monday = 1, tuesday = 1, wednesday = 1, thursday = 1,
friday = 1, saturday = 1, sunday = 1,
start_date = '20150601', end_date = '20170601',
added_excn = [], remov_excn = []):
BaseObject.__init__(self)
self.calendar_id = Calendar.new_id()
self.name = service_name
self.days = [monday, tuesday, wednesday,
thursday, friday, saturday,
sunday]
self.start_date = start_date
self.end_date = end_date
self.added_excn = added_excn
self.remov_excn = remov_excn
# add us
Calendar.calendars.append(self)
示例12: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, code = None, name = None,
description = None, latitude = None, longitude = None,
zone_id = None, url = None, location_type = 0, parent_station = None):
BaseObject.__init__(self)
self.stop_id = Stop.new_id()
self.code = code
self.name = name
self.description = description
self.latitude = latitude
self.longitude = longitude
self.zone_id = zone_id
self.url = url
self.location_type = location_type
self.parent_station = parent_station
self.pictures = []
# add us
Stop.stops.append(self)
示例13: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, agency = None, short_name = '',
long_name = '', description = '',
route_type = None, url = '', color = None, text_color = None):
BaseObject.__init__(self)
self.route_id = Route.new_id()
self.agency = agency
if agency is None:
self.agency = Agency.agencies[0]
self.short_name = short_name
self.long_name = long_name
self.description = description
self.route_type = route_type
self.url = url
self.color = color
self.text_color = text_color
self.trip_routes = []
# add us
Route.routes.append(self)
示例14: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, **kwargs):
#super(OSCNode, self).__init__()
BaseObject.__init__(self, **kwargs)
dispatch.Receiver.__init__(self)
self.register_signal('child_added', 'child_removed')
if 'name' in kwargs:
self.setName(kwargs.get('name'))
if 'parent' in kwargs:
self.setParent(kwargs.get('parent'))
self._oscMaster = self._parent._oscMaster
self.get_client_cb = self._parent.get_client_cb
else:
self._oscMaster = kwargs.get('oscMaster', False)
self.get_client_cb = kwargs.get('get_client_cb')
self.is_root_node = kwargs.get('root_node', False)
self.transmit_callback = kwargs.get('transmit_callback')
if self.is_root_node:
self.get_epoch_offset_cb = kwargs.get('get_epoch_offset_cb')
self._dispatch_thread = OSCDispatchThread(osc_tree=self)
self._dispatch_thread.start()
示例15: __init__
# 需要导入模块: from BaseObject import BaseObject [as 别名]
# 或者: from BaseObject.BaseObject import __init__ [as 别名]
def __init__(self, name, route, calendar, headsign, direction, path = None):
BaseObject.__init__(self)
self.trip_route_id = TripRoute.new_id()
self.name = name
self._route = None
self._calendar = None
self.set_route(route)
self.set_calendar(calendar)
self.headsign = headsign
self.direction = direction
self.path = path
self.wheelchair_accessible = 0
self.trips = []
self.frequencies = []
self._stops = []
# add us
TripRoute.trip_routes.append(self)