code
stringlengths
1
18.2k
def create(self, request, *args, **kwargs): """ To create new email hook issue **POST** against */api/hooks-email/* as an authenticated user. You should specify list of event_types or event_groups. Example of a request: .. code-block:: http POST /api/hooks-email/ HTTP/1.1 Content-Type: application/json Accept: applicat...
following **PATCH** request against hook URL: .. code-block:: javascript { "is_active": "false" } """ return super(EmailHookViewSet, self).create(request, *args, **kwargs)
def create(self, request, *args, **kwargs): """ To create new push hook issue **POST** against */api/hooks-push/* as an authenticated user. You should specify list of event_types or event_groups. Example of a request: .. code-block:: http POST /api/hooks-push/ HTTP/1.1 Content-Type: application/json Accept: application...
following **PATCH** request against hook URL: .. code-block:: javascript { "is_active": "false" } """ return super(PushHookViewSet, self).create(request, *args, **kwargs)
def import_from_file(self, index, filename): """Import this instrument's settings from the given file. Will automatically add the instrument's synth and table to the song's synths and tables if needed. Note that this may invalidate existing instrument accessor objects. :param index: the index into which to import :para...
enough synth or table slots left for the instrument's synth or table """ with open(filename, 'r') as fp: self._import_from_struct(index, json.load(fp))
def load_lsdsng(filename): """Load a Project from a ``.lsdsng`` file. :param filename: the name of the file from which to load :rtype: :py:class:`pylsdj.Project` """ # Load preamble data so that we know the name and version of the song with open(filename, 'rb') as fp: preamble_data = bread.parse(fp, spec.lsdsng_preambl...
compressed data into a block map and use BlockReader to # decompress it factory = BlockFactory() while True: block_data = bytearray(fp.read(blockutils.BLOCK_SIZE)) if len(block_data) == 0: break block = factory.new_block() block.data = block_data remapped_blocks = filepack.renumber_block_keys(factory.blocks) reader = B...
version = preamble_data.version size_blks = int(math.ceil( float(len(compressed_data)) / blockutils.BLOCK_SIZE)) return Project(name, version, size_blks, raw_data)
def load_srm(filename): """Load a Project from an ``.srm`` file. :param filename: the name of the file from which to load :rtype: :py:class:`pylsdj.Project` """ # .srm files are just decompressed projects without headers # In order to determine the file's size in compressed blocks, we have to # compress it first with o...
writer = BlockWriter() writer.write(compressed_data, factory) size_in_blocks = len(factory.blocks) # We'll give the file a dummy name ("SRMLOAD") and version, since we know # neither name = "SRMLOAD" version = 0 return Project(name, version, size_in_blocks, raw_data)
def song(self): """the song associated with the project""" if self._song is None: self._song = Song(self._song_data) return self._song
def save(self, filename): """Save a project in .lsdsng format to the target file. :param filename: the name of the file to which to save :deprecated: use ``save_lsdsng(filename)`` instead """ with open(filename, 'wb') as fp: writer = BlockWriter() factory = BlockFactory() preamble_dummy_bytes = bytearray([0] * 9) pream...
filepack.compress(raw_data) writer.write(compressed_data, factory) fp.write(preamble_data) for key in sorted(factory.blocks.keys()): fp.write(bytearray(factory.blocks[key].data))
def save_srm(self, filename): """Save a project in .srm format to the target file. :param filename: the name of the file to which to save """ with open(filename, 'wb') as fp: raw_data = bread.write(self._song_data, spec.song) fp.write(raw_data)
def phase_type(self, value): '''compresses the waveform horizontally; one of ``"normal"``, ``"resync"``, ``"resync2"``''' self._params.phase_type = value self._overwrite_lock.disable()
def project_list(self): """The list of :py:class:`pylsdj.Project` s that the .sav file contains""" return [(i, self.projects[i]) for i in sorted(self.projects.keys())]
def save(self, filename, callback=_noop_callback): """Save this file. :param filename: the file to which to save the .sav file :type filename: str :param callback: a progress callback function :type callback: function """ with open(filename, 'wb') as fp: self._save(fp, callback)
def split(compressed_data, segment_size, block_factory): """Splits compressed data into blocks. :param compressed_data: the compressed data to split :param segment_size: the size of a block in bytes :param block_factory: a BlockFactory used to construct the blocks :rtype: a list of block IDs of blocks that the block fa...
0 data_size = len(compressed_data) while index < data_size: current_byte = compressed_data[index] if index < data_size - 1: next_byte = compressed_data[index + 1] else: next_byte = None jump_size = 1 if current_byte == RLE_BYTE: assert next_byte is not None, "Expected a command to follow " \ "RLE byte" if next_byte == ...
is not None, "Expected a command to follow " \ "special byte" if next_byte == SPECIAL_BYTE: jump_size = 2 elif next_byte == DEFAULT_INSTR_BYTE or \ next_byte == DEFAULT_WAVE_BYTE: jump_size = 3 else: assert False, "Encountered unexpected EOF or block " \ "switch while segmenting" # Need two bytes for the jump or EOF if...
current_segment_start:index]) current_segment_start = index else: index += jump_size # Append the last segment, if any if current_segment_start != index: segments.append(compressed_data[ current_segment_start:current_segment_start + index]) # Make sure that no data was lost while segmenting total_segment_length = sum(m...
block_ids.append(block.id) for (i, segment) in enumerate(segments): block = block_factory.blocks[block_ids[i]] assert len(block.data) == 0, "Encountered a block with " "pre-existing data while writing" if i == len(segments) - 1: # Write EOF to the end of the segment add_eof(segment) else: # Write a pointer to the next ...
segment return block_ids
def renumber_block_keys(blocks): """Renumber a block map's indices so that tehy match the blocks' block switch statements. :param blocks a block map to renumber :rtype: a renumbered copy of the block map """ # There is an implicit block switch to the 0th block at the start of the # file byte_switch_keys = [0] block_key...
statement for block in list(blocks.values()): i = 0 while i < len(block.data) - 1: current_byte = block.data[i] next_byte = block.data[i + 1] if current_byte == RLE_BYTE: if next_byte == RLE_BYTE: i += 2 else: i += 3 elif current_byte == SPECIAL_BYTE: if next_byte in SPECIAL_DEFAULTS: i += 3 elif next_byte == SPECIAL_B...
+= 1 byte_switch_keys.sort() block_keys.sort() assert len(byte_switch_keys) == len(block_keys), ( "Number of blocks that are target of block switches (%d) " % (len(byte_switch_keys)) + "does not equal number of blocks in the song (%d)" % (len(block_keys)) + "; possible corruption") if byte_switch_keys == block_keys: # ...
def merge(blocks): """Merge the given blocks into a contiguous block of compressed data. :param blocks: the list of blocks :rtype: a list of compressed bytes """ current_block = blocks[sorted(blocks.keys())[0]] compressed_data = [] eof = False while not eof: data_size_to_append = None next_block = None i = 0 while i < ...
RLE_BYTE: if next_byte == RLE_BYTE: i += 2 else: i += 3 elif current_byte == SPECIAL_BYTE: if next_byte in SPECIAL_DEFAULTS: i += 3 elif next_byte == SPECIAL_BYTE: i += 2 else: data_size_to_append = i # hit end of file if next_byte == EOF_BYTE: eof = True else: next_block = blocks[next_byte] break else: i += 1 assert d...
of a "\ "block without encountering a block switch or EOF" compressed_data.extend(current_block.data[0:data_size_to_append]) if not eof: assert next_block is not None, "Switched blocks, but did " \ "not provide the next block to switch to" current_block = next_block return compressed_data
def pad(segment, size): """Add zeroes to a segment until it reaches a certain size. :param segment: the segment to pad :param size: the size to which to pad the segment """ for i in range(size - len(segment)): segment.append(0) assert len(segment) == size
def decompress(compressed_data): """Decompress data that has been compressed by the filepack algorithm. :param compressed_data: an array of compressed data bytes to decompress :rtype: an array of decompressed bytes""" raw_data = [] index = 0 while index < len(compressed_data): current = compressed_data[index] index += ...
+= 1 raw_data.extend([directive] * count) elif current == SPECIAL_BYTE: directive = compressed_data[index] index += 1 if directive == SPECIAL_BYTE: raw_data.append(SPECIAL_BYTE) elif directive == DEFAULT_WAVE_BYTE: count = compressed_data[index] index += 1 raw_data.extend(DEFAULT_WAVE * count) elif directive == DEFAULT...
sequence 0x%02x 0x%02x" % ( current, directive) else: raw_data.append(current) return raw_data
def compress(raw_data): """Compress raw bytes with the filepack algorithm. :param raw_data: an array of raw data bytes to compress :rtype: a list of compressed bytes """ raw_data = bytearray(raw_data) compressed_data = [] data_size = len(raw_data) index = 0 next_bytes = [-1, -1, -1] def is_default_instrument(index): if...
!= 0: return False return instr_bytes == DEFAULT_INSTRUMENT_FILEPACK def is_default_wave(index): return (index + len(DEFAULT_WAVE) <= len(raw_data) and raw_data[index:index + len(DEFAULT_WAVE)] == DEFAULT_WAVE) while index < data_size: current_byte = raw_data[index] for i in range(3): if index < data_size - (i + 1): ne...
SPECIAL_BYTE: compressed_data.append(SPECIAL_BYTE) compressed_data.append(SPECIAL_BYTE) index += 1 elif is_default_instrument(index): counter = 1 index += len(DEFAULT_INSTRUMENT_FILEPACK) while (is_default_instrument(index) and counter < 0x100): counter += 1 index += len(DEFAULT_INSTRUMENT_FILEPACK) compressed_data.app...
# Do RLE compression compressed_data.append(RLE_BYTE) compressed_data.append(current_byte) counter = 0 while (index < data_size and raw_data[index] == current_byte and counter < 0xff): index += 1 counter += 1 compressed_data.append(counter) else: compressed_data.append(current_byte) index += 1 return compressed_data
def name_without_zeroes(name): """ Return a human-readable name without LSDJ's trailing zeroes. :param name: the name from which to strip zeroes :rtype: the name, without trailing zeroes """ first_zero = name.find(b'\0') if first_zero == -1: return name else: return str(name[:first_zero])
def name(self): """the instrument's name (5 characters, zero-padded)""" instr_name = self.song.song_data.instrument_names[self.index] if type(instr_name) == bytes: instr_name = instr_name.decode('utf-8') return instr_name
def table(self): """a ```pylsdj.Table``` referencing the instrument's table, or None if the instrument doesn't have a table""" if hasattr(self.data, 'table_on') and self.data.table_on: assert_index_sane(self.data.table, len(self.song.tables)) return self.song.tables[self.data.table]
def import_lsdinst(self, struct_data): """import from an lsdinst struct""" self.name = struct_data['name'] self.automate = struct_data['data']['automate'] self.pan = struct_data['data']['pan'] if self.table is not None: self.table.import_lsdinst(struct_data)
def export_to_file(self, filename): """Export this instrument's settings to a file. :param filename: the name of the file """ instr_json = self.export_struct() with open(filename, 'w') as fp: json.dump(instr_json, fp, indent=2)
def write_wav(self, filename): """Write this sample to a WAV file. :param filename: the file to which to write """ wave_output = None try: wave_output = wave.open(filename, 'w') wave_output.setparams(WAVE_PARAMS) frames = bytearray([x << 4 for x in self.sample_data]) wave_output.writeframes(frames) finally: if wave_out...
def read_wav(self, filename): """Read sample data for this sample from a WAV file. :param filename: the file from which to read """ wave_input = None try: wave_input = wave.open(filename, 'r') wave_frames = bytearray( wave_input.readframes(wave_input.getnframes())) self.sample_data = [x >> 4 for x in wave_frames] final...
def get_device_address(device): """ find the local ip address on the given device """ if device is None: return None command = ['ip', 'route', 'list', 'dev', device] ip_routes = subprocess.check_output(command).strip() for line in ip_routes.split('\n'): seen = '' for a in line.split(): if seen == 'src': return a seen =...
def get_default_net_device(): """ Find the device where the default route is. """ with open('/proc/net/route') as fh: for line in fh: iface, dest, _ = line.split(None, 2) if dest == '00000000': return iface return None
def add_missing_optional_args_with_value_none(args, optional_args): ''' Adds key-value pairs to the passed dictionary, so that afterwards, the dictionary can be used without needing to check for KeyErrors. If the keys passed as a second argument are not present, they are added with None as a value. :args: The dictionar...
The modified dictionary. ''' for name in optional_args: if not name in args.keys(): args[name] = None return args
def check_presence_of_mandatory_args(args, mandatory_args): ''' Checks whether all mandatory arguments are passed. This function aims at methods with many arguments which are passed as kwargs so that the order in which the are passed does not matter. :args: The dictionary passed as args. :mandatory_args: A list of keys...
passed. If not, an exception is raised. ''' missing_args = [] for name in mandatory_args: if name not in args.keys(): missing_args.append(name) if len(missing_args) > 0: raise ValueError('Missing mandatory arguments: '+', '.join(missing_args)) else: return True
def size(self, store_hashes=True): """ Retrieves the size in bytes of this ZIP content. :return: Size of the zip content in bytes """ if self.modified: self.__cache_content(store_hashes) return len(self.cached_content)
def monkey_patch_migration_template(self, app, fixture_path): """ Monkey patch the django.db.migrations.writer.MIGRATION_TEMPLATE Monkey patching django.db.migrations.writer.MIGRATION_TEMPLATE means that we don't have to do any complex regex or reflection. It's hacky... but works atm. """ self._MIGRATION_TEMPLATE = wri...
+ "\nfrom django_migration_fixture import fixture\n%s" % module_import )\ .replace( '%(operations)s', " migrations.RunPython(**fixture(%s, ['%s'])),\n" % ( app.label, os.path.basename(fixture_path) ) + "%(operations)s\n" )
def migration_exists(self, app, fixture_path): """ Return true if it looks like a migration already exists. """ base_name = os.path.basename(fixture_path) # Loop through all migrations for migration_path in glob.glob(os.path.join(app.path, 'migrations', '*.py')): if base_name in open(migration_path).read(): return True...
def create_migration(self, app, fixture_path): """ Create a data migration for app that uses fixture_path. """ self.monkey_patch_migration_template(app, fixture_path) out = StringIO() management.call_command('makemigrations', app.label, empty=True, stdout=out) self.restore_migration_template() self.stdout.write(out.get...
def instantiate_for_read_and_search(handle_server_url, reverselookup_username, reverselookup_password, **config): ''' Initialize client with read access and with search function. :param handle_server_url: The URL of the Handle Server. May be None (then, the default 'https://hdl.handle.net' is used). :param reverselooku...
be passed on to the constructor as config. Config options from the credentials object are overwritten by this. :return: An instance of the client. ''' if handle_server_url is None and 'reverselookup_baseuri' not in config.keys(): raise TypeError('You must specify either "handle_server_url" or "reverselookup_baseuri".' ...
inst
def instantiate_with_username_and_password(handle_server_url, username, password, **config): ''' Initialize client against an HSv8 instance with full read/write access. The method will throw an exception upon bad syntax or non-existing Handle. The existence or validity of the password in the handle is not checked at th...
format "index:prefix/suffix". :param password: This is the password stored as secret key in the actual Handle value the username points to. :param \**config: More key-value pairs may be passed that will be passed on to the constructor as config. :raises: :exc:`~b2handle.handleexceptions.HandleNotFoundException`: If the...
inst
def instantiate_with_credentials(credentials, **config): ''' Initialize the client against an HSv8 instance with full read/write access. :param credentials: A credentials object, see separate class PIDClientCredentials. :param \**config: More key-value pairs may be passed that will be passed on to the constructor as co...
of the client. ''' key_value_pairs = credentials.get_all_args() if config is not None: key_value_pairs.update(**config) # passed config overrides json file inst = EUDATHandleClient(**key_value_pairs) return inst
def retrieve_handle_record_json(self, handle): ''' Retrieve a handle record from the Handle server as a complete nested dict (including index, ttl, timestamp, ...) for later use. Note: For retrieving a simple dict with only the keys and values, please use :meth:`~b2handle.handleclient.EUDATHandleClient.retrieve_handle_...
returns None. ''' LOGGER.debug('retrieve_handle_record_json...') utilhandle.check_handle_syntax(handle) response = self.__send_handle_get_request(handle) response_content = decoded_response(response) if hsresponses.handle_not_found(response): return None elif hsresponses.does_handle_exist(response): handlerecord_json =...
def retrieve_handle_record(self, handle, handlerecord_json=None): ''' Retrieve a handle record from the Handle server as a dict. If there is several entries of the same type, only the first one is returned. Values of complex types (such as HS_ADMIN) are transformed to strings. :param handle: The handle whose record to ...
can be reused. :return: A dict where the keys are keys from the Handle record (except for hidden entries) and every value is a string. The result will be None if the Handle does not exist. :raises: :exc:`~b2handle.handleexceptions.HandleSyntaxError` ''' LOGGER.debug('retrieve_handle_record...') handlerecord_json = self...
key = entry['type'] if not key in record_as_dict.keys(): record_as_dict[key] = str(entry['data']['value']) return record_as_dict
def get_value_from_handle(self, handle, key, handlerecord_json=None): ''' Retrieve a single value from a single Handle. If several entries with this key exist, the methods returns the first one. If the handle does not exist, the method will raise a HandleNotFoundException. :param handle: The handle to take the value fr...
does not contain the key. :raises: :exc:`~b2handle.handleexceptions.HandleSyntaxError` :raises: :exc:`~b2handle.handleexceptions.HandleNotFoundException` ''' LOGGER.debug('get_value_from_handle...') handlerecord_json = self.__get_handle_record_if_necessary(handle, handlerecord_json) if handlerecord_json is None: raise ...
+ \ '". Only the first one is returned.') return list_of_entries[indices[0]]['data']['value']
def is_10320LOC_empty(self, handle, handlerecord_json=None): ''' Checks if there is a 10320/LOC entry in the handle record. *Note:* In the unlikely case that there is a 10320/LOC entry, but it does not contain any locations, it is treated as if there was none. :param handle: The handle. :param handlerecord_json: Option...
Avoids another GET request. :raises: :exc:`~b2handle.handleexceptions.HandleNotFoundException` :raises: :exc:`~b2handle.handleexceptions.HandleSyntaxError` :return: True if the record contains NO 10320/LOC entry; False if it does contain one. ''' LOGGER.debug('is_10320LOC_empty...') handlerecord_json = self.__get_handl...
list_of_locations: if item.get('href') is not None: num_URL += 1 if num_entries == 0: return True else: if num_URL == 0: return True else: return False
def generate_and_register_handle(self, prefix, location, checksum=None, additional_URLs=None, **extratypes): ''' Register a new Handle with a unique random name (random UUID). :param prefix: The prefix of the handle to be registered. The method will generate a suffix. :param location: The URL of the data entity to be r...
A list of URLs (as strings) to be added to the handle record as 10320/LOC entry. :raises: :exc:`~b2handle.handleexceptions.HandleAuthenticationError` :return: The new handle name. ''' LOGGER.debug('generate_and_register_handle...') handle = self.generate_PID_name(prefix) handle = self.register_handle( handle, location,...
def modify_handle_value(self, handle, ttl=None, add_if_not_exist=True, **kvpairs): ''' Modify entries (key-value-pairs) in a handle record. If the key does not exist yet, it is created. *Note:* We assume that a key exists only once. In case a key exists several time, an exception will be raised. *Note:* To modify 10320...
ttl: Optional. Integer value. If ttl should be set to a non-default value. :param all other args: The user can specify several key-value-pairs. These will be the handle value types and values that will be modified. The keys are the names or the handle value types (e.g. "URL"). The values are the new values to store in ...
new value needs to be of the form {'handle':'xyz', 'index':xyz}. The permissions will be set to the default permissions. :raises: :exc:`~b2handle.handleexceptions.HandleAuthenticationError` :raises: :exc:`~b2handle.handleexceptions.HandleNotFoundException` :raises: :exc:`~b2handle.handleexceptions.HandleSyntaxError` ''...
modify HS_ADMIN' raise IllegalOperationException( msg=msg, operation='modifying HS_ADMIN', handle=handle ) nothingchanged = True new_list_of_entries = [] list_of_old_and_new_entries = list_of_entries[:] keys = kvpairs.keys() for key, newval in kvpairs.items(): # Change existing entry: changed = False for i in xrange(le...
ignored anyway list_of_entries[i]['data'] = { 'format':'admin', 'value':newval } LOGGER.info('Modified' + \ ' "HS_ADMIN" of handle ' + handle) changed = True nothingchanged = False new_list_of_entries.append(list_of_entries[i]) list_of_old_and_new_entries.append(list_of_entries[i]) else: msg = 'There is several entries...
the entry doesn't exist yet, add it: if not changed: if add_if_not_exist: LOGGER.debug('modify_handle_value: Adding entry "' + key + '"' + \ ' to handle ' + handle) index = self.__make_another_index(list_of_old_and_new_entries) entry_to_add = self.__create_entry(key, newval, index, ttl) new_list_of_entries.append(entry...
nothingchanged: LOGGER.debug('modify_handle_value: There was no entries ' + \ str(kvpairs.keys()) + ' to be modified (handle ' + handle + ').' + \ ' To add them, set add_if_not_exist = True') else: op = 'modifying handle values' resp, put_payload = self.__send_handle_put_request( handle, new_list_of_entries, indices=in...
response=resp, msg=msg, payload=put_payload )
def delete_handle_value(self, handle, key): ''' Delete a key-value pair from a handle record. If the key exists more than once, all key-value pairs with this key are deleted. :param handle: Handle from whose record the entry should be deleted. :param key: Key to be deleted. Also accepts a list of keys. :raises: :exc:`~...
= self.retrieve_handle_record_json(handle) if handlerecord_json is None: msg = 'Cannot modify unexisting handle' raise HandleNotFoundException(handle=handle, msg=msg) list_of_entries = handlerecord_json['values'] # find indices to delete: keys = None indices = [] if type(key) != type([]): keys = [key] else: keys = key ...
in keys_done: indices_onekey = self.get_handlerecord_indices_for_key(key, list_of_entries) indices = indices + indices_onekey keys_done.append(key) # Important: If key not found, do not continue, as deleting without indices would delete the entire handle!! if not len(indices) > 0: LOGGER.debug('delete_handle_value: No ...
if hsresponses.handle_success(resp): LOGGER.debug("delete_handle_value: Deleted handle values " + str(keys) + "of handle " + handle) elif hsresponses.values_not_found(resp): pass else: raise GenericHandleError( operation=op, handle=handle, response=resp )
def delete_handle(self, handle, *other): '''Delete the handle and its handle record. If the Handle is not found, an Exception is raised. :param handle: Handle to be deleted. :param other: Deprecated. This only exists to catch wrong method usage by users who are used to delete handle VALUES with the method. :raises: :ex...
epic client, the method could be used for # deleting handle values (not entire handle) by specifying more # parameters. if len(other) > 0: message = 'You specified more than one argument. If you wanted' + \ ' to delete just some values from a handle, please use the' + \ ' new method "delete_handle_value()".' raise Type...
op=op) if hsresponses.handle_success(resp): LOGGER.info('Handle ' + handle + ' deleted.') elif hsresponses.handle_not_found(resp): msg = ('delete_handle: Handle ' + handle + ' did not exist, ' 'so it could not be deleted.') LOGGER.debug(msg) raise HandleNotFoundException(msg=msg, handle=handle, response=resp) else: rai...
def exchange_additional_URL(self, handle, old, new): ''' Exchange an URL in the 10320/LOC entry against another, keeping the same id and other attributes. :param handle: The handle to modify. :param old: The URL to replace. :param new: The URL to set as new URL. ''' LOGGER.debug('exchange_additional_URL...') handlereco...
) list_of_entries = handlerecord_json['values'] if not self.is_URL_contained_in_10320LOC(handle, old, handlerecord_json): LOGGER.debug('exchange_additional_URL: No URLs exchanged, as the url was not in the record.') else: self.__exchange_URL_in_13020loc(old, new, list_of_entries, handle) op = 'exchanging URLs' resp, pu...
' against ' + str(new) raise GenericHandleError( operation=op, handle=handle, reponse=resp, msg=msg, payload=put_payload )
def add_additional_URL(self, handle, *urls, **attributes): ''' Add a URL entry to the handle record's 10320/LOC entry. If 10320/LOC does not exist yet, it is created. If the 10320/LOC entry already contains the URL, it is not added a second time. :param handle: The handle to add the URL to. :param urls: The URL(s) to b...
Additional key-value pairs to set as attributes to the <location> elements, e.g. weight, http_role or custom attributes. Note: If the URL already exists but the attributes are different, they are updated! :raises: :exc:`~b2handle.handleexceptions.HandleNotFoundException` :raises: :exc:`~b2handle.handleexceptions.Handle...
url in urls: if not self.is_URL_contained_in_10320LOC(handle, url, handlerecord_json): is_new = True if not is_new: LOGGER.debug("add_additional_URL: No new URL to be added (so no URL is added at all).") else: for url in urls: self.__add_URL_to_10320LOC(url, list_of_entries, handle) op = 'adding URLs' resp, put_payload...
URLs ' + str(urls) raise GenericHandleError( operation=op, handle=handle, reponse=resp, msg=msg, payload=put_payload )
def remove_additional_URL(self, handle, *urls): ''' Remove a URL from the handle record's 10320/LOC entry. :param handle: The handle to modify. :param urls: The URL(s) to be removed. Several URLs may be specified. :raises: :exc:`~b2handle.handleexceptions.HandleNotFoundException` :raises: :exc:`~b2handle.handleexceptio...