Public: show the current draft for this patchset
482460
def status
      puts "Gergich DB: #{draft.db_file}"
      unless anything_to_publish?
        puts "Nothing to publish"
        return
      end

      info = commit.info
      puts "Project: #{info[:project]}"
      puts "Branch: #{info[:branch]}"
      puts "Revision: #{info[:revision_id]} (##{commit.revision_number})"
      puts "ChangeId: #{commit.change_id}"
      puts "Files:"
      puts "  #{commit.files.join("\n  ")}"

      puts
      review_info[:labels].each do |name, score|
        puts "#{name}: #{score}"
      end

      puts
      puts "Cover Message:"
      puts cover_message

      return if review_info[:comments].empty?

      puts
      puts "Inline Comments:"
      puts

      review_info[:comments].each do |file, comments|
        comments.each do |comment|
          puts "#{file}:#{comment[:line] || comment[:range]['start_line']}\n#{comment[:message]}"
        end
      end
    end
633420
def show_version(self):
        
        version_info = self.get_cli_version()
        version_info += self.get_runtime_version()
        print(version_info, file=self.out_file)
1252713
def show_ver(**kwargs):
    '''
    
    '''
    command = 'show version'
    info = ''
    info = show(command, **kwargs)
    if isinstance(info, list):
        info = info[0]
    return info
1162722
def current_view(self):
        ''''''
        state = self.state
        return (state.lat, state.lon, state.width, state.height,
                state.ground_width, state.mt.tiles_pending())
1217104
def __make_storeable_patch_patchable(self, patch):
        

        new_patch = {}
        for key in patch:
            new_patch[key.replace("|", ".")] = patch[key]

        return new_patch
526428
def _update_tokens(self, write_token=True, override=None,
                       patch_skip=False):
        """"""
        next_token = next(self.tokens)

        patch_value = ''
        patch_tokens = ''

        if self.pfile and write_token:
            token = override if override else self.token
            patch_value += token

        while next_token[0] in self.comment_tokens + whitespace:
            if self.pfile:
                if next_token[0] in self.comment_tokens:
                    while not next_token == '\n':
                        patch_tokens += next_token
                        next_token = next(self.tokens)
                patch_tokens += next_token

            # Several sections rely on StopIteration to terminate token search
            # If that occurs, dump the patched tokens immediately
            try:
                next_token = next(self.tokens)
            except StopIteration:
                if not patch_skip or next_token in ('=', '(', '%'):
                    patch_tokens = patch_value + patch_tokens

                if self.pfile:
                    self.pfile.write(patch_tokens)
                raise

        # Write patched values and whitespace + comments to file
        if not patch_skip or next_token in ('=', '(', '%'):
            patch_tokens = patch_value + patch_tokens

        if self.pfile:
            self.pfile.write(patch_tokens)

        # Update tokens, ignoring padding
        self.token, self.prior_token = next_token, self.token
600828
def edit(self, title=github.GithubObject.NotSet, body=github.GithubObject.NotSet, state=github.GithubObject.NotSet, base=github.GithubObject.NotSet):
        
        assert title is github.GithubObject.NotSet or isinstance(title, (str, unicode)), title
        assert body is github.GithubObject.NotSet or isinstance(body, (str, unicode)), body
        assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state
        assert base is github.GithubObject.NotSet or isinstance(base, (str, unicode)), base
        post_parameters = dict()
        if title is not github.GithubObject.NotSet:
            post_parameters["title"] = title
        if body is not github.GithubObject.NotSet:
            post_parameters["body"] = body
        if state is not github.GithubObject.NotSet:
            post_parameters["state"] = state
        if base is not github.GithubObject.NotSet:
            post_parameters["base"] = base
        headers, data = self._requester.requestJsonAndCheck(
            "PATCH",
            self.url,
            input=post_parameters
        )
        self._useAttributes(data)
576767
def current_state(self):
        
        field_names = set()
        [field_names.add(f.name) for f in self._meta.local_fields]
        [field_names.add(f.attname) for f in self._meta.local_fields]
        return dict([(field_name, getattr(self, field_name)) for field_name in field_names])
841728
def apply_patches(self):
        

        success = True
        for name, patch in sorted(self):
            success = self.apply_patch(patch)
        return success
497281
function () {
        function checkUpdate() {
            var current = module.exports.current();
            if (current !== last) {
                last = current;
                events.trigger('update', current);
            }
        }

        // Do not run unless breakpoints are available.
        if (!running && breakpoints.length) {
            running = true;
            global.addEventListener('resize', function () {
                if (!working) {
                    working = true;
                    global.requestAnimationFrame(function () {
                        checkUpdate();
                        working = false;
                    });
                }
            });
        }
        checkUpdate();
    }
484874
def current_revision(self):
        
        if self.current_index is None:
            return None

        if len(self.revisions) > self.current_index:
            return self.revisions[self.current_index]

        return None
1197411
def generate_version(max_major: int = 1, max_minor: int = 7,
                     max_patch: int = 15) -> str:
    
    major = randint(0, max_major)
    minor = randint(0, max_minor)
    patch = randint(0, max_patch)
    return '{:d}.{:d}.{:d}'.format(major, minor, patch)
69089
def get_draft(self):
        
        if self.is_draft:
            return self
        elif self.is_published:
            draft = self.publishing_draft
            # Previously the reverse relation could be `DraftItemBoobyTrapped`
            # in some cases. This should be fixed by extra monkey-patching of
            # the `publishing_draft` field in icekit.publishing.apps, but we
            # will leave this extra sanity check here just in case.
            if hasattr(draft, 'get_draft_payload'):
                draft = draft.get_draft_payload()
            return draft
        raise ValueError(  # pragma: no cover
            "Publishable object %r is neither draft nor published" % self)
35528
def <<(patch)
      known_patch = @patches[patch.name]
      if known_patch.nil?
        @patches[patch.name] = patch
      elsif patch.content != known_patch.content
        raise ContradictionError, [known_patch, patch]
      end
    end
1126504
def patch(self):
        """"""
        original = self.__dict__['__original__']
        return jsonpatch.make_patch(original, dict(self)).to_string()
1115276
def list_current_filter_set(self,raw=False):
        """"""
        
        buf = []

        self.open_umanager()
        self.ser.write(''.join((self.cmd_current_filter_list,self.cr)))
        if self.read_loop(lambda x: x.endswith(self.umanager_prompt),self.timeout,lambda x,y,z: buf.append(y.rstrip()[:-1])):
            if raw:
                rv = buf = buf[0]
            else:
                rv, buf = self.filter_organizer(buf[0])
        else:
            raise Dam1021Error(16,"Failed to list currently selected filter set")
        self.close_umanager()

        log.info(buf)

        return rv
300434
def get_current_generator(self):
        """"""
        int_index=int(len(self.generators)*wrap(0,1.0,self.inspect_value('index')))
        return self.generators[int_index]